Skip to content

Commit bb4ec35

Browse files
committed
Fix: no chunking in Z
1 parent 8206430 commit bb4ec35

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/careamics/lightning/dataset_ng/callbacks/prediction_writer/write_tiles_zarr_strategy.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _update_T_axis(axes: str) -> str:
7676
def _auto_chunks(axes: str, data_shape: Sequence[int]) -> tuple[int, ...]:
7777
"""Generate automatic chunk sizes based on axes and shape.
7878
79-
Spatial dimensions will be chunked with a maximum size of 64, other dimensions
79+
X and Y dimensions will be chunked with a maximum size of 128, other dimensions
8080
will have chunk size 1.
8181
8282
Parameters
@@ -116,14 +116,13 @@ def _auto_chunks(axes: str, data_shape: Sequence[int]) -> tuple[int, ...]:
116116
for idx, original_index in enumerate(indices):
117117
axis = updated_axes[original_index]
118118

119-
# TODO we should probably not chunk along Z (#658)
120-
if axis in ("Z", "Y", "X"):
119+
if axis in ("Y", "X"):
121120
dim_size = data_shape[idx + sczyx_offset]
122121
chunk_sizes.append(
123122
min(128, dim_size)
124-
) # TODO arbitrary value, about 1MB for float64
123+
) # TODO arbitrary value, need benchmarking
125124
else:
126-
chunk_sizes.append(1)
125+
chunk_sizes.append(1) # chunk size 1 for Z and non spatial dims
127126

128127
return tuple(chunk_sizes)
129128

0 commit comments

Comments
 (0)