hestia-earth-orchestrator


Namehestia-earth-orchestrator JSON
Version 0.2.3 PyPI version JSON
download
home_pagehttps://gitlab.com/hestia-earth/hestia-engine-orchestrator
SummaryHestia's module to orchestrate the models.
upload_time2021-08-09 15:24:25
maintainer
docs_urlNone
authorHestia Team
requires_python
licenseGPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](./hestia_earth/orchestrator).

## Install

1. Install the library:
```bash
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](/hestia-earth/hestia-engine-models), follow these steps:

1. Install the library:
```bash
pip install hestia_earth.models
```
2. Download the latest configuration files:
```bash
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:
```python
def run(key: str, data): ...
```
It will be given the data that has been given to the orchestrator, i.e. by calling:
```python
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`:
```python
def run('my_model_value', my_data: dict): ...
```

### Usage

```python
# 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)
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/hestia-earth/hestia-engine-orchestrator",
    "name": "hestia-earth-orchestrator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Hestia Team",
    "author_email": "guillaumeroyer.mail@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6d/f7/2419b604a9c2b14b0d5614a24ac55e6263dceda24819657aec74167fa8fa/hestia-earth-orchestrator-0.2.3.tar.gz",
    "platform": "",
    "description": "# Hestia Engine Orchestrator\n\nOrchestrate your different models to run on a Cycle, an ImpactAssessment or a Site.\n\n## Documentation\n\nDocumentation can be found in the [source folder](./hestia_earth/orchestrator).\n\n## Install\n\n1. Install the library:\n```bash\npip install hestia_earth.orchestrator\n```\n\nYou can now install your own models or follow the steps below to use the default Hestia models.\n\n### Install the Hestia Models\n\nIf you want to use the [hestia default models](/hestia-earth/hestia-engine-models), follow these steps:\n\n1. Install the library:\n```bash\npip install hestia_earth.models\n```\n2. Download the latest configuration files:\n```bash\ncurl 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\n# pip default install directory is /usr/local/lib/python<version>/site-packages\n./download_config.sh <pip install directory>\n```\n\n### Using your own models\n\nYou can create your own models in addition (or instead of) the default set of models provided by Hestia.\n\nThe model needs to expose only one method:\n```python\ndef run(key: str, data): ...\n```\nIt will be given the data that has been given to the orchestrator, i.e. by calling:\n```python\nfrom hestia_earth.orchestrator import run\n\nmy_data = {'@type': 'Cycle', 'inputs': []}\nconfig = {\n  \"models\": [{\n    \"key\": \"inputs\",\n    \"model\": \"my_model\",\n    \"value\": \"my_model_value\",\n    \"runStrategy\": \"add_if_missing_key\"\n  }]\n}\nrun(my_data, config)\n```\nWill be calling in your own model `my_model.py`:\n```python\ndef run('my_model_value', my_data: dict): ...\n```\n\n### Usage\n\n```python\n# will work with either Cycle or Site\nfrom hestia_earth.orchestrator import run\n\n# cycle is a JSONLD node cycle\ncycle = {'@type': 'Cycle', ...}\nresult = run(cycle, '/path/to/my-config.json')  # configuration stored in a file\nprint(result)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "Hestia's module to orchestrate the models.",
    "version": "0.2.3",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "457c622159cc3514be042ebf8eced2ab",
                "sha256": "0a338a0483879e412117cf5ba10fcfcc388200778c6bbba313c7344d1151dacd"
            },
            "downloads": -1,
            "filename": "hestia_earth_orchestrator-0.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "457c622159cc3514be042ebf8eced2ab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 30265,
            "upload_time": "2021-08-09T15:24:23",
            "upload_time_iso_8601": "2021-08-09T15:24:23.927028Z",
            "url": "https://files.pythonhosted.org/packages/e7/c1/249ab438e8dd2463c4f5f7db9e038fbd902036a38d45d9a7954ce65ad0a0/hestia_earth_orchestrator-0.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "fcf116322e1e3d2e8ccec7a3494d329b",
                "sha256": "c942a97b426e763686fefe7e4364aeb549eef7a176e9179aa570105da1ce04ce"
            },
            "downloads": -1,
            "filename": "hestia-earth-orchestrator-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "fcf116322e1e3d2e8ccec7a3494d329b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23347,
            "upload_time": "2021-08-09T15:24:25",
            "upload_time_iso_8601": "2021-08-09T15:24:25.166801Z",
            "url": "https://files.pythonhosted.org/packages/6d/f7/2419b604a9c2b14b0d5614a24ac55e6263dceda24819657aec74167fa8fa/hestia-earth-orchestrator-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-08-09 15:24:25",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "gitlab_user": "hestia-earth",
    "gitlab_project": "hestia-engine-orchestrator",
    "lcname": "hestia-earth-orchestrator"
}
        
Elapsed time: 0.34165s