diff --git a/docs/user-guide/storage.md b/docs/user-guide/storage.md index 0fea19a3f5..2b200c27b9 100644 --- a/docs/user-guide/storage.md +++ b/docs/user-guide/storage.md @@ -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" diff --git a/src/zarr/core/array.py b/src/zarr/core/array.py index 6b20ee950d..7febc02a2d 100644 --- a/src/zarr/core/array.py +++ b/src/zarr/core/array.py @@ -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) diff --git a/src/zarr/core/buffer/core.py b/src/zarr/core/buffer/core.py index c402904049..9602a55258 100644 --- a/src/zarr/core/buffer/core.py +++ b/src/zarr/core/buffer/core.py @@ -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 @@ -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: @@ -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 ---------- diff --git a/src/zarr/core/buffer/cpu.py b/src/zarr/core/buffer/cpu.py index 58275d2843..8994281b58 100644 --- a/src/zarr/core/buffer/cpu.py +++ b/src/zarr/core/buffer/cpu.py @@ -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 @@ -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 diff --git a/src/zarr/core/buffer/gpu.py b/src/zarr/core/buffer/gpu.py index d99c1d2818..8672942364 100644 --- a/src/zarr/core/buffer/gpu.py +++ b/src/zarr/core/buffer/gpu.py @@ -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 diff --git a/src/zarr/core/dtype/npy/bytes.py b/src/zarr/core/dtype/npy/bytes.py index cb7d86e957..2cf5985d69 100644 --- a/src/zarr/core/dtype/npy/bytes.py +++ b/src/zarr/core/dtype/npy/bytes.py @@ -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 ---------- diff --git a/src/zarr/core/dtype/npy/int.py b/src/zarr/core/dtype/npy/int.py index 580776a865..f71f535abb 100644 --- a/src/zarr/core/dtype/npy/int.py +++ b/src/zarr/core/dtype/npy/int.py @@ -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 ---------- @@ -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 ------- @@ -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() @@ -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 ---------- @@ -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 ------- @@ -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 ---------- @@ -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 ------- @@ -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 ---------- @@ -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 ------- @@ -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 ---------- @@ -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 ---------- diff --git a/src/zarr/core/metadata/v3.py b/src/zarr/core/metadata/v3.py index a14373c340..5ce155bd9a 100644 --- a/src/zarr/core/metadata/v3.py +++ b/src/zarr/core/metadata/v3.py @@ -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) diff --git a/src/zarr/storage/_common.py b/src/zarr/storage/_common.py index d762097cc3..4bea04f024 100644 --- a/src/zarr/storage/_common.py +++ b/src/zarr/storage/_common.py @@ -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-") @@ -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 @@ -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 diff --git a/src/zarr/storage/_fsspec.py b/src/zarr/storage/_fsspec.py index 7945fba467..9a632b235e 100644 --- a/src/zarr/storage/_fsspec.py +++ b/src/zarr/storage/_fsspec.py @@ -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 ---------- @@ -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 ---------- @@ -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 ---------- diff --git a/src/zarr/storage/_utils.py b/src/zarr/storage/_utils.py index 39c28d44c3..10ac395b36 100644 --- a/src/zarr/storage/_utils.py +++ b/src/zarr/storage/_utils.py @@ -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 diff --git a/src/zarr/testing/buffer.py b/src/zarr/testing/buffer.py index 4b652bc93d..6096ece2f8 100644 --- a/src/zarr/testing/buffer.py +++ b/src/zarr/testing/buffer.py @@ -22,7 +22,7 @@ class TestNDArrayLike(np.ndarray): - """An example of a ndarray-like class""" + """An example of an ndarray-like class""" __test__ = False diff --git a/tests/test_store/test_fsspec.py b/tests/test_store/test_fsspec.py index 1e3ed26568..a2c07b7ed1 100644 --- a/tests/test_store/test_fsspec.py +++ b/tests/test_store/test_fsspec.py @@ -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)) diff --git a/tests/test_store/test_logging.py b/tests/test_store/test_logging.py index e4a0f64b48..fa566e45aa 100644 --- a/tests/test_store/test_logging.py +++ b/tests/test_store/test_logging.py @@ -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 diff --git a/tests/test_store/test_object.py b/tests/test_store/test_object.py index cc0b44f540..6a4b796639 100644 --- a/tests/test_store/test_object.py +++ b/tests/test_store/test_object.py @@ -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