Skip to content

Commit 08a2d52

Browse files
committed
fix tests
1 parent 1926a32 commit 08a2d52

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/zarr/api/synchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def create(
542542
read_only: bool | None = None,
543543
object_codec: Codec | None = None, # TODO: type has changed
544544
dimension_separator: Literal[".", "/"] | None = None,
545-
write_empty_chunks: bool = False, # TODO: default has changed
545+
write_empty_chunks: bool | None = None, # TODO: default has changed
546546
zarr_version: ZarrFormat | None = None, # deprecated
547547
zarr_format: ZarrFormat | None = None,
548548
meta_array: Any | None = None, # TODO: need type

src/zarr/core/array.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ class AsyncArray(Generic[T_ArrayMetadata]):
199199
The path to the Zarr store.
200200
codec_pipeline : CodecPipeline
201201
The codec pipeline used for encoding and decoding chunks.
202-
config : ArrayConfig
202+
_config : ArrayConfig
203203
The runtime configuration of the array.
204204
"""
205205

206206
metadata: T_ArrayMetadata
207207
store_path: StorePath
208208
codec_pipeline: CodecPipeline = field(init=False)
209-
config: ArrayConfig
209+
_config: ArrayConfig
210210

211211
@overload
212212
def __init__(
@@ -247,7 +247,7 @@ def __init__(
247247

248248
object.__setattr__(self, "metadata", metadata_parsed)
249249
object.__setattr__(self, "store_path", store_path)
250-
object.__setattr__(self, "config", config)
250+
object.__setattr__(self, "_config", config)
251251
object.__setattr__(self, "codec_pipeline", create_codec_pipeline(metadata=metadata_parsed))
252252

253253
# this overload defines the function signature when zarr_format is 2
@@ -800,7 +800,7 @@ def order(self) -> MemoryOrder:
800800
bool
801801
Memory order of the array
802802
"""
803-
return self.config.order
803+
return self._config.order
804804

805805
@property
806806
def attrs(self) -> dict[str, JSON]:
@@ -1024,7 +1024,7 @@ async def _get_selection(
10241024
out_buffer = prototype.nd_buffer.create(
10251025
shape=indexer.shape,
10261026
dtype=out_dtype,
1027-
order=self.config.order,
1027+
order=self._config.order,
10281028
fill_value=self.metadata.fill_value,
10291029
)
10301030
if product(indexer.shape) > 0:
@@ -1034,7 +1034,7 @@ async def _get_selection(
10341034
(
10351035
self.store_path / self.metadata.encode_chunk_key(chunk_coords),
10361036
self.metadata.get_chunk_spec(
1037-
chunk_coords, self.config, prototype=prototype
1037+
chunk_coords, self._config, prototype=prototype
10381038
),
10391039
chunk_selection,
10401040
out_selection,
@@ -1157,7 +1157,7 @@ async def _set_selection(
11571157
[
11581158
(
11591159
self.store_path / self.metadata.encode_chunk_key(chunk_coords),
1160-
self.metadata.get_chunk_spec(chunk_coords, self.config, prototype),
1160+
self.metadata.get_chunk_spec(chunk_coords, self._config, prototype),
11611161
chunk_selection,
11621162
out_selection,
11631163
)

tests/test_array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def test_write_empty_chunks_config(write_empty_chunks: bool) -> None:
766766
"""
767767
with zarr.config.set({"array.write_empty_chunks": write_empty_chunks}):
768768
arr = Array.create({}, shape=(2, 2), dtype="i4")
769-
assert arr._async_array.config.write_empty_chunks == write_empty_chunks
769+
assert arr._async_array._config.write_empty_chunks == write_empty_chunks
770770

771771

772772
@pytest.mark.parametrize("store", ["memory"], indirect=True)
@@ -795,7 +795,7 @@ def test_write_empty_chunks_behavior(
795795
write_empty_chunks=write_empty_chunks,
796796
)
797797

798-
assert arr._async_array.config.write_empty_chunks == write_empty_chunks
798+
assert arr._async_array._config.write_empty_chunks == write_empty_chunks
799799

800800
# initialize the store with some non-fill value chunks
801801
arr[:] = fill_value + 1

0 commit comments

Comments
 (0)