@@ -38,7 +38,7 @@ mod utils;
3838
3939use crate :: concurrency:: ChunkConcurrentLimitAndCodecOptions ;
4040use crate :: store:: StoreConfig ;
41- use crate :: utils:: { PyCodecErrExt , PyErrExt as _, PyUntypedArrayExt as _ } ;
41+ use crate :: utils:: { PyCodecErrExt , PyErrExt as _} ;
4242
4343// TODO: Use a OnceLock for store with get_or_try_init when stabilised?
4444#[ gen_stub_pyclass]
@@ -288,7 +288,6 @@ impl CodecPipelineImpl {
288288 ) -> PyResult < ( ) > {
289289 // Get input array
290290 let output = Self :: nparray_to_unsafe_cell_slice ( value) ?;
291- let output_shape: Vec < u64 > = value. shape_zarr ( ) ?;
292291
293292 // Adjust the concurrency based on the codec chain and the first chunk description
294293 let Some ( ( chunk_concurrent_limit, codec_options) ) =
@@ -343,7 +342,7 @@ impl CodecPipelineImpl {
343342 . fixed_size ( )
344343 . ok_or ( "variable length data type not supported" )
345344 . map_py_err :: < PyTypeError > ( ) ?,
346- & output_shape,
345+ bytemuck :: must_cast_slice :: < _ , u64 > ( & item . output_shape ) ,
347346 item. subset . clone ( ) ,
348347 )
349348 . map_py_err :: < PyRuntimeError > ( ) ?
@@ -410,7 +409,6 @@ impl CodecPipelineImpl {
410409 } else {
411410 InputValue :: Constant ( FillValue :: new ( input_slice. to_vec ( ) ) )
412411 } ;
413- let input_shape: Vec < u64 > = value. shape_zarr ( ) ?;
414412
415413 // Adjust the concurrency based on the codec chain and the first chunk description
416414 let Some ( ( chunk_concurrent_limit, mut codec_options) ) =
@@ -424,7 +422,7 @@ impl CodecPipelineImpl {
424422 let store_chunk = |item : ChunkItem | match & input {
425423 InputValue :: Array ( input) => {
426424 let chunk_subset_bytes = input
427- . extract_array_subset ( & item. subset , & input_shape , & self . data_type )
425+ . extract_array_subset ( & item. subset , bytemuck :: must_cast_slice :: < _ , u64 > ( & item . output_shape ) , & self . data_type )
428426 . map_codec_err ( ) ?;
429427 self . store_chunk_subset_bytes (
430428 & item,
0 commit comments