Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating group type annotation for netcdf, hdf5, and zarr open_datatree function #9614

Merged
merged 3 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions xarray/backends/h5netcdf_.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def open_datatree(
use_cftime=None,
decode_timedelta=None,
format=None,
group: str | Iterable[str] | Callable | None = None,
group: str | Callable[[], str] | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really the correct Callable signature? Does Callable actually work at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. However, this is something I will discuss in the next datatree meeting.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callable was a suggestion I had some time ago, but it also is unsupported right now. So I'd also remove that, and possibly add it back when/if we add support for Iterable[str].

lock=None,
invalid_netcdf=None,
phony_dims=None,
Expand Down Expand Up @@ -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 | Callable[[], str] | None = None,
lock=None,
invalid_netcdf=None,
phony_dims=None,
Expand Down
4 changes: 2 additions & 2 deletions xarray/backends/netCDF4_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 | Callable[[], str] | None = None,
format="NETCDF4",
clobber=True,
diskless=False,
Expand Down Expand Up @@ -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 | Callable[[], str] | None = None,
format="NETCDF4",
clobber=True,
diskless=False,
Expand Down
4 changes: 2 additions & 2 deletions xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 | Callable[[], str] | None = None,
mode="r",
synchronizer=None,
consolidated=None,
Expand Down Expand Up @@ -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 | Callable[[], str] | None = None,
mode="r",
synchronizer=None,
consolidated=None,
Expand Down
Loading