Metadata-Version: 2.4
Name: earthkit-workflows-anemoi
Version: 0.3.2
Summary: An earthkit-workflows interface to anemoi inference
Author-email: "European Centre for Medium-Range Weather Forecasts (ECMWF)" <software.support@ecmwf.int>
License-Expression: Apache-2.0
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anemoi-datasets>=0.5.21
Requires-Dist: anemoi-inference>=0.5.3
Requires-Dist: earthkit-workflows
Provides-Extra: docs
Requires-Dist: autodoc-pydantic; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: pandoc; extra == "docs"
Requires-Dist: rstfmt; extra == "docs"
Requires-Dist: sphinx<8.2; extra == "docs"
Requires-Dist: sphinx-argparse<0.5; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Provides-Extra: tests
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-mock; extra == "tests"
Dynamic: license-file

# earthkit-workflows-anemoi

<p align="center">
  <a href="https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity">
    <img src="https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity/sandbox_badge.svg" alt="Static Badge">
  </a>

<a href="https://codecov.io/gh/ecmwf/earthkit-workflows-anemoi">
    <img src="https://codecov.io/gh/ecmwf/earthkit-workflows-anemoi/branch/develop/graph/badge.svg" alt="Code Coverage">
  </a>

<a href="https://opensource.org/licenses/apache-2-0">
    <img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License: Apache 2.0">
  </a>

<a href="https://github.com/ecmwf/earthkit-workflows-anemoi/releases">
    <img src="https://img.shields.io/github/v/release/ecmwf/earthkit-workflows-anemoi?color=blue&label=Release&style=flat-square" alt="Latest Release">
  </a>
</p>

> \[!IMPORTANT\]
> This software is **Sandbox** and subject to ECMWF's guidelines on [Software Maturity](https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity).

Earthkit-Workflows-Anemoi is a Python library for connecting [anemoi-inference](https://github.com/ecmwf/anemoi-inference) to [earthkit-workflows](https://github.com/ecmwf/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

Install via `pip` with:

```bash
pip install 'earthkit-workflows-anemoi[all]'
```

For development, you can use `pip install -e .` Additionally you may want to install pre-commit hooks via

```bash
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:

```python

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

```

Given other nodes as the initial conditions:

```python

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)

```
