Metadata-Version: 2.5
Name: sirocco
Version: 0.1.0
Summary: A library for creating weather and climate workflows.
Project-URL: Repository, https://github.com/C2SM/Sirocco.git
Project-URL: Documentation, https://sirocco.ethz.ch
Project-URL: Changelog, https://github.com/C2SM/Sirocco/blob/main/CHANGELOG.md
Author-email: Matthieu Leclair <matthieu.leclair@c2sm.ethz.ch>, Julian Geiger <julian.geiger@psi.ch>, Alexander Goscinski <alexander.goscinski@psi.ch>
License: MIT License
        
        Copyright (c) 2024 ETH Zürich
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords:  icon,aiida,aiida-workgraph,workflow
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: >=3.12
Requires-Dist: coverage~=7.0
Requires-Dist: dotenv~=0.9
Requires-Dist: f90nml~=1.5
Requires-Dist: ipdb~=0.13
Requires-Dist: isodate~=0.7
Requires-Dist: isoduration~=20.11
Requires-Dist: jinja2~=3.0
Requires-Dist: lxml~=6.0
Requires-Dist: pydantic~=2.0
Requires-Dist: pygraphviz~=2.0
Requires-Dist: rich~=15.0.0
Requires-Dist: ruamel-yaml~=0.19
Requires-Dist: termcolor~=3.0
Requires-Dist: typer~=0.27.2
Requires-Dist: types-pyyaml~=6.0
Description-Content-Type: text/markdown

<p align="center">
  <img alt="Sirocco logo" src="./docs/assets/Sirocco_Logo2026_BrunRVB.svg#gh-light-mode-only" width="500" />
  <img alt="Sirocco logo" src="./docs/assets/Sirocco_Logo2026_BeigeRVB.svg#gh-dark-mode-only" width="500" />
</p>

<p align="center">
  <a href="https://sirocco.ethz.ch"><b>Documentation</b></a> ·
  <a href="https://sirocco.ethz.ch/usage/standalone/">Getting started</a> ·
  <a href="./CHANGELOG.md">Changelog</a>
</p>

**Sirocco** is a Python workflow tool for climate and weather applications running on HPC systems. Workflows are described in a YAML dialect inspired by [Cylc](https://cylc.github.io/) and [AiiDA](https://www.aiida.net/), and unrolled into a graph of tasks and data.

- **Data as graph nodes.** Tasks explicitly declare the data they consume and produce, through named ports. No task needs to make assumptions on where others read or write, so workflows are truly composable.
- **Cycles.** Recurring sets of tasks with their own periodicity, so that describing climate and weather workflows feels natural.
- **Parameters.** Ensemble and sensitivity experiments through parameterized tasks and data.
- **Deep propagating task front.** Tasks are submitted ahead of time, chained by scheduler dependencies, in a window that moves through the graph as tasks complete. Tasks no longer wait for their parents to finish before entering the queue.
- **Plugins.** A general purpose `shell` plugin and a dedicated plugin for the [ICON](https://www.icon-model.org) model, covering complex setups such as coupled runs on hybrid CPU/GPU architectures.
- **Two engines.** A standalone engine running autonomously on the HPC system, with the scheduler as the sole daemon, and an [AiiDA](https://www.aiida.net/) based engine (under development) running on a dedicated server.

## Example

An ICON atmosphere simulation running month by month, restarting from its previous state, with its output streams post-processed by a user script:

```yaml
scheduler: slurm
cycles:
  - monthly:
      cycling:
        start_date: "2000-01-01T00:00"
        stop_date: "2000-07-01T00:00"
        period: "P1M"
      tasks:
        - icon:
            components:
              atm:
                inputs:
                  dynamics_grid_file: [icon grid]
                  restart_in:
                    - restart:
                        when:
                          after: "2000-01-01T00:00"
                        target_cycle:
                          lag: "-P1M"
                outputs:
                  restart_out: [restart]
                  output_streams: [atm 2d, atm 3d]
        - post proc:
            inputs:
              streams: [atm 2d, atm 3d]
            outputs:
              diagnostics: [diagnostics]
tasks:
  - ROOT:
      computer: santis
      account: my_account
      walltime: "01:00:00"
  - SIROCCO:  # For the standalone orchestration engine
      walltime: "00:05:00"
      venv: /path/to/sirocco/.venv
  - icon:
      plugin: icon
      uenv: icon/25.2:v3
      nodes: 4
      procs_per_node: 128
      exe:
        cpu:
          path: /path/to/icon
          procs:
            atm:
              compute_weight: 1
              streams: 2
      namelists:
        - ICON/icon_master.namelist
        - ICON/NAMELIST_exclaim_ape_R02B04
  - post proc:
      plugin: shell
      src: scripts/post_proc.sh
      command: ./post_proc.sh {PORT::streams}
data:
  available:
    - icon grid:
        path: /path/to/icon_grid_0013_R02B04_R.nc
  generated:
    - restart: {}
    - atm 2d: {}
    - atm 3d: {}
    - diagnostics:
        path: diagnostics
```

The namelists are files of the configuration directory, next to `sirocco.yaml`. See the [configuration](https://sirocco.ethz.ch/configuration/configuration/) and [ICON plugin](https://sirocco.ethz.ch/plugins/icon/) documentation for the complete syntax.

## Getting started

Sirocco requires Python `>=3.12` and, for the standalone engine, an HPC system using the [SLURM](https://slurm.schedmd.com/) scheduler (currently the only supported one). Install it on the HPC system, preferably with [uv](https://docs.astral.sh/uv/):

```bash
uv pip install sirocco
```

Then, from the configuration directory (containing `sirocco.yaml`):

```bash
sirocco verify      # validate the configuration
sirocco visualize   # render the unrolled workflow graph as an svg
sirocco start       # start the workflow
sirocco stviz       # render the current state of the task front
```

See [Usage](https://sirocco.ethz.ch/usage/standalone/) for all commands, including `stop` and `restart`.

The AiiDA engine requires a development install (`git clone` then `uv sync --group aiida` or `hatch shell`), see the [AiiDA engine documentation](https://sirocco.ethz.ch/usage/aiida/).

## Development

Sirocco uses [hatch](https://hatch.pypa.io) to manage environments:

```bash
git clone https://github.com/C2SM/Sirocco.git
cd Sirocco
hatch test                # run the tests
hatch test --all          # run the tests on all supported Python versions
hatch check fmt           # check formatting
hatch check code          # lint
hatch run types:check     # type check
hatch run docs:serve      # live preview of the documentation
```

## Contact

For questions about Sirocco or to discuss a use case, contact [Matthieu Leclair](mailto:matthieu.leclair@c2sm.ethz.ch). For bugs and feature requests, please open an [issue](https://github.com/C2SM/Sirocco/issues).

## License

Sirocco is released under the [MIT license](./LICENSE).

## Acknowledgments

We would like to acknowledge the [EXCLAIM](https://exclaim.ethz.ch) and [Swiss Twins](https://www.cscs.ch/about/collaborations/swisstwins) projects for the initial funding of Sirocco.
