Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7799a8d
feat: Automate xclim indicator wrapper generation and testing, replac…
Nov 21, 2025
54ff1de
Improve docstring for wrap_xclim_indicator
AntonioCC808 Nov 21, 2025
74a6ebd
refactor: Replace generic indicator generation and integration tests …
Dec 1, 2025
f364375
feat: create `api` package
Dec 1, 2025
29ca14e
refactor: Simplify indicator function signatures, remove explicit uni…
Dec 1, 2025
9f675fc
refactor: Simplify indicator function inputs to accept a single earth…
Dec 1, 2025
e9b83e1
feat: Add percentile calculation utility and refactor WSDI to accept …
Dec 1, 2025
5d03d99
feat: add performance analysis notebook, standardize temperature unit…
Dec 9, 2025
7a07363
feat: add performance analysis notebook for climate indicators and up…
Dec 9, 2025
4a7ce73
chore: Update locked dependencies in pixi.lock.
Dec 10, 2025
2e7e2e3
fix: dataset argument in precipitation indices renamed to ds
Dec 10, 2025
7ca881a
fix: dataset argument in precipitation indices renamed to ds
Dec 10, 2025
e97fd6b
refactor: Update percentile function name, add type hints and docstri…
Dec 10, 2025
913c929
feat: Add system information cell and memory profiling to performance…
Dec 10, 2025
b3cb9bb
refactor: performance analysis updated
Dec 11, 2025
88d3761
docs: enhance `index.md` with detailed `xclim` integration, climate i…
Dec 11, 2025
9cd4398
docs: Update example notebooks and refresh project dependencies.
Dec 11, 2025
f312f3d
refactor: remove auto-generation of xclim indicator wrappers by delet…
Dec 11, 2025
14c08f2
refactor: Migrate development tasks from Makefile to pixi and update …
Dec 11, 2025
8dc9cb6
feat: Migrate documentation from Markdown to reStructuredText, add a …
Dec 12, 2025
3226ded
fix: tests
Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/check-wrappers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Wrappers

on:
push:
branches:
- main
pull_request:

jobs:
check-wrappers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .

- name: Generate wrappers
run: |
export PYTHONPATH=$PYTHONPATH:$(pwd)/src
python src/earthkit/climate/generate_wrappers.py

- name: Check for changes
run: |
git diff --exit-code
33 changes: 0 additions & 33 deletions Makefile

This file was deleted.

113 changes: 74 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,53 @@
<p align="center">
<picture>
<source srcset="https://github.com/ecmwf/logos/raw/refs/heads/main/logos/earthkit/earthkit-climate-dark.svg" media="(prefers-color-scheme: dark)">
<img src="https://github.com/ecmwf/logos/raw/refs/heads/main/logos/earthkit/earthkit-climate-light.svg" height="120">
</picture>
</p>

<p align="center">
<a href="https://github.com/ecmwf/codex/raw/refs/heads/main/ESEE">
<img src="https://github.com/ecmwf/codex/raw/refs/heads/main/ESEE/foundation_badge.svg" alt="ECMWF Software EnginE">
</a>
<a href="https://github.com/ecmwf/codex/raw/refs/heads/main/Project Maturity">
<img src="https://github.com/ecmwf/codex/raw/refs/heads/main/Project Maturity/emerging_badge.svg" alt="Maturity Level">
</a>
<a href="https://opensource.org/licenses/apache-2-0">
<img src="https://img.shields.io/badge/Licence-Apache 2.0-blue.svg" alt="Licence">
</a>
<a href="https://github.com/ecmwf/earthkit-climate/releases">
<img src="https://img.shields.io/github/v/release/ecmwf/earthkit-climate?color=purple&label=Release" alt="Latest Release">
</a>
</p>

<p align="center">
<a href="#quick-start">Quick Start</a>
<a href="https://earthkit-climate.readthedocs.io/en/latest/">Documentation</a>
</p>

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

# earthkit-climate

**A toolkit for statistical analysis and processing of climate and geospatial data.**
**earthkit-climate** is the package responsible for the climate index calculation within the earthkit ecosystem. It includes a wrapper prototype that allows the use of the `xclim` python package to compute a large amount of pre-defined climate indices used by the climate science community, and to define new ones.

`xclim` relies heavily on the `xarray` python library and the `numpy` & `scipy` ecosystem. Its main elements are:

`earthkit-climate` provides tools to compute and analyze **climate indicators** (e.g., precipitation, temperature) and perform **unit conversions, percentiles, and provenance tracking**.
It is part of the **Earthkit ecosystem** and designed for reproducible, modular workflows.
- **Climate indices**: available to be directly computed with python functions. The input and output units are defined in these functions by using a decorator and are validated during runtime.
- **Climate indicators**: climate indices wrapped in an object that provides more metadata and validation facilities (health checks) of the input. it includes attributes for CF metadata (cell methods), references, keywords, and more.
- **Lower level process functions**: these include aggregation, computation spell length and counting, optimized computation of reference percentiles, bias correction methods and ensemble statistics. These functions are used by the implemented indices and can also be used to build new indices not included in the library.

