@@ -107,7 +107,7 @@ def __init__(self, store, path=None, read_only=False, chunk_store=None,
107
107
self ._is_view = False
108
108
109
109
# setup compressor
110
- config = meta ['compression ' ]
110
+ config = meta ['compressor ' ]
111
111
if config is None :
112
112
self ._compressor = None
113
113
else :
@@ -128,16 +128,16 @@ def _flush_metadata(self):
128
128
if self ._is_view :
129
129
raise PermissionError ('operation not permitted for views' )
130
130
if self ._compressor :
131
- compression = self ._compressor .get_config ()
131
+ compressor_config = self ._compressor .get_config ()
132
132
else :
133
- compression = None
133
+ compressor_config = None
134
134
if self ._filters :
135
- filters = [f .get_config () for f in self ._filters ]
135
+ filters_config = [f .get_config () for f in self ._filters ]
136
136
else :
137
- filters = None
137
+ filters_config = None
138
138
meta = dict (shape = self ._shape , chunks = self ._chunks , dtype = self ._dtype ,
139
- compression = compression , fill_value = self ._fill_value ,
140
- order = self ._order , filters = filters )
139
+ compressor = compressor_config , fill_value = self ._fill_value ,
140
+ order = self ._order , filters = filters_config )
141
141
mkey = self ._key_prefix + array_meta_key
142
142
self ._store [mkey ] = encode_array_metadata (meta )
143
143
@@ -427,7 +427,7 @@ def __setitem__(self, key, value):
427
427
>>> z = zarr.zeros(100000000, chunks=1000000, dtype='i4')
428
428
>>> z
429
429
Array((100000000,), int32, chunks=(1000000,), order=C)
430
- nbytes: 381.5M; nbytes_stored: 302 ; ratio: 1324503.3 ; initialized: 0/100
430
+ nbytes: 381.5M; nbytes_stored: 301 ; ratio: 1328903.7 ; initialized: 0/100
431
431
compressor: BloscCompressor(cname='lz4', clevel=5, shuffle=1)
432
432
store: dict
433
433
@@ -449,7 +449,7 @@ def __setitem__(self, key, value):
449
449
>>> z = zarr.zeros((10000, 10000), chunks=(1000, 1000), dtype='i4')
450
450
>>> z
451
451
Array((10000, 10000), int32, chunks=(1000, 1000), order=C)
452
- nbytes: 381.5M; nbytes_stored: 324 ; ratio: 1234567.9 ; initialized: 0/100
452
+ nbytes: 381.5M; nbytes_stored: 323 ; ratio: 1238390.1 ; initialized: 0/100
453
453
compressor: BloscCompressor(cname='lz4', clevel=5, shuffle=1)
454
454
store: dict
455
455
@@ -786,19 +786,19 @@ def resize(self, *args):
786
786
>>> z = zarr.zeros(shape=(10000, 10000), chunks=(1000, 1000))
787
787
>>> z
788
788
Array((10000, 10000), float64, chunks=(1000, 1000), order=C)
789
- nbytes: 762.9M; nbytes_stored: 324 ; ratio: 2469135.8 ; initialized: 0/100
789
+ nbytes: 762.9M; nbytes_stored: 323 ; ratio: 2476780.2 ; initialized: 0/100
790
790
compressor: BloscCompressor(cname='lz4', clevel=5, shuffle=1)
791
791
store: dict
792
792
>>> z.resize(20000, 10000)
793
793
>>> z
794
794
Array((20000, 10000), float64, chunks=(1000, 1000), order=C)
795
- nbytes: 1.5G; nbytes_stored: 324 ; ratio: 4938271.6 ; initialized: 0/200
795
+ nbytes: 1.5G; nbytes_stored: 323 ; ratio: 4953560.4 ; initialized: 0/200
796
796
compressor: BloscCompressor(cname='lz4', clevel=5, shuffle=1)
797
797
store: dict
798
798
>>> z.resize(30000, 1000)
799
799
>>> z
800
800
Array((30000, 1000), float64, chunks=(1000, 1000), order=C)
801
- nbytes: 228.9M; nbytes_stored: 323 ; ratio: 743034.1 ; initialized: 0/30
801
+ nbytes: 228.9M; nbytes_stored: 322 ; ratio: 745341.6 ; initialized: 0/30
802
802
compressor: BloscCompressor(cname='lz4', clevel=5, shuffle=1)
803
803
store: dict
804
804
@@ -955,8 +955,7 @@ def view(self, shape=None, chunks=None, dtype=None,
955
955
>>> filters = [zarr.CategorizeFilter(labels=labels,
956
956
... dtype=data.dtype,
957
957
... astype='u1')]
958
- >>> a = zarr.array(data, chunks=1000, compression=None,
959
- ... filters=filters)
958
+ >>> a = zarr.array(data, chunks=1000, filters=filters)
960
959
>>> a[:]
961
960
array([b'female', b'male', b'female', ..., b'male', b'male', b'female'],
962
961
dtype='|S6')
@@ -980,7 +979,7 @@ def view(self, shape=None, chunks=None, dtype=None,
980
979
View as a different dtype with the same itemsize:
981
980
982
981
>>> data = np.random.randint(0, 2, size=10000, dtype='u1')
983
- >>> a = zarr.array(data, chunks=1000, compression='zlib' )
982
+ >>> a = zarr.array(data, chunks=1000)
984
983
>>> a[:]
985
984
array([0, 0, 1, ..., 1, 0, 0], dtype=uint8)
986
985
>>> v = a.view(dtype=bool)
@@ -994,7 +993,7 @@ def view(self, shape=None, chunks=None, dtype=None,
994
993
data is interpreted correctly:
995
994
996
995
>>> data = np.arange(10000, dtype='u2')
997
- >>> a = zarr.array(data, chunks=1000, compression=None )
996
+ >>> a = zarr.array(data, chunks=1000)
998
997
>>> a[:10]
999
998
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=uint16)
1000
999
>>> v = a.view(dtype='u1', shape=20000, chunks=2000)
0 commit comments