zarr.testing.strategies#
Attributes#
Functions#
|
|
|
|
|
Basic indices without unsupported negative slices. |
|
|
|
|
|
|
|
A strategy that slices ranges that include the last chunk. |
|
|
|
Function to generate key_ranges strategy for get_partial_values() |
|
|
|
A hypothesis strategy to generate small sized random arrays. |
|
Generate numpy arrays that can be saved in the provided Zarr format. |
|
Strategy that returns |
|
|
Generate UTF-8-safe text constrained to max_len of dtype. |
|
|
|
|
|
|
|
|
Module Contents#
- zarr.testing.strategies.array_metadata(
- *,
- array_shapes: hypothesis.strategies.SearchStrategy[tuple[int, Ellipsis]] = npst.array_shapes,
- zarr_formats: hypothesis.strategies.SearchStrategy[Literal[2, 3]] = zarr_formats,
- attributes: hypothesis.strategies.SearchStrategy[dict[str, Any]] = attrs,
- 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.testing.strategies.basic_indices(*, shape: tuple[int], **kwargs: Any) Any [source]#
Basic indices without unsupported negative slices.
- zarr.testing.strategies.clear_store(x: zarr.abc.store.Store) zarr.abc.store.Store [source]#
- zarr.testing.strategies.dimension_names(*, ndim: int | None = None) list[None | str] | None [source]#
- zarr.testing.strategies.end_slices(*, shape: tuple[int]) Any [source]#
A strategy that slices ranges that include the last chunk. This is intended to stress-test handling of a possibly smaller last chunk.
- zarr.testing.strategies.key_ranges(
- keys: hypothesis.strategies.SearchStrategy = node_names,
- max_size: int = sys.maxsize,
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,
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,
- dtype: numpy.dtype[Any] | None = None,
- zarr_formats: hypothesis.strategies.SearchStrategy[zarr.core.common.ZarrFormat] | None = zarr_formats,
Generate numpy arrays that can be saved in the provided Zarr format.
- zarr.testing.strategies.orthogonal_indices( ) tuple[tuple[numpy.ndarray[Any, Any], Ellipsis], tuple[numpy.ndarray[Any, Any], Ellipsis]] [source]#
Strategy that returns (1) a tuple of integer arrays used for orthogonal indexing of Zarr arrays. (2) an tuple of integer arrays that can be used for equivalent indexing of numpy arrays
- zarr.testing.strategies.safe_unicode_for_dtype(
- dtype: numpy.dtype[numpy.str_],
Generate UTF-8-safe text constrained to max_len of dtype.
- zarr.testing.strategies.v2_dtypes() hypothesis.strategies.SearchStrategy[numpy.dtype] [source]#
- zarr.testing.strategies.v3_dtypes() hypothesis.strategies.SearchStrategy[numpy.dtype] [source]#