@@ -142,14 +142,16 @@ def _downsample_by_one_level(
142
142
zarr_field : str ,
143
143
) -> None :
144
144
level = coarse_level
145
+ level_str = str (level )
145
146
fine_level = level - 1
146
- lev_shape = self ._get_level_shape (level )
147
+ fine_lev_str = str (fine_level )
148
+ lev_shape = self ._get_level_shape (level ).tolist ()
147
149
148
150
field1 = zarr .open (self .zarr_store_path )[zarr_field ]
149
- dtype = field1 [fine_level ].dtype
150
- field1 .empty (level , shape = lev_shape , chunks = self .chunks , dtype = dtype )
151
+ dtype = field1 [fine_lev_str ].dtype
152
+ field1 .empty (name = level_str , shape = lev_shape , chunks = self .chunks , dtype = dtype )
151
153
152
- numchunks = field1 [str ( level ) ].nchunks
154
+ numchunks = field1 [level_str ].nchunks
153
155
154
156
chunk_writes = []
155
157
for ichunk in range (numchunks ):
@@ -270,7 +272,7 @@ def initialize_test_image(
270
272
"""
271
273
if dtype is None :
272
274
dtype = np .float64
273
- field1 = zarr_store .create_group (zarr_field , overwrite = overwrite_field )
275
+ field1 = zarr_store .create_group (name = zarr_field , overwrite = overwrite_field )
274
276
275
277
if chunks is None :
276
278
chunks = (64 , 64 , 64 )
@@ -288,5 +290,5 @@ def initialize_test_image(
288
290
lev0 [0 : halfway [0 ], 0 : halfway [1 ], 0 : halfway [2 ]] = (
289
291
lev0 [0 : halfway [0 ], 0 : halfway [1 ], 0 : halfway [2 ]] + 0.5 * fac
290
292
)
291
- field1 .empty (0 , shape = base_resolution , chunks = chunks , dtype = dtype )
293
+ field1 .empty (name = '0' , shape = base_resolution , chunks = chunks , dtype = dtype )
292
294
da .to_zarr (lev0 , field1 ["0" ])
0 commit comments