______________________________________________________________________
---

## Disclaimer

This project is currently in **BETA** and **experimental**.
Interfaces, structure, and functionality are subject to change without notice.
Do **not** use this software in any operational or production system.

______________________________________________________________________
---

## Quick Start

Expand All @@ -33,14 +67,14 @@ from earthkit.climate.utils import conversions
pr = precipitation.simple_daily_intensity(precip_data, freq="monthly")
```

______________________________________________________________________
---

## Documentation

For full documentation, including API reference and example notebooks, visit the
[earthkit-climate ReadTheDocs page](https://earthkit-climate.readthedocs.io)

______________________________________________________________________
---

## Development & Contribution Workflow

Expand All @@ -52,76 +86,77 @@ It provides fast, reproducible environments and replaces Conda-based workflows.
Install Pixi following the [official instructions](https://pixi.sh/latest/#installation), then run:

```bash
pixi install --locked
pixi shell
pixi install
```

This command installs all dependencies as defined in `pyproject.toml` and `pixi.lock`.

### 2. Install the package
### 2. Common Tasks

Inside the Pixi environment:
This project uses `pixi` tasks to manage development workflows, replacing the legacy `Makefile`.

```bash
pip install -e .
```
- **Quality Assurance**: Run pre-commit hooks to ensure code quality.

### 3. Quality checks and tests
```bash
pixi run qa
```

Before pushing to GitHub, run:
- **Unit Tests**: Run the test suite using pytest.

```bash
make qa
make unit-tests
```
```bash
pixi run unit-tests
```

You can also perform type checking and integration tests:
- **Type Checking**: Run static type analysis with mypy.

```bash
make type-check
make integration-tests
```
```bash
pixi run type-check
```

### 4. Documentation
- **Build Documentation**: Build the Sphinx documentation. Note that this task runs in the `docs` environment.

To build the documentation locally (using Sphinx):
```bash
pixi run -e docs docs-build
```

```bash
make docs-build
```
- **Docker**: Build and run the docker container.

### 5. Optional: Sync with ECMWF template
```bash
pixi run docker-build
pixi run docker-run
```

```bash
make template-update
```
- **Sync with ECMWF template**:
```bash
pixi run template-update
```

______________________________________________________________________
---

## Project Structure

```
earthkit-climate/
├── src/earthkit/
│ ├── climate/
│ │ ├── api/ # API wrapper logic
│ │ ├── indicators/ # Climate indices (precipitation, temperature, etc.)
│ │ └── utils/ # Type conversions, percentiles, provenance
│ └── __init__.py
├── tests/
│ ├── integration/ # Integration tests
│ └── unit/ # Unit tests for indicators and utils
│ ├── unit/ # Unit tests for indicators and utils
│ └── test_00_version.py # Version check
├── docs/ # Sphinx documentation
├── ci/ # Continuous integration configs
├── .github/workflows/ # GitHub Actions (push/release)
├── .pixi/ # Pixi configuration
├── pixi.lock # Locked dependency versions
├── Dockerfile # Pixi-based container
├── pyproject.toml # Project configuration
├── Makefile # Developer utilities (Pixi integrated)
└── README.md
```

______________________________________________________________________
---

## License

Expand Down
243 changes: 243 additions & 0 deletions docs/_static/earthkit-climate-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
# ones.
extensions = [
"autoapi.extension",
"myst_parser",
"nbsphinx",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
Expand Down Expand Up @@ -77,6 +76,7 @@
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_logo = "_static/earthkit-climate-light.svg"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
61 changes: 61 additions & 0 deletions docs/development.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Development
===========

Development & Contribution Workflow
-----------------------------------

1. Setup environment (with Pixi)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This project uses `Pixi <https://pixi.sh>`_ for dependency and environment management.
It provides fast, reproducible environments and replaces Conda-based workflows.

Install Pixi following the `official instructions <https://pixi.sh/latest/#installation>`_, then run:

.. code-block:: bash

pixi install

This command installs all dependencies as defined in ``pyproject.toml`` and ``pixi.lock``.

2. Common Tasks
~~~~~~~~~~~~~~~

This project uses ``pixi`` tasks to manage development workflows, replacing the legacy ``Makefile``.

- **Quality Assurance**: Run pre-commit hooks to ensure code quality.

.. code-block:: bash

pixi run qa

- **Unit Tests**: Run the test suite using pytest.

.. code-block:: bash

pixi run unit-tests

- **Type Checking**: Run static type analysis with mypy.

.. code-block:: bash

pixi run type-check

- **Build Documentation**: Build the Sphinx documentation. Note that this task runs in the ``docs`` environment.

.. code-block:: bash

pixi run -e docs docs-build

- **Docker**: Build and run the docker container.

.. code-block:: bash

pixi run docker-build
pixi run docker-run

- **Sync with ECMWF template**:

.. code-block:: bash

pixi run template-update
12 changes: 0 additions & 12 deletions docs/examples.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/gallery.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Gallery
=======

(Coming soon)
23 changes: 0 additions & 23 deletions docs/index.md

This file was deleted.

Loading
Loading