Skip to content

Commit

Permalink
Bump minimum Xarray dependency to 2024.10.0 (#284)
Browse files Browse the repository at this point in the history
* change upstream CI dependency

* change non-upstream CI dependencies

* change entire project depedendency

* use explicit import of xarray.DataTree for type hint

* release note
  • Loading branch information
TomNicholas authored Nov 7, 2024
1 parent 2316fcb commit efbc493
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/min-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- h5py
- hdf5
- netcdf4
- xarray>=2024.6.0
- xarray>=2024.10.0
- numpy>=2.0.0
- numcodecs
- packaging
Expand Down
2 changes: 1 addition & 1 deletion ci/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- xarray>=2024.10.0
- h5netcdf
- h5py
- hdf5
Expand All @@ -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)
2 changes: 2 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/TomNicholas>`_.

Deprecations
~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 2 additions & 8 deletions virtualizarr/readers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from collections.abc import Iterable, Mapping, MutableMapping
from io import BufferedIOBase
from typing import (
TYPE_CHECKING,
Any,
Hashable,
Optional,
Expand All @@ -14,6 +13,7 @@
from xarray import (
Coordinates,
Dataset,
DataTree,
Index,
IndexVariable,
Variable,
Expand All @@ -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,
Expand Down Expand Up @@ -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()

0 comments on commit efbc493

Please sign in to comment.