File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2675,18 +2675,15 @@ def test_write_persistence_modes(self, group) -> None:
2675
2675
assert_identical (original , actual )
2676
2676
2677
2677
def test_compressor_encoding (self ) -> None :
2678
- from numcodecs .blosc import Blosc
2679
-
2680
- original = create_test_data ()
2681
2678
# specify a custom compressor
2682
-
2679
+ original = create_test_data ()
2683
2680
if has_zarr_v3 and zarr .config .config ["default_zarr_format" ] == 3 :
2684
2681
encoding_key = "compressors"
2685
2682
# all parameters need to be explicitly specified in order for the comparison to pass below
2686
2683
encoding = {
2687
2684
"serializer" : zarr .codecs .BytesCodec (endian = "little" ),
2688
2685
encoding_key : (
2689
- Blosc (
2686
+ zarr . codecs . BloscCodec (
2690
2687
cname = "zstd" ,
2691
2688
clevel = 3 ,
2692
2689
shuffle = "shuffle" ,
@@ -2696,8 +2693,11 @@ def test_compressor_encoding(self) -> None:
2696
2693
),
2697
2694
}
2698
2695
else :
2696
+ from numcodecs .blosc import Blosc
2697
+
2699
2698
encoding_key = "compressors" if has_zarr_v3 else "compressor"
2700
- encoding = {encoding_key : (Blosc (cname = "zstd" , clevel = 3 , shuffle = 2 ),)}
2699
+ comp = Blosc (cname = "zstd" , clevel = 3 , shuffle = 2 )
2700
+ encoding = {encoding_key : (comp ,) if has_zarr_v3 else comp }
2701
2701
2702
2702
save_kwargs = dict (encoding = {"var1" : encoding })
2703
2703
You can’t perform that action at this time.
0 commit comments