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.

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. Install the config library:
pip install hestia_earth_config

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
from hestia_earth.config import load_config

# cycle is a JSONLD node cycle
cycle = {'@type': 'Cycle', ...}
result = run(cycle, load_config(cycle))
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.20.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hestia_earth_orchestrator-0.6.20-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for hestia-earth-orchestrator-0.6.20.tar.gz
Algorithm Hash digest
SHA256 385f944cb7322d86f2cc31df6fda7cc38e1e8d555fdd496665bfae71873f99f8
MD5 0fa4902397c4bb6ee61e3c43776ed9f1
BLAKE2b-256 9b8384698e752cedecdc547df7ce80ebb0eaf655497f773af979f2ed415fb8bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hestia_earth_orchestrator-0.6.20-py3-none-any.whl
Algorithm Hash digest
SHA256 985f072d4a684e669d84f060c6d758cb508264ec3b3de15e496a66aa925cb23c
MD5 1db33dafcd7d3b466da95b9139de7b55
BLAKE2b-256 fe36f769214b511ae1b3dbb1f75524a9a9440305f83c60d2454470dfb56d9914

See more details on using hashes here.

Supported by

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