Skip to main content

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

  1. 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:

  1. Install the library:
pip install hestia_earth.models
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hestia-earth-orchestrator-0.6.18.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file hestia-earth-orchestrator-0.6.18.tar.gz.

File metadata

File hashes

Hashes for hestia-earth-orchestrator-0.6.18.tar.gz
Algorithm Hash digest
SHA256 eecc5aea4c5ab666063aa3514d49a6aea6c4cb23197df62fd88148106699705d
MD5 2f35bb386d58c1c425ee8665365acd9f
BLAKE2b-256 c5df80edf389a02065a59f8696eb6bae7c7f493ee902f22eb372717e6543cca1

See more details on using hashes here.

File details

Details for the file hestia_earth_orchestrator-0.6.18-py3-none-any.whl.

File metadata

File hashes

Hashes for hestia_earth_orchestrator-0.6.18-py3-none-any.whl
Algorithm Hash digest
SHA256 84d44f5d73aecdea1c76743c09d44b9a3bb780fc1cd05d4712db8f7d8003ba64
MD5 4f5270083c288b6e4b65d64ef137fe4d
BLAKE2b-256 3a65b496a3bd01b5ce691973a452124588a3026d57187a66a4f4b54731e9cfcd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page