Skip to content

Commit 2edf3b8

Browse files
rabernatjhamman
andauthored
Apply suggestions from code review
Co-authored-by: Joe Hamman <[email protected]>
1 parent 6714bad commit 2edf3b8

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/zarr/codecs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
]
3535

3636

37-
def get_default_array_bytes_codec(
37+
def _get_default_array_bytes_codec(
3838
np_dtype: np.dtype[Any],
3939
) -> BytesCodec | VLenUTF8Codec | VLenBytesCodec:
4040
dtype = DataType.from_numpy(np_dtype)

src/zarr/codecs/vlen_utf8.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020

2121
# can use a global because there are no parameters
22-
vlen_utf8_codec = VLenUTF8()
23-
vlen_bytes_codec = VLenBytes()
22+
_vlen_utf8_codec = VLenUTF8()
23+
_vlen_bytes_codec = VLenBytes()
2424

2525

2626
@dataclass(frozen=True)

src/zarr/core/buffer/core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ class NDBuffer:
313313
"""
314314

315315
def __init__(self, array: NDArrayLike) -> None:
316-
# assert array.dtype != object
317316
self._data = array
318317

319318
@classmethod
@@ -466,7 +465,6 @@ def all_equal(self, other: Any, equal_nan: bool = True) -> bool:
466465
# Handle None fill_value for Zarr V2
467466
return False
468467
# use array_equal to obtain equal_nan=True functionality
469-
# Note from Ryan: doesn't this lead to a huge amount of unnecessary memory allocation on every single chunk?
470468
# Since fill-value is a scalar, isn't there a faster path than allocating a new array for fill value
471469
# every single time we have to write data?
472470
_data, other = np.broadcast_arrays(self._data, other)

0 commit comments

Comments
 (0)