Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
12 changes: 9 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
)

Expand Down
Loading