From e407d65c917c0a238f96183daa33f66647439c1c Mon Sep 17 00:00:00 2001 From: Alfonso Ladino Date: Sun, 13 Oct 2024 09:42:58 -0500 Subject: [PATCH] updating group type annotation for netcdf, hdf5, and zarr open_datatree function (#9614) * updating group type annotation for netcdf, hdf5, and zarr open_datatree function * supporting only in group type annotation for netcdf, hdf5, and zarr open_datatree function * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- xarray/backends/h5netcdf_.py | 6 +++--- xarray/backends/netCDF4_.py | 6 +++--- xarray/backends/zarr.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/xarray/backends/h5netcdf_.py b/xarray/backends/h5netcdf_.py index f1ab57badb2..29a9d3d18f5 100644 --- a/xarray/backends/h5netcdf_.py +++ b/xarray/backends/h5netcdf_.py @@ -3,7 +3,7 @@ import functools import io import os -from collections.abc import Callable, Iterable +from collections.abc import Iterable from typing import TYPE_CHECKING, Any import numpy as np @@ -465,7 +465,7 @@ def open_datatree( use_cftime=None, decode_timedelta=None, format=None, - group: str | Iterable[str] | Callable | None = None, + group: str | None = None, lock=None, invalid_netcdf=None, phony_dims=None, @@ -511,7 +511,7 @@ def open_groups_as_dict( use_cftime=None, decode_timedelta=None, format=None, - group: str | Iterable[str] | Callable | None = None, + group: str | None = None, lock=None, invalid_netcdf=None, phony_dims=None, diff --git a/xarray/backends/netCDF4_.py b/xarray/backends/netCDF4_.py index 99ca263fa67..4b6c5e16334 100644 --- a/xarray/backends/netCDF4_.py +++ b/xarray/backends/netCDF4_.py @@ -3,7 +3,7 @@ import functools import operator import os -from collections.abc import Callable, Iterable +from collections.abc import Iterable from contextlib import suppress from typing import TYPE_CHECKING, Any @@ -700,7 +700,7 @@ def open_datatree( drop_variables: str | Iterable[str] | None = None, use_cftime=None, decode_timedelta=None, - group: str | Iterable[str] | Callable | None = None, + group: str | None = None, format="NETCDF4", clobber=True, diskless=False, @@ -745,7 +745,7 @@ def open_groups_as_dict( drop_variables: str | Iterable[str] | None = None, use_cftime=None, decode_timedelta=None, - group: str | Iterable[str] | Callable | None = None, + group: str | None = None, format="NETCDF4", clobber=True, diskless=False, diff --git a/xarray/backends/zarr.py b/xarray/backends/zarr.py index def932bde4a..107214f0476 100644 --- a/xarray/backends/zarr.py +++ b/xarray/backends/zarr.py @@ -3,7 +3,7 @@ import json import os import warnings -from collections.abc import Callable, Iterable +from collections.abc import Iterable from typing import TYPE_CHECKING, Any import numpy as np @@ -1282,7 +1282,7 @@ def open_datatree( drop_variables: str | Iterable[str] | None = None, use_cftime=None, decode_timedelta=None, - group: str | Iterable[str] | Callable | None = None, + group: str | None = None, mode="r", synchronizer=None, consolidated=None, @@ -1328,7 +1328,7 @@ def open_groups_as_dict( drop_variables: str | Iterable[str] | None = None, use_cftime=None, decode_timedelta=None, - group: str | Iterable[str] | Callable | None = None, + group: str | None = None, mode="r", synchronizer=None, consolidated=None,