zarr.testing.strategies#

Attributes#

Functions#

arrays(→ zarr.core.array.Array)

basic_indices(→ Any)

Basic indices without unsupported negative slices.

is_negative_slice(→ bool)

key_ranges(...)

Function to generate key_ranges strategy for get_partial_values()

np_array_and_chunks(→ tuple[numpy.ndarray, tuple[int, ...)

A hypothesis strategy to generate small sized random arrays.

numpy_arrays(→ Any)

Generate numpy arrays that can be saved in the provided Zarr format.

v2_dtypes(...)

v3_dtypes(...)

Module Contents#

zarr.testing.strategies.arrays(
*,
shapes: hypothesis.strategies.SearchStrategy[tuple[int, Ellipsis]] = array_shapes,
compressors: hypothesis.strategies.SearchStrategy = compressors,
stores: hypothesis.strategies.SearchStrategy[zarr.storage.StoreLike] = stores,
paths: hypothesis.strategies.SearchStrategy[str | None] = paths,
array_names: hypothesis.strategies.SearchStrategy = array_names,
arrays: hypothesis.strategies.SearchStrategy | None = None,
attrs: hypothesis.strategies.SearchStrategy = attrs,
zarr_formats: hypothesis.strategies.SearchStrategy = zarr_formats,
) zarr.core.array.Array[source]#
zarr.testing.strategies.basic_indices(*, shape: tuple[int], **kwargs: Any) Any[source]#

Basic indices without unsupported negative slices.

zarr.testing.strategies.is_negative_slice(idx: Any) bool[source]#
zarr.testing.strategies.key_ranges(
keys: hypothesis.strategies.SearchStrategy = node_names,
max_size: int | None = None,
) hypothesis.strategies.SearchStrategy[list[int]][source]#

Function to generate key_ranges strategy for get_partial_values() returns list strategy w/ form:

[(key, (range_start, range_end)),
 (key, (range_start, range_end)),...]
zarr.testing.strategies.np_array_and_chunks(
*,
arrays: hypothesis.strategies.SearchStrategy[numpy.ndarray] = numpy_arrays,
) tuple[numpy.ndarray, tuple[int, Ellipsis]][source]#

A hypothesis strategy to generate small sized random arrays.

Returns: a tuple of the array and a suitable random chunking for it.

zarr.testing.strategies.numpy_arrays(
*,
shapes: hypothesis.strategies.SearchStrategy[tuple[int, Ellipsis]] = array_shapes,
zarr_formats: hypothesis.strategies.SearchStrategy[zarr.core.common.ZarrFormat] = zarr_formats,
) Any[source]#

Generate numpy arrays that can be saved in the provided Zarr format.

zarr.testing.strategies.v2_dtypes() hypothesis.strategies.SearchStrategy[numpy.dtype][source]#
zarr.testing.strategies.v3_dtypes() hypothesis.strategies.SearchStrategy[numpy.dtype][source]#
zarr.testing.strategies.array_names[source]#
zarr.testing.strategies.array_shapes[source]#
zarr.testing.strategies.attrs[source]#
zarr.testing.strategies.compressors[source]#
zarr.testing.strategies.keys[source]#
zarr.testing.strategies.node_names[source]#
zarr.testing.strategies.paths[source]#
zarr.testing.strategies.stores[source]#
zarr.testing.strategies.zarr_formats: hypothesis.strategies.SearchStrategy[zarr.core.common.ZarrFormat][source]#
zarr.testing.strategies.zarr_key_chars[source]#