@hestia-earth/aggregation-engine
v0.23.10
Published
HESTIA Aggregation Engine
Maintainers
Readme
HESTIA Aggregation Engine
Documentation
Official documentation can be found on Read the Docs.
Documentation of the aggregation process can be found in the docs folder.
Install
- Install the module:
pip install hestia_earth.aggregationUsage
from hestia_earth.aggregation import aggregate
# `country` and `product` are glossary Terms
country = {'@type': 'Term', '@id': 'GADM-JPN', 'name': 'Japan', 'termType': 'region'}
product = {'@type': 'Term', '@id': 'wheatGrain', 'name': 'Wheat, grain', 'termType': 'crop'}
aggregates = aggregate(country=country, product=product, start_year=2010, end_year=2025)Generating Covariance matrix
To generate the covariance matrix, some CSV files are generated and stored in a folder.
By default, these files are created in the /tmp/covariance directory and removed at the end of the aggregation. Set the TMP_DIR env variable to use $TMP_DIR/covariance instead.
You can also choose a different storage method with the AGGREGATION_COVARIANCE_STORAGE env variable:
temporary: default value, will store the files in$TMP_DIR/covarianceand delete them at the end;s3#<folder>: upload the files on the S3 bucket defined by the variableAWS_BUCKET_UPLOADS;local#<folder>: copy the files to a local folder.
