HDF5 2.0 native complex as a first-class type on read; Python libver=
- Datatype::parse returns Datatype::Complex for class 11 (also inside
compounds, arrays and VL types) instead of the {r, i} compound view.
- Facade: DType::Complex(Box<DType>); read_complex_f32/f64 accept it.
- h5rs dump/ls/diff print native complex as h5dump/h5ls/h5diff 2.2.0 do
(checked against a fixture written by h5py 3.16 / libhdf5 2.0.0);
dump --json keeps the {r, i} compound (hdf5-json has no complex class).
- clawhdf5-wasm reads native complex datasets as [re, im] pairs.
- Python: clawhdf5.File(path, 'w', libver=...) with h5py's values,
mapped to FileBuilder::libver_bounds; 'v108' output opens in HDF5 1.8.23.
- Docs: known-issues entry moved to Fixed (history), CHANGELOG, READMEs.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -104,7 +104,22 @@ writes `float64`, `float32`, `int64`, `int32`, `uint8`, `complex64` and
|
||||
`complex128` arrays; the file is written on `close()`. Complex arrays are
|
||||
stored as h5py stores them, a compound `{r, i}` that every libhdf5 reads
|
||||
(not HDF5 2.0's native complex type, which only libhdf5 2.0+ reads; the
|
||||
Rust API writes that on request).
|
||||
Rust API writes that on request). Both forms read back as numpy
|
||||
`complex64`/`complex128`.
|
||||
|
||||
`libver=` sets the library version bounds as in h5py: `'v108'`,
|
||||
`'v110'`, `'v112'`, `'v114'`, `'v200'` or `'latest'` (the low bound; the
|
||||
high bound is then `'latest'`), or a `(low, high)` tuple. With `'v108'`
|
||||
the file is written in the HDF5 1.8 format (version-2 superblock,
|
||||
version-1 B-tree chunk indexes), which HDF5 1.8 reads; the default is the
|
||||
HDF5 1.10 format. `'earliest'` as the low bound writes the 1.8 format too,
|
||||
with a `UserWarning`: clawhdf5 cannot write the pre-1.8 format. The
|
||||
argument is ignored when reading and refused for `'r+'`/`'a'`.
|
||||
|
||||
```python
|
||||
with clawhdf5.File("old.h5", "w", libver="v108") as f: # HDF5 1.8 reads it
|
||||
f.create_dataset("x", data=np.arange(10.0), chunks=(5,), compression="gzip")
|
||||
```
|
||||
|
||||
## Editing a file in place
|
||||
|
||||
|
||||
Reference in New Issue
Block a user