fix(format): keep maxshape == shape datasets contiguous
Any maxshape forced chunked storage, even one equal to the shape, which cannot grow. h5py and the library store such a dataset contiguously; we now do too unless chunks (or a filter) are requested. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -1124,7 +1124,12 @@ impl FileWriter {
|
||||
let is_chunked: Vec<bool> = all_ds
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, d)| !is_vds[i] && (d.chunk_options.is_chunked() || d.maxshape.is_some()))
|
||||
.map(|(i, d)| {
|
||||
// Only a dataset that can grow needs chunks; a maxshape equal
|
||||
// to the shape is as fixed as no maxshape at all.
|
||||
let resizable = d.maxshape.as_ref().is_some_and(|m| *m != d.ds.dimensions);
|
||||
!is_vds[i] && (d.chunk_options.is_chunked() || resizable)
|
||||
})
|
||||
.collect();
|
||||
// Determine which datasets use compact storage
|
||||
let is_compact: Vec<bool> = all_ds
|
||||
|
||||
Reference in New Issue
Block a user