diff --git a/pyproject.toml b/pyproject.toml index ad2bb6b..26a69ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,14 +20,14 @@ classifiers = [ "License :: OSI Approved :: MIT License", ] dependencies = [ - "fsspec==2024.6.1", + "fsspec==2025.7.0", "huggingface-hub==0.28.1", "hydra-core==1.3.2", "loguru == 0.7.3", "numpy==2.1.2", - "ocf-data-sampler==0.1.4", + "ocf-data-sampler==0.5.5", "pandas==2.2.3", - "s3fs==2024.6.1", + "s3fs==2025.7.0", "safetensors==0.5.2", "sat_pred @ git+https://github.com/openclimatefix/sat_pred.git@main", # Since torch distributes CPU only packages as wheels, have to specify the target platform in order to pull the wheel compiled for that specific platform @@ -36,8 +36,8 @@ dependencies = [ "torch @ https://download.pytorch.org/whl/cpu/torch-2.3.1%2Bcpu-cp312-cp312-linux_x86_64.whl ; platform_system == 'Linux' and platform_machine == 'x86_64'", "torchvision @ https://download.pytorch.org/whl/cpu/torchvision-0.18.1%2Bcpu-cp312-cp312-linux_x86_64.whl ; platform_system == 'Linux' and platform_machine == 'x86_64'", "typer==0.15.1", - "xarray==2025.1.2", - "zarr==2.18.3", + "xarray==2025.7.1", + "zarr==3.1.1", ] [dependency-groups] diff --git a/tests/conftest.py b/tests/conftest.py index 40b65bb..789735d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,20 +5,21 @@ import pandas as pd import pytest import xarray as xr +import zarr xr.set_options(keep_attrs=True) @pytest.fixture() def test_t0(): - return pd.Timestamp.now(tz=None).floor("30min") + return pd.Timestamp.now(tz="UTC").replace(tzinfo=None).floor("30min") def make_sat_data(test_t0, freq_mins): # Load dataset which only contains coordinates, but no data shell_path = f"{os.path.dirname(os.path.abspath(__file__))}/test_data/non_hrv_shell.zarr.zip" - - ds = xr.open_zarr(fsspec.get_mapper(f"zip::{shell_path}")) + with zarr.storage.ZipStore(shell_path, mode="r") as store: + ds = xr.open_zarr(store) # Remove original time dim ds = ds.drop_vars("time") @@ -41,6 +42,11 @@ def make_sat_data(test_t0, freq_mins): ds.data.attrs = ds.attrs["_data_attrs"] del ds.attrs["_data_attrs"] + + # # This is important to avoid saving errors + for v in list(ds.variables.keys()): + ds[v].encoding.clear() + return ds diff --git a/tests/test_app.py b/tests/test_app.py index c763ed7..f984ec6 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -32,7 +32,7 @@ def test_app(sat_5_data, tmp_path, test_t0): assert "sat_pred" in ds_y_hat assert ( - list(ds_y_hat.sat_pred.coords)== + sorted(list(ds_y_hat.sat_pred.coords))== ["init_time", "step", "variable", "x_geostationary", "y_geostationary"] )