clawhdf5-netcdf4: variables' dimensions come from the file
Variables got the first unused dimension of equal size, so a variable on an unlimited dimension with fewer records got an anonymous dim_<n>, and dimensions of one size could be swapped. Resolve them as netCDF-C does (libhdf5/hdf5open.c): _Netcdf4Coordinates ids, else the scales DIMENSION_LIST references (the last one attached to an axis), searched in the variable's group and its parents; a coordinate variable is on its own scale. Size matching remains only for axes the file names nothing for. variables()/variable_names() leave out dimension scales that are only dimensions, and _nc4_non_coord_<name> is the variable <name>. Variable::shape is the netCDF shape (an unlimited dimension's length) and the reads pad unwritten records with the fill value (_FillValue, else NC_FILL_*; NaN from read_f64); Variable::stored_shape is the HDF5 extent. New NetCDF4File::variable_names. Tests compare with netCDF4-python variable by variable: the known-issues reproducer, equal sizes, (p, p), scalars, inherited dimensions, unwritten records, h5py dimension scales, h5netcdf and xarray files. CI installs h5netcdf. known-issues entry moved to Fixed (history); stale open-table row for the unlimited-size fix removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -411,7 +411,8 @@ scripts/ci-test.sh # what CI runs: fmt, clippy matrix, tests,
|
||||
conformance/run.sh # the conformance report (needs h5py, hdf5plugin, h5dump)
|
||||
```
|
||||
|
||||
The interop suites need a Python with h5py (and netCDF4, xarray); on a
|
||||
The interop suites need a Python with h5py (and netCDF4, xarray; the
|
||||
NetCDF-4 tests of h5netcdf-written files skip without h5netcdf); on a
|
||||
PEP 668 system that has to be a virtualenv, which `ci-test.sh` finds as
|
||||
`.venv` or through `CLAWHDF5_PYTHON`. Without one they skip; set
|
||||
`CLAWHDF5_REQUIRE_INTEROP=1` to make that a failure, as CI does:
|
||||
|
||||
Reference in New Issue
Block a user