diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cccdab..b2c21aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,9 @@ jobs: python-version: ["3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v7 with: enable-cache: true - name: Set up Python ${{ matrix.python-version }} @@ -31,6 +31,4 @@ jobs: - name: Build the package run: uv build - name: Test with pytest - env: - PYTHONPATH: ${{ github.workspace }}/src - run: uv run pytest + run: uv run pytest tests diff --git a/CITATION.cff b/CITATION.cff index bef805a..6e0071e 100755 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ # Visit https://bit.ly/cffinit to generate yours today! cff-version: 1.2.0 -title: eso4clima-wp1-prototype +title: ClimaNet message: >- If you use this software, please cite it using the metadata from this file. diff --git a/README.md b/README.md index c3cf5b8..bf6da0c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# eso4clima-wp1-prototype +# ClimaNet: A Climate Aware Spatio Temporal Encoder Decoder -[](https://opensource.org/licenses/Apache-2.0) +[](https://opensource.org/licenses/Apache-2.0) ## Installation diff --git a/climanet/__init__.py b/climanet/__init__.py new file mode 100644 index 0000000..02a9ffb --- /dev/null +++ b/climanet/__init__.py @@ -0,0 +1,9 @@ +from climanet import st_encoder_decoder +from climanet.dataset import STDataset +from climanet.utils import regrid_to_boundary_centered_grid + +__all__ = [ + "STDataset", + "st_encoder_decoder", + "regrid_to_boundary_centered_grid" +] diff --git a/src/dataset.py b/climanet/dataset.py similarity index 100% rename from src/dataset.py rename to climanet/dataset.py diff --git a/src/st_encoder_decoder.py b/climanet/st_encoder_decoder.py similarity index 100% rename from src/st_encoder_decoder.py rename to climanet/st_encoder_decoder.py diff --git a/src/utils.py b/climanet/utils.py similarity index 100% rename from src/utils.py rename to climanet/utils.py diff --git a/mkdocs.yml b/mkdocs.yml index 79f6fc2..e4737cc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: "eso4clima-wp1-prototype" -repo_url: https://github.com/ESMValGroup/eso4clima-wp1-prototype/ -repo_name: eso4clima-wp1-prototype +site_name: "ClimaNet" +repo_url: https://github.com/ESMValGroup/ClimaNet/ +repo_name: ClimaNet nav: - Introduction: index.md diff --git a/notebooks/example.ipynb b/notebooks/example.ipynb index 93f9507..bfdbb2c 100644 --- a/notebooks/example.ipynb +++ b/notebooks/example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "11ad68b2-7502-4dc4-8b78-d0a4fb53255d", "metadata": {}, "outputs": [], @@ -17,12 +17,12 @@ "import torch\n", "import torch.nn.functional\n", "from torch.utils.data import DataLoader\n", - "from st_encoder_decoder import (\n", + "from climanet.st_encoder_decoder import (\n", " SpatioTemporalModel,\n", " pred_to_numpy,\n", ")\n", "\n", - "from dataset import STDataset" + "from climanet import STDataset" ] }, { @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "13a3b0c8-1d92-460d-84a4-a3a59ca081af", "metadata": {}, "outputs": [], @@ -64,7 +64,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "a9e054ab-995f-4483-a47b-84df84e6961e", "metadata": {}, "outputs": [], @@ -82,20 +82,1247 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "ac735a7d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
<xarray.Dataset> Size: 795kB\n", + "Dimensions: (time: 31, bnds: 2, lat: 80, lon: 80)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 248B 2020-01-01T11:30:00 ... 2020-01-31T...\n", + " * lat (lat) float32 320B -39.88 -39.62 -39.38 ... -20.62 -20.38 -20.12\n", + " * lon (lon) float32 320B -49.88 -49.62 -49.38 ... -30.62 -30.38 -30.12\n", + "Dimensions without coordinates: bnds\n", + "Data variables:\n", + " time_bnds (time, bnds) datetime64[ns] 496B ...\n", + " ts (time, lat, lon) float32 794kB ...\n", + "Attributes:\n", + " CDI: Climate Data Interface version 2.2.4 (https://mpimet.mpg.de...\n", + " Conventions: CF-1.6\n", + " history: Fri Oct 31 09:28:31 2025: cdo daymean 202001_ERA5_masked_ts...\n", + " frequency: day\n", + " CDO: Climate Data Operators version 2.2.2 (https://mpimet.mpg.de...
<xarray.Dataset> Size: 26kB\n", + "Dimensions: (time: 1, bnds: 2, lat: 80, lon: 80)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 8B 2020-01-16T11:30:00\n", + " * lat (lat) float32 320B -39.88 -39.62 -39.38 ... -20.62 -20.38 -20.12\n", + " * lon (lon) float32 320B -49.88 -49.62 -49.38 ... -30.62 -30.38 -30.12\n", + "Dimensions without coordinates: bnds\n", + "Data variables:\n", + " time_bnds (time, bnds) datetime64[ns] 16B ...\n", + " ts (time, lat, lon) float32 26kB ...\n", + "Attributes:\n", + " CDI: Climate Data Interface version 2.2.4 (https://mpimet.mpg.de...\n", + " Conventions: CF-1.6\n", + " history: Fri Oct 31 09:31:04 2025: cdo timmean 202001_ERA5_full_ts.n...\n", + " CDO: Climate Data Operators version 2.2.2 (https://mpimet.mpg.de...