diff --git a/ci/environment.yml b/ci/environment.yml index 883463a2..0bb5b366 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -7,7 +7,7 @@ dependencies: - h5py - hdf5 - netcdf4 - - xarray>=2024.6.0 + - xarray>=2024.10.0 - kerchunk>=0.2.5 - numpy>=2.0.0 - ujson diff --git a/ci/min-deps.yml b/ci/min-deps.yml index 7ca8c0b3..05778382 100644 --- a/ci/min-deps.yml +++ b/ci/min-deps.yml @@ -7,7 +7,7 @@ dependencies: - h5py - hdf5 - netcdf4 - - xarray>=2024.6.0 + - xarray>=2024.10.0 - numpy>=2.0.0 - numcodecs - packaging diff --git a/ci/upstream.yml b/ci/upstream.yml index 2c2680bc..035d76f8 100644 --- a/ci/upstream.yml +++ b/ci/upstream.yml @@ -3,6 +3,7 @@ channels: - conda-forge - nodefaults dependencies: + - xarray>=2024.10.0 - h5netcdf - h5py - hdf5 @@ -25,6 +26,5 @@ dependencies: - pip - pip: - icechunk # Installs zarr v3 as dependency - - git+https://github.com/pydata/xarray@zarr-v3 # zarr-v3 compatibility branch - git+https://github.com/zarr-developers/numcodecs@zarr3-codecs # zarr-v3 compatibility branch # - git+https://github.com/fsspec/kerchunk@main # kerchunk is currently incompatible with zarr-python v3 (https://github.com/fsspec/kerchunk/pull/516) diff --git a/docs/releases.rst b/docs/releases.rst index 93a5fec9..1ca594a1 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -42,6 +42,8 @@ Breaking changes - VirtualiZarr's `ZArray`, `ChunkEntry`, and `Codec` no longer subclass `pydantic.BaseModel` (:pull:`210`) - `ZArray`'s `__init__` signature has changed to match `zarr.Array`'s (:pull:`210`) +- Minimum required version of Xarray is now v2024.10.0. + (:pull:`284`) By `Tom Nicholas `_. Deprecations ~~~~~~~~~~~~ diff --git a/pyproject.toml b/pyproject.toml index d216b269..749afb94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ requires-python = ">=3.10" dynamic = ["version"] dependencies = [ - "xarray>=2024.06.0", + "xarray>=2024.10.0", "numpy>=2.0.0", "packaging", "universal-pathlib", diff --git a/virtualizarr/readers/common.py b/virtualizarr/readers/common.py index 646d26ca..1ad24629 100644 --- a/virtualizarr/readers/common.py +++ b/virtualizarr/readers/common.py @@ -4,7 +4,6 @@ from collections.abc import Iterable, Mapping, MutableMapping from io import BufferedIOBase from typing import ( - TYPE_CHECKING, Any, Hashable, Optional, @@ -14,6 +13,7 @@ from xarray import ( Coordinates, Dataset, + DataTree, Index, IndexVariable, Variable, @@ -26,12 +26,6 @@ XArrayOpenT = str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore -if TYPE_CHECKING: - try: - from xarray import DataTree # type: ignore[attr-defined] - except ImportError: - DataTree = Any - def open_loadable_vars_and_indexes( filepath: str, @@ -194,5 +188,5 @@ def open_virtual_datatree( decode_times: bool | None = None, indexes: Mapping[str, Index] | None = None, reader_options: Optional[dict] = None, - ) -> "DataTree": + ) -> DataTree: raise NotImplementedError()