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

Zero-sized unlimited dimension when read from a grouped netCDF file #113

Closed
davidhassell opened this issue Jan 15, 2021 · 0 comments · Fixed by #114
Closed

Zero-sized unlimited dimension when read from a grouped netCDF file #113

davidhassell opened this issue Jan 15, 2021 · 0 comments · Fixed by #114
Assignees
Labels
bug Something isn't working netCDF read Relating to reading netCDF datasets
Milestone

Comments

@davidhassell
Copy link
Contributor

The file cm4twc_dump_file.nc contains subgroups and has an unlimited dimension, currently of size 13. However, when read it gives the unlimited dimension as size 0:

>>> cfdm.read('cm4twc_dump_file.nc')[0]
<Field: transfer_i(time(0), altitude(1), latitude(4), longitude(3)) 1>

And downstream errors occur, e.g. when trying to subspace the size zero dimension.

This is a bug in cfdm.read (well cfdm.read_write.netcdf.NetCDFRead to be exact), which takes the dimension sizes from the flattened version of the file, but the flattened file does not know the unlimited dimension size, because the flattened file contains no arrays.

This is easily fixed by getting the dimension size from the original grouped file instead. PR to follow.

>>> cfdm.environment(paths=False)
Platform: Linux-5.4.0-62-generic-x86_64-with-debian-bullseye-sid
HDF5 library: 1.10.5
netcdf library: 4.6.3
Python: 3.7.0
netCDF4: 1.5.4
numpy: 1.18.4
cfdm.core: 1.8.8.0
cftime: 1.3.0
netcdf_flattener: 1.2.0
cfdm: 1.8.8.0
@davidhassell davidhassell added the bug Something isn't working label Jan 15, 2021
@davidhassell davidhassell self-assigned this Jan 15, 2021
@davidhassell davidhassell added this to the 1.8.9.0 milestone May 10, 2021
@davidhassell davidhassell added the netCDF read Relating to reading netCDF datasets label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working netCDF read Relating to reading netCDF datasets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant