Skip to content

Instantly share code, notes, and snippets.

@sabrinalui
Last active February 22, 2024 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sabrinalui/3c830f6d972263b6bdf6c48fb5c43ace to your computer and use it in GitHub Desktop.
Save sabrinalui/3c830f6d972263b6bdf6c48fb5c43ace to your computer and use it in GitHub Desktop.
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