You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "b.py", line 7, in <module>
data = rootgrp.createVariable("time_whole", "f4", "time_step")
File "/home/nschloe/.local/lib/python3.8/site-packages/h5netcdf/legacyapi.py", line 91, in createVariable
return super(Group, self).create_variable(
File "/home/nschloe/.local/lib/python3.8/site-packages/h5netcdf/core.py", line 500, in create_variable
return group._create_child_variable(keys[-1], dimensions, dtype, data,
File "/home/nschloe/.local/lib/python3.8/site-packages/h5netcdf/core.py", line 463, in _create_child_variable
shape = tuple(self._current_dim_sizes[d] for d in dimensions)
File "/home/nschloe/.local/lib/python3.8/site-packages/h5netcdf/core.py", line 463, in <genexpr>
shape = tuple(self._current_dim_sizes[d] for d in dimensions)
File "/usr/lib/python3.8/collections/__init__.py", line 891, in __getitem__
return self.__missing__(key) # support subclasses that define __missing__
File "/usr/lib/python3.8/collections/__init__.py", line 883, in __missing__
raise KeyError(key)
KeyError: 't'
The text was updated successfully, but these errors were encountered:
You’re setting dimensions=“time_step”. NetCDF4-Python apparently interprets this as a list of one string whereas h5netcdf interprets it as a sequence of characters.
I would argue that this is probably a programming error, and it would be best to require users to explicitly pass a list or tuple of strings.
If you or anyone else is interested, I would be happy to accept a pull request making this behavior raise TypeError.
MWE:
The text was updated successfully, but these errors were encountered: