Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/user-guide/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ print(store)

### Memory Store

The [`zarr.storage.MemoryStore`][] a in-memory store that allows for serialization of
The [`zarr.storage.MemoryStore`][] an in-memory store that allows for serialization of
Zarr data (metadata and chunks) to a dictionary:

```python exec="true" session="storage" source="above" result="ansi"
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/core/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ async def _set_selection(
value = cast("NDArrayLike", value)

# We accept any ndarray like object from the user and convert it
# to a NDBuffer (or subclass). From this point onwards, we only pass
# to an NDBuffer (or subclass). From this point onwards, we only pass
# Buffer and NDBuffer between components.
value_buffer = prototype.nd_buffer.from_ndarray_like(value)

Expand Down
6 changes: 3 additions & 3 deletions src/zarr/core/buffer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class NDBuffer:

We use NDBuffer throughout Zarr to represent a n-dimensional memory block.

A NDBuffer is backed by an underlying ndarray-like instance that represents
An NDBuffer is backed by an underlying ndarray-like instance that represents
the memory. The memory type is unspecified; can be regular host memory,
CUDA device memory, or something else. The only requirement is that the
ndarray-like instance can be copied/converted to a regular Numpy array
Expand Down Expand Up @@ -368,7 +368,7 @@ def create(

Notes
-----
A subclass can overwrite this method to create a ndarray-like object
A subclass can overwrite this method to create an ndarray-like object
other then the default Numpy array.
"""
if cls is NDBuffer:
Expand Down Expand Up @@ -416,7 +416,7 @@ def empty(

@classmethod
def from_ndarray_like(cls, ndarray_like: NDArrayLike) -> Self:
"""Create a new buffer of a ndarray-like object
"""Create a new buffer of an ndarray-like object

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions src/zarr/core/buffer/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Buffer(core.Buffer):

We use Buffer throughout Zarr to represent a contiguous block of memory.

A Buffer is backed by a underlying array-like instance that represents
A Buffer is backed by an underlying array-like instance that represents
the memory. The memory type is unspecified; can be regular host memory,
CUDA device memory, or something else. The only requirement is that the
array-like instance can be copied/converted to a regular Numpy array
Expand Down Expand Up @@ -121,7 +121,7 @@ class NDBuffer(core.NDBuffer):

We use NDBuffer throughout Zarr to represent a n-dimensional memory block.

A NDBuffer is backed by a underlying ndarray-like instance that represents
An NDBuffer is backed by an underlying ndarray-like instance that represents
the memory. The memory type is unspecified; can be regular host memory,
CUDA device memory, or something else. The only requirement is that the
ndarray-like instance can be copied/converted to a regular Numpy array
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/core/buffer/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class NDBuffer(core.NDBuffer):
We use NDBuffer throughout Zarr to represent a n-dimensional memory block.
A NDBuffer is backed by an underlying ndarray-like instance that represents
An NDBuffer is backed by an underlying ndarray-like instance that represents
the memory. The memory type is unspecified; can be regular host memory,
CUDA device memory, or something else. The only requirement is that the
ndarray-like instance can be copied/converted to a regular Numpy array
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/core/dtype/npy/bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def to_json_scalar(self, data: object, *, zarr_format: ZarrFormat) -> str:

def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.void:
"""
Read a JSON-serializable value as a np.void.
Read a JSON-serializable value as an np.void.
Parameters
----------
Expand Down
22 changes: 11 additions & 11 deletions src/zarr/core/dtype/npy/int.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class Int8(BaseInt[np.dtypes.Int8DType, np.int8]):
@classmethod
def from_native_dtype(cls, dtype: TBaseDType) -> Self:
"""
Create an Int8 from a np.dtype('int8') instance.
Create an Int8 from an np.dtype('int8') instance.

Parameters
----------
Expand All @@ -288,7 +288,7 @@ def from_native_dtype(cls, dtype: TBaseDType) -> Self:

def to_native_dtype(self: Self) -> np.dtypes.Int8DType:
"""
Convert the Int8 instance to a np.dtype('int8') instance.
Convert the Int8 instance to an np.dtype('int8') instance.

Returns
-------
Expand Down Expand Up @@ -419,7 +419,7 @@ class UInt8(BaseInt[np.dtypes.UInt8DType, np.uint8]):
@classmethod
def from_native_dtype(cls, dtype: TBaseDType) -> Self:
"""
Create a UInt8 from a np.dtype('uint8') instance.
Create a UInt8 from an np.dtype('uint8') instance.
"""
if cls._check_native_dtype(dtype):
return cls()
Expand Down Expand Up @@ -566,7 +566,7 @@ class Int16(BaseInt[np.dtypes.Int16DType, np.int16], HasEndianness):
@classmethod
def from_native_dtype(cls, dtype: TBaseDType) -> Self:
"""
Create an instance of this data type from a np.dtype('int16') instance.
Create an instance of this data type from an np.dtype('int16') instance.

Parameters
----------
Expand All @@ -591,7 +591,7 @@ def from_native_dtype(cls, dtype: TBaseDType) -> Self:

def to_native_dtype(self) -> np.dtypes.Int16DType:
"""
Convert the data type to a np.dtype('int16') instance.
Convert the data type to an np.dtype('int16') instance.

Returns
-------
Expand Down Expand Up @@ -728,7 +728,7 @@ class UInt16(BaseInt[np.dtypes.UInt16DType, np.uint16], HasEndianness):
@classmethod
def from_native_dtype(cls, dtype: TBaseDType) -> Self:
"""
Create an instance of this data type from a np.dtype('uint16') instance.
Create an instance of this data type from an np.dtype('uint16') instance.

Parameters
----------
Expand All @@ -753,7 +753,7 @@ def from_native_dtype(cls, dtype: TBaseDType) -> Self:

def to_native_dtype(self) -> np.dtypes.UInt16DType:
"""
Convert the data type to a np.dtype('uint16') instance.
Convert the data type to an np.dtype('uint16') instance.

Returns
-------
Expand Down Expand Up @@ -911,7 +911,7 @@ def _check_native_dtype(cls: type[Self], dtype: TBaseDType) -> TypeGuard[np.dtyp
@classmethod
def from_native_dtype(cls: type[Self], dtype: TBaseDType) -> Self:
"""
Create an Int32 from a np.dtype('int32') instance.
Create an Int32 from an np.dtype('int32') instance.

Parameters
----------
Expand All @@ -936,7 +936,7 @@ def from_native_dtype(cls: type[Self], dtype: TBaseDType) -> Self:

def to_native_dtype(self: Self) -> np.dtypes.Int32DType:
"""
Convert the Int32 instance to a np.dtype('int32') instance.
Convert the Int32 instance to an np.dtype('int32') instance.

Returns
-------
Expand Down Expand Up @@ -1073,7 +1073,7 @@ class UInt32(BaseInt[np.dtypes.UInt32DType, np.uint32], HasEndianness):
@classmethod
def from_native_dtype(cls, dtype: TBaseDType) -> Self:
"""
Create a UInt32 from a np.dtype('uint32') instance.
Create a UInt32 from an np.dtype('uint32') instance.

Parameters
----------
Expand Down Expand Up @@ -1231,7 +1231,7 @@ class Int64(BaseInt[np.dtypes.Int64DType, np.int64], HasEndianness):
@classmethod
def from_native_dtype(cls, dtype: TBaseDType) -> Self:
"""
Create an Int64 from a np.dtype('int64') instance.
Create an Int64 from an np.dtype('int64') instance.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/core/metadata/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def parse_dimension_names(data: object) -> tuple[str | None, ...] | None:
elif isinstance(data, Iterable) and all(isinstance(x, type(None) | str) for x in data):
return tuple(data)
else:
msg = f"Expected either None or a iterable of str, got {type(data)}"
msg = f"Expected either None or an iterable of str, got {type(data)}"
raise TypeError(msg)


Expand Down
6 changes: 3 additions & 3 deletions src/zarr/storage/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ async def make_store(
):
raise TypeError(
"'storage_options' was provided but unused. "
"'storage_options' is only used when the store is passed as a FSSpec URI string.",
"'storage_options' is only used when the store is passed as an FSSpec URI string.",
)

assert mode in (None, "r", "r+", "a", "w", "w-")
Expand Down Expand Up @@ -341,7 +341,7 @@ async def make_store(
return await LocalStore.open(root=store_like, mode=mode, read_only=_read_only)

elif isinstance(store_like, str):
# Either a FSSpec URI or a local filesystem path
# Either an FSSpec URI or a local filesystem path
if _is_fsspec_uri(store_like):
return FsspecStore.from_url(
store_like, storage_options=storage_options, read_only=_read_only
Expand Down Expand Up @@ -409,7 +409,7 @@ async def make_store_path(
if storage_options:
raise TypeError(
"'storage_options' was provided but unused. "
"'storage_options' is only used when the store is passed as a FSSpec URI string.",
"'storage_options' is only used when the store is passed as an FSSpec URI string.",
)
return store_like / path_normalized

Expand Down
6 changes: 3 additions & 3 deletions src/zarr/storage/_fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def from_upath(
allowed_exceptions: tuple[type[Exception], ...] = ALLOWED_EXCEPTIONS,
) -> FsspecStore:
"""
Create a FsspecStore from an upath object.
Create an FsspecStore from an upath object.

Parameters
----------
Expand Down Expand Up @@ -178,7 +178,7 @@ def from_mapper(
allowed_exceptions: tuple[type[Exception], ...] = ALLOWED_EXCEPTIONS,
) -> FsspecStore:
"""
Create a FsspecStore from a FSMap object.
Create an FsspecStore from an FSMap object.

Parameters
----------
Expand Down Expand Up @@ -211,7 +211,7 @@ def from_url(
allowed_exceptions: tuple[type[Exception], ...] = ALLOWED_EXCEPTIONS,
) -> FsspecStore:
"""
Create a FsspecStore from a URL. The type of store is determined from the URL scheme.
Create an FsspecStore from a URL. The type of store is determined from the URL scheme.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/storage/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def normalize_path(path: str | bytes | Path | None) -> str:

def _normalize_byte_range_index(data: Buffer, byte_range: ByteRequest | None) -> tuple[int, int]:
"""
Convert an ByteRequest into an explicit start and stop
Convert a ByteRequest into an explicit start and stop
"""
if byte_range is None:
start = 0
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/testing/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


class TestNDArrayLike(np.ndarray):
"""An example of a ndarray-like class"""
"""An example of an ndarray-like class"""

__test__ = False

Expand Down
2 changes: 1 addition & 1 deletion tests/test_store/test_fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def test_open_s3map_raises() -> None:
zarr.open(store=mapper, path="bar", mode="w", shape=(3, 3))
with pytest.raises(
TypeError,
match="'storage_options' is only used when the store is passed as a FSSpec URI string.",
match="'storage_options' is only used when the store is passed as an FSSpec URI string.",
):
zarr.open(store=mapper, storage_options={"anon": True}, mode="w", shape=(3, 3))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_store/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class StoreKwargs(TypedDict):


class TestLoggingStore(StoreTests[LoggingStore[LocalStore], cpu.Buffer]):
# store_cls is needed to do an isintsance check, so can't be a subscripted generic
# store_cls is needed to do an isinstance check, so can't be a subscripted generic
store_cls = LoggingStore # type: ignore[assignment]
buffer_cls = cpu.Buffer

Expand Down
2 changes: 1 addition & 1 deletion tests/test_store/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class StoreKwargs(TypedDict):


class TestObjectStore(StoreTests[ObjectStore[LocalStore], cpu.Buffer]):
# store_cls is needed to do an isintsance check, so can't be a subscripted generic
# store_cls is needed to do an isinstance check, so can't be a subscripted generic
store_cls = ObjectStore # type: ignore[assignment]
buffer_cls = cpu.Buffer

Expand Down