@@ -142,14 +142,16 @@ def _downsample_by_one_level(
142142 zarr_field : str ,
143143 ) -> None :
144144 level = coarse_level
145+ level_str = str (level )
145146 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 ()
147149
148150 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 )
151153
152- numchunks = field1 [str ( level ) ].nchunks
154+ numchunks = field1 [level_str ].nchunks
153155
154156 chunk_writes = []
155157 for ichunk in range (numchunks ):
@@ -270,7 +272,7 @@ def initialize_test_image(
270272 """
271273 if dtype is None :
272274 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 )
274276
275277 if chunks is None :
276278 chunks = (64 , 64 , 64 )
@@ -288,5 +290,5 @@ def initialize_test_image(
288290 lev0 [0 : halfway [0 ], 0 : halfway [1 ], 0 : halfway [2 ]] = (
289291 lev0 [0 : halfway [0 ], 0 : halfway [1 ], 0 : halfway [2 ]] + 0.5 * fac
290292 )
291- field1 .empty (0 , shape = base_resolution , chunks = chunks , dtype = dtype )
293+ field1 .empty (name = "0" , shape = base_resolution , chunks = chunks , dtype = dtype )
292294 da .to_zarr (lev0 , field1 ["0" ])
0 commit comments