Last active
February 22, 2024 18:36
-
-
Save sabrinalui/3c830f6d972263b6bdf6c48fb5c43ace to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from featurestore import open_featurestore | |
from featurestore.domain.featurestores import FeaturestoreReference | |
# https://flyte.labs.pachama.com/console/projects/baseline/domains/development/executions/fc1hfynprlwrkk-n5-0?duration=all | |
dev_featurestore = open_featurestore( | |
FeaturestoreReference( | |
collection="gs://labs-featurestore/managed/9a873487-91e5-4e83-a965-f737de4ec2c6", | |
group="group", | |
) | |
) | |
# https://flyte.labs.pachama.com/console/projects/baseline/domains/staging/executions/f6pbmc135vcf6a-n5-0?duration=all | |
stage_featurestore = open_featurestore( | |
FeaturestoreReference( | |
collection="gs://labs-featurestore/managed/7d495458-6e14-414a-a58b-d7f6c6c8ac5e", | |
group="group", | |
) | |
) | |
for data_var in [ | |
"EnvironmentalFeatures_GPP", | |
"ModisTreeCoverFeatures_Percent_Tree_Cover", | |
"SRTMFeatures_slope", | |
"StaticGFWFeatures_lossyear", | |
"distance_to_StaticGFWFeatures_lossyear", | |
"iucn_mask", | |
"verra_carbon_project", | |
]: | |
dev_var = dev_featurestore[data_var] | |
dev_da = dev_var.data.compute() | |
stage_var = stage_featurestore[data_var] | |
stage_da = stage_var.data.compute() | |
diff = (dev_da!=stage_da).sum() | |
print(f"{data_var}: {dev_var.equals(stage_var)}, {diff/dev_da.size:.2%} diff") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment