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

changing open_cfradial1_datatree engine from 'netcdf4' to 'h5netcdf' #195

Merged
merged 5 commits into from
Aug 12, 2024
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
4 changes: 4 additions & 0 deletions docs/history.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# History

## 0.6.2 (2024-08-12)

* FIX: Passing 'engine' kwarg in "open_cfradial1_datatree" method to enable fsspec.open when using url ({issue}`194`) by [@aladinor](https://github.com/aladinor), ({pull}`195`) by [@aladinor](https://github.com/aladinor)

## 0.6.1 (2024-08-07)

* MNT: minimize CI ({pull}`192`) by [@kmuehlbauer](https://github.com/kmuehlbauer).
Expand Down
6 changes: 5 additions & 1 deletion xradar/io/backends/cfradial1.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,22 +327,26 @@ def open_cfradial1_datatree(filename_or_obj, **kwargs):
Import optional mandatory data and metadata, defaults to ``True``.
site_coords : bool
Attach radar site-coordinates to Dataset, defaults to ``True``.
engine: str
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should work for now. No immediate need for other types, like BackendEntrypoint. 👍

Engine that will be passed to Xarray.open_dataset, defaults to "netcdf4"

Returns
-------
dtree: datatree.DataTree
DataTree with CfRadial2 groups.
"""

# handle kwargs, extract first_dim
first_dim = kwargs.pop("first_dim", "auto")
optional = kwargs.pop("optional", True)
site_coords = kwargs.pop("site_coords", True)
sweep = kwargs.pop("sweep", None)
engine = kwargs.pop("engine", "netcdf4")

# open root group, cfradial1 only has one group
# open_cfradial1_datatree only opens the file once using netcdf4
# and retrieves the different groups from the loaded object
ds = open_dataset(filename_or_obj, engine="netcdf4", **kwargs)
ds = open_dataset(filename_or_obj, engine=engine, **kwargs)

# create datatree root node with required data
root = _get_required_root_dataset(ds, optional=optional)
Expand Down