Skip to content

Commit e33d2bb

Browse files
committed
Explicitly use the live mask shape for base case
1 parent da64366 commit e33d2bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mdio/converters/segy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,11 @@ def _calculate_live_mask_chunksize(grid: Grid) -> Sequence[int] | int:
509509
Either a single integer (-1) if no chunking is needed, or a sequence of integers
510510
representing the optimal chunk size for each dimension of the grid.
511511
"""
512+
# Use nbytes for the initial check, since we are limited by Blosc's maximum
513+
# chunk size in bytes.
512514
if grid.live_mask.nbytes < INT32_MAX:
513515
# Base case where we don't need to chunk the live mask
514-
return -1
516+
return grid.live_mask.shape
515517

516518
# Calculate the optimal chunksize for the live mask
517519
total_elements = np.prod(grid.shape[:-1]) # Exclude sample dimension

0 commit comments

Comments
 (0)