File tree Expand file tree Collapse file tree 3 files changed +3
-38
lines changed
Expand file tree Collapse file tree 3 files changed +3
-38
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,6 @@ import typing
77import numpy .typing
88import zarr .abc .store
99
10- @typing .final
11- class Basic :
12- def __new__ (cls , byte_interface : typing .Any , chunk_spec : typing .Any ) -> Basic : ...
13-
1410@typing .final
1511class CodecPipelineImpl :
1612 def __new__ (
@@ -40,8 +36,9 @@ class CodecPipelineImpl:
4036class WithSubset :
4137 def __new__ (
4238 cls ,
43- item : Basic ,
39+ key : builtins . str ,
4440 chunk_subset : typing .Sequence [slice ],
41+ chunk_shape : typing .Sequence [builtins .int ],
4542 subset : typing .Sequence [slice ],
4643 shape : typing .Sequence [builtins .int ],
4744 ) -> WithSubset : ...
Original file line number Diff line number Diff line change @@ -11,32 +11,6 @@ use zarrs::{array_subset::ArraySubset, storage::StoreKey};
1111
1212use crate :: utils:: PyErrExt ;
1313
14- pub fn fill_value_to_bytes ( dtype : & str , fill_value : & Bound < ' _ , PyAny > ) -> PyResult < Vec < u8 > > {
15- if dtype == "string" {
16- // Match zarr-python 2.x.x string fill value behaviour with a 0 fill value
17- // See https://github.com/zarr-developers/zarr-python/issues/2792#issuecomment-2644362122
18- if let Ok ( fill_value_downcast) = fill_value. cast :: < PyInt > ( ) {
19- let fill_value_usize: usize = fill_value_downcast. extract ( ) ?;
20- if fill_value_usize == 0 {
21- return Ok ( vec ! [ ] ) ;
22- }
23- Err ( PyErr :: new :: < PyValueError , _ > ( format ! (
24- "Cannot understand non-zero integer {fill_value_usize} fill value for dtype {dtype}"
25- ) ) ) ?;
26- }
27- }
28-
29- if let Ok ( fill_value_downcast) = fill_value. cast :: < PyBytes > ( ) {
30- Ok ( fill_value_downcast. as_bytes ( ) . to_vec ( ) )
31- } else if fill_value. hasattr ( "tobytes" ) ? {
32- Ok ( fill_value. call_method0 ( "tobytes" ) ?. extract ( ) ?)
33- } else {
34- Err ( PyErr :: new :: < PyValueError , _ > ( format ! (
35- "Unsupported fill value {fill_value:?}"
36- ) ) )
37- }
38- }
39-
4014#[ derive( Clone ) ]
4115#[ gen_stub_pyclass]
4216#[ pyclass]
Original file line number Diff line number Diff line change @@ -28,12 +28,7 @@ use zarrs::array::{
2828} ;
2929use zarrs:: array_subset:: ArraySubset ;
3030use zarrs:: config:: global_config;
31- use zarrs:: convert:: {
32- ArrayMetadataV2ToV3Error , array_metadata_v2_to_v3, codec_metadata_v2_to_v3,
33- data_type_metadata_v2_to_v3, fill_value_metadata_v2_to_v3,
34- } ;
35- use zarrs:: metadata:: v2:: data_type_metadata_v2_to_endianness;
36- use zarrs:: metadata:: v3:: MetadataV3 ;
31+ use zarrs:: convert:: array_metadata_v2_to_v3;
3732use zarrs:: storage:: { ReadableWritableListableStorage , StorageHandle , StoreKey } ;
3833
3934mod chunk_item;
@@ -44,7 +39,6 @@ mod store;
4439mod tests;
4540mod utils;
4641
47- use crate :: chunk_item:: fill_value_to_bytes;
4842use crate :: concurrency:: ChunkConcurrentLimitAndCodecOptions ;
4943use crate :: store:: StoreConfig ;
5044use crate :: utils:: { PyCodecErrExt , PyErrExt as _, PyUntypedArrayExt as _} ;
You can’t perform that action at this time.
0 commit comments