Skip to content

Revert "MNT: prepare h5netcdf backend for (coming) change in dimension handling" #6208

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

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 5 additions & 21 deletions xarray/backends/h5netcdf_.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ def _read_attributes(h5netcdf_var):


_extract_h5nc_encoding = functools.partial(
_extract_nc4_variable_encoding,
lsd_okay=False,
h5py_okay=True,
backend="h5netcdf",
unlimited_dims=None,
_extract_nc4_variable_encoding, lsd_okay=False, h5py_okay=True, backend="h5netcdf"
)


Expand Down Expand Up @@ -235,24 +231,12 @@ def get_attrs(self):
return FrozenDict(_read_attributes(self.ds))

def get_dimensions(self):
if Version(h5netcdf.__version__) >= Version("0.14.0.dev0"):
return FrozenDict((k, len(v)) for k, v in self.ds.dimensions.items())
else:
return self.ds.dimensions
return self.ds.dimensions

def get_encoding(self):
if Version(h5netcdf.__version__) >= Version("0.14.0.dev0"):
return {
"unlimited_dims": {
k for k, v in self.ds.dimensions.items() if v.isunlimited()
}
}
else:
return {
"unlimited_dims": {
k for k, v in self.ds.dimensions.items() if v is None
}
}
return {
"unlimited_dims": {k for k, v in self.ds.dimensions.items() if v is None}
}

def set_dimension(self, name, length, is_unlimited=False):
if is_unlimited:
Expand Down