Skip to content

Commit

Permalink
changing open_cfradial1_datatree engine from 'netcdf4' to 'h5netcdf' (#…
Browse files Browse the repository at this point in the history
…195)

* changing open_cfradial1_datatree engine from 'netcdf4' to 'h5netcdf'

* passing engine as a kwarg in open_cfradial_datatree function

* running pre-commit

* adding new development version, issue and, and PR to history.md file

* fixing some typos
  • Loading branch information
aladinor authored Aug 12, 2024
1 parent 482952b commit 33d9132
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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
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

0 comments on commit 33d9132

Please sign in to comment.