We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e55cd98 commit 3ea4c68Copy full SHA for 3ea4c68
1 file changed
eopf_geozarr/conversion/geozarr.py
@@ -1221,8 +1221,14 @@ def write_dataset_band_by_band_with_validation(
1221
# Ensure the dataset is properly chunked to align with encoding
1222
if var in var_encoding and 'chunks' in var_encoding[var]:
1223
target_chunks = var_encoding[var]['chunks']
1224
+ # Create chunk dict using the actual dimensions of the variable
1225
+ var_dims = single_var_ds[var].dims
1226
+ chunk_dict = {}
1227
+ for i, dim in enumerate(var_dims):
1228
+ if i < len(target_chunks):
1229
+ chunk_dict[dim] = target_chunks[i]
1230
# Rechunk the dataset to match the target chunks
- single_var_ds = single_var_ds.chunk({var: target_chunks})
1231
+ single_var_ds = single_var_ds.chunk(chunk_dict)
1232
else:
1233
single_var_ds = single_var_ds.chunk()
1234
0 commit comments