fix(format): write fill times with libhdf5's codes; add fill values
FillTime::to_byte had the fill-time field rotated against libhdf5 (H5D_FILL_TIME_ALLOC = 0, NEVER = 1, IFSET = 2): Never was written as ALLOC, Alloc as IFSET and IfSet as NEVER, as h5py reported. The flags byte is now late allocation plus the right code, and FillTime::from_byte decodes it. The default becomes IfSet, which is libhdf5's default and exactly the byte (0x0a) every dataset was already written with, so default output does not change; `Alloc` was documented as the C library's default but never was. DatasetCreateProps follows. DatasetBuilder::with_fill_value sets a user-defined fill value (one element's stored bytes, checked against the datatype size), written as a defined value in the fill value message. h5py reports it, and extending the dataset in h5py fills the new elements with it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -43,7 +43,7 @@ impl Default for DatasetCreateProps {
|
||||
fletcher32: false,
|
||||
lz4: false,
|
||||
zstd_level: None,
|
||||
fill_time: FillTime::Alloc,
|
||||
fill_time: FillTime::IfSet,
|
||||
compact: false,
|
||||
alignment: 0,
|
||||
}
|
||||
@@ -335,7 +335,7 @@ mod tests {
|
||||
fn dcpl_defaults() {
|
||||
let dcpl = DatasetCreateProps::new();
|
||||
assert!(dcpl.chunk_dims.is_none());
|
||||
assert_eq!(dcpl.fill_time, FillTime::Alloc);
|
||||
assert_eq!(dcpl.fill_time, FillTime::IfSet);
|
||||
assert!(!dcpl.compact);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user