Skip to main content

An earthkit-workflows interface to anemoi inference

Project description

earthkit-workflows-anemoi

Static Badge Code Coverage License: Apache 2.0 Latest Release

[!IMPORTANT] This software is Sandbox and subject to ECMWF's guidelines on Software Maturity.

Earthkit-Workflows-Anemoi is a Python library for connecting anemoi-inference to earthkit-workflows. Allowing for the inference tasks to be run as part of a larger DAG. It provides an API to directly create a graph consisting of initial condition retrieval and model execution, or to run inference off other source nodes which themselves are the initial conditions.

Installation

The package has a split dependency structure to allow flexible installation:

For workflow creation (minimal)

To create workflows without running them locally:

pip install earthkit-workflows-anemoi

This installs only the core dependencies needed to define and serialize workflows.

For workflow execution (full runtime)

To both create and execute workflows locally:

pip install 'earthkit-workflows-anemoi[runtime]'

This includes anemoi-inference and anemoi-datasets required for local execution.

For development

git clone https://github.com/ecmwf/earthkit-workflows-anemoi.git
cd earthkit-workflows-anemoi
pip install -e '.[dev]'

Additionally you may want to install pre-commit hooks:

pip install pre-commit
pre-commit install

Quick Start

To create a graph relying on anemoi-inference to get the initial conditions the following can be used:

from earthkit.workflows.plugins import anemoi as anemoi_workflows

CKPT = {'huggingface': 'ecmwf/aifs-single-1.0'}

model_action = anemoi_workflows.fluent.from_input(CKPT, 'mars', '2022-01-01T00:00', lead_time = '7D', ensemble_members=51)
model_action

Note: For models with multiple datasets (supported since anemoi-inference 0.11.0), the resulting action includes a dataset dimension. Use .select({"dataset": "era5"}) to select a specific dataset if needed.

Given other nodes as the initial conditions:

from earthkit.workflows.plugins import anemoi as anemoi_workflows
from earthkit.workflows import fluent

SOURCE_NODES: fluent.Action
CKPT = {'huggingface': 'ecmwf/aifs-single-1.0'}

SOURCE_NODES.anemoi.infer(CKPT, lead_time = '7D', ensemble_members = 51)

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

earthkit_workflows_anemoi-0.7.2.tar.gz (51.6 kB view details)

Uploaded Source

Built Distribution

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

earthkit_workflows_anemoi-0.7.2-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file earthkit_workflows_anemoi-0.7.2.tar.gz.

File metadata

File hashes

Hashes for earthkit_workflows_anemoi-0.7.2.tar.gz
Algorithm Hash digest
SHA256 d199377b1ed0053cb7ecd516a6a750bc79154b71c0757cccc0b9e182b04f4f9f
MD5 18a40456eca6b57c17f66c6ebb4b9a45
BLAKE2b-256 6ae79032baee1f6628821513cafc4c5e3eed09f9cd0388a3d9fece7b75ce03cb

See more details on using hashes here.

File details

Details for the file earthkit_workflows_anemoi-0.7.2-py3-none-any.whl.

File metadata

File hashes

Hashes for earthkit_workflows_anemoi-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52f43b9b99eccecbdecbef6e04d76fca5e3aac0865ba0e749f0a37f22e14b4b6
MD5 81af0bdb8137e688c9e83f53d43ae4c4
BLAKE2b-256 6c38e63c482a5bc5a9141e76a090e1060e6b93611d827540a78881536f413d7a

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