Skip to content

Commit 3ecb781

Browse files
committed
always show filters and compressors in Array.info
1 parent c8b96a5 commit 3ecb781

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

docs/user-guide/arrays.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ which can be used to print useful diagnostics, e.g.::
188188
Order : C
189189
Read-only : False
190190
Store type : LocalStore
191+
Filters : ()
191192
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
192193
Compressors : (BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=3, shuffle=<BloscShuffle.bitshuffle: 'bitshuffle'>, blocksize=0),)
193194
No. bytes : 400000000 (381.5M)
@@ -204,6 +205,7 @@ prints additional diagnostics, e.g.::
204205
Order : C
205206
Read-only : False
206207
Store type : LocalStore
208+
Filters : ()
207209
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
208210
Compressors : (BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=3, shuffle=<BloscShuffle.bitshuffle: 'bitshuffle'>, blocksize=0),)
209211
No. bytes : 400000000 (381.5M)
@@ -605,6 +607,7 @@ Sharded arrays can be created by providing the ``shards`` parameter to :func:`za
605607
Order : C
606608
Read-only : False
607609
Store type : LocalStore
610+
Filters : ()
608611
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
609612
Compressors : (ZstdCodec(level=0, checksum=False),)
610613
No. bytes : 100000000 (95.4M)

docs/user-guide/groups.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ property. E.g.::
109109
Order : C
110110
Read-only : False
111111
Store type : MemoryStore
112+
Filters : ()
112113
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
113114
Compressors : (ZstdCodec(level=0, checksum=False),)
114115
No. bytes : 8000000 (7.6M)
@@ -124,6 +125,7 @@ property. E.g.::
124125
Order : C
125126
Read-only : False
126127
Store type : MemoryStore
128+
Filters : ()
127129
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
128130
Compressors : (ZstdCodec(level=0, checksum=False),)
129131
No. bytes : 4000000 (3.8M)

docs/user-guide/performance.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ To use sharding, you need to specify the ``shards`` parameter when creating the
9898
Order : C
9999
Read-only : False
100100
Store type : MemoryStore
101+
Filters : ()
101102
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
102103
Compressors : (ZstdCodec(level=0, checksum=False),)
103104
No. bytes : 100000000000 (93.1G)
@@ -126,6 +127,7 @@ ratios, depending on the correlation structure within the data. E.g.::
126127
Order : C
127128
Read-only : False
128129
Store type : MemoryStore
130+
Filters : ()
129131
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
130132
Compressors : (ZstdCodec(level=0, checksum=False),)
131133
No. bytes : 400000000 (381.5M)
@@ -144,6 +146,7 @@ ratios, depending on the correlation structure within the data. E.g.::
144146
Order : F
145147
Read-only : False
146148
Store type : MemoryStore
149+
Filters : ()
147150
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
148151
Compressors : (ZstdCodec(level=0, checksum=False),)
149152
No. bytes : 400000000 (381.5M)

src/zarr/core/_info.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,11 @@ def __repr__(self) -> str:
116116
# for non-regular chunk grids
117117
kwargs["chunk_shape"] = "<variable>"
118118

119-
if len(self._filters) > 0:
120-
template += "\nFilters : {_filters}"
119+
template += "\nFilters : {_filters}"
121120
if self._serializer is not None:
122121
template += "\nSerializer : {_serializer}"
123-
if len(self._compressors) > 0:
124-
template += "\nCompressors : {_compressors}"
122+
123+
template += "\nCompressors : {_compressors}"
125124

126125
if self._count_bytes is not None:
127126
template += "\nNo. bytes : {_count_bytes}"

tests/test_info.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ def test_array_info(zarr_format: ZarrFormat) -> None:
7171
Order : C
7272
Read-only : True
7373
Store type : MemoryStore
74-
Serializer : BytesCodec(endian=<Endian.little: 'little'>)""")
74+
Filters : ()
75+
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
76+
Compressors : ()""")
7577

7678

7779
@pytest.mark.parametrize("zarr_format", ZARR_FORMATS)
@@ -110,7 +112,9 @@ def test_array_info_complete(
110112
Order : C
111113
Read-only : True
112114
Store type : MemoryStore
115+
Filters : ()
113116
Serializer : BytesCodec(endian=<Endian.little: 'little'>)
117+
Compressors : ()
114118
No. bytes : {count_bytes} ({count_bytes_formatted})
115119
No. bytes stored : {count_bytes_stored_formatted}
116120
Storage ratio : {storage_ratio_formatted}

0 commit comments

Comments
 (0)