Hestia's module to orchestrate the models.
Project description
Hestia Engine Orchestrator
Orchestrate your different models to run on a Cycle, an ImpactAssessment or a Site.
Documentation
Documentation can be found in the source folder.
Install
- Install the library:
pip install hestia_earth.orchestrator
You can now install your own models or follow the steps below to use the default Hestia models.
Install the Hestia Models
If you want to use the hestia default models, follow these steps:
- Install the library:
pip install hestia_earth.models
- Download the latest configuration files:
curl https://gitlab.com/hestia-earth/hestia-engine-orchestrator/-/raw/master/scripts/download_config.sh?inline=false -o download_config.sh && chmod +x download_config.sh
# pip default install directory is /usr/local/lib/python<version>/site-packages
./download_config.sh <pip install directory>
Using your own models
You can create your own models in addition (or instead of) the default set of models provided by Hestia.
The model needs to expose only one method:
def run(key: str, data): ...
It will be given the data that has been given to the orchestrator, i.e. by calling:
from hestia_earth.orchestrator import run
my_data = {'@type': 'Cycle', 'inputs': []}
config = {
"models": [{
"key": "inputs",
"model": "my_model",
"value": "my_model_value",
"runStrategy": "add_if_missing_key"
}]
}
run(my_data, config)
Will be calling in your own model my_model.py
:
def run('my_model_value', my_data: dict): ...
Usage
# will work with either Cycle or Site
from hestia_earth.orchestrator import run
# cycle is a JSONLD node cycle
cycle = {'@type': 'Cycle', ...}
result = run(cycle, '/path/to/my-config.json') # configuration stored in a file
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for hestia-earth-orchestrator-0.6.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45587b3d159cf86d3a9220c627e737f90bbe8385e29e98dd756a800786571249 |
|
MD5 | 6f2824d831eba4b81b6d622e950eba88 |
|
BLAKE2b-256 | 230b8f7b3b940a04cbdaf7f8ddbed7980646782693e45b67daeb1be27560cc79 |
Close
Hashes for hestia_earth_orchestrator-0.6.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0fe104fa2087a85c86b8a7831068998a6d7270e2dcb0e22eab28cfbd22fbe89 |
|
MD5 | 43f5fc5d85490a82b7d1037c8c66674e |
|
BLAKE2b-256 | bd52e4dd33d4882b029d6b3286727a17e65da9d0c00da0a909c1499b415802e1 |