Skip to content

Commit 13e9d3d

Browse files
committed
Streamline chunk configuration
1 parent e630d11 commit 13e9d3d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/mdio/converters/segy.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,14 @@ def determine_target_size(var_type: str) -> int:
341341
full_shape = tuple(dim.size for dim in ds.variables[idx].dimensions)
342342
target_size = determine_target_size(var_type)
343343

344-
chunks = ChunkGridMetadata(
345-
chunk_grid=RegularChunkGrid(
346-
configuration=RegularChunkShape(chunk_shape=get_constrained_chunksize(full_shape, var_type, target_size))
347-
)
348-
)
344+
chunk_shape = get_constrained_chunksize(full_shape, var_type, target_size)
345+
chunks = ChunkGridMetadata.model_validate({
346+
"chunkGrid": {
347+
"configuration": {
348+
"chunkShape": chunk_shape
349+
}
350+
}
351+
})
349352

350353
# Update the variable's metadata with the new chunk grid
351354
if ds.variables[idx].metadata is None:

0 commit comments

Comments
 (0)