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:
osobh
2026-09-25 21:15:55 -05:00
co-authored by Claude Opus 5.5
parent 1dba7b465a
commit f5505fb03d
2 changed files with 50 additions and 1 deletions
+6 -1
View File
@@ -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