Skip to content
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
6 changes: 4 additions & 2 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ New Features
- :py:func:`merge` and :py:func:`concat` now support :py:class:`DataTree`
objects (:issue:`9790`, :issue:`9778`).
By `Stephan Hoyer <https://github.com/shoyer>`_.
- The ``h5netcdf`` engine has support for pseudo ``NETCDF4_CLASSIC`` files, meaning variables and attributes are cast to supported types. Note that the saved files won't be recognized as genuine ``NETCDF4_CLASSIC`` files until ``h5netcdf`` adds support with version 1.7.0. (:issue:`10676`, :pull:`10686`).
By `David Huard <https://github.com/huard>`_.

Breaking Changes
~~~~~~~~~~~~~~~~
Expand All @@ -27,6 +29,8 @@ Deprecations

Bug Fixes
~~~~~~~~~
- Fix h5netcdf backend for format=None, use same rule as netcdf4 backend (:pull:`10859`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_


Documentation
Expand Down Expand Up @@ -285,8 +289,6 @@ New Features
- ``compute=False`` is now supported by :py:meth:`DataTree.to_netcdf` and
:py:meth:`DataTree.to_zarr`.
By `Stephan Hoyer <https://github.com/shoyer>`_.
- The ``h5netcdf`` engine has support for pseudo ``NETCDF4_CLASSIC`` files, meaning variables and attributes are cast to supported types. Note that the saved files won't be recognized as genuine ``NETCDF4_CLASSIC`` files until ``h5netcdf`` adds support. (:issue:`10676`, :pull:`10686`).
By `David Huard <https://github.com/huard>`_.
- ``open_dataset`` will now correctly infer a path ending in ``.zarr/`` as zarr
By `Ian Hunt-Isaak <https://github.com/ianhi>`_.

Expand Down
5 changes: 4 additions & 1 deletion xarray/backends/h5netcdf_.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ def open(
f"{magic_number!r} is not the signature of a valid netCDF4 file"
)

if format not in [None, "NETCDF4", "NETCDF4_CLASSIC"]:
if format is None:
format = "NETCDF4"

if format not in ["NETCDF4", "NETCDF4_CLASSIC"]:
raise ValueError(f"invalid format for h5netcdf backend: {format}")

kwargs = {
Expand Down
Loading