Hypothesis strategies for Array API libraries
Project description
Hypothesis strategies for Array API libraries
Note: hypothesis-array-api
uses private APIs from Hypothesis
and so should be considered unstable.
Install
You can get the strategies from PyPI.
pip install hypothesis-array-api
To install from source,
get Poetry
and then poetry install
inside the repository.
Using poetry shell
is a good idea for development,
where you can use pytest
to run the full test suite
(note there a lot of expected warnings I need to declutter.)
Quickstart
from numpy import array_api as xp
from hypothesis import given
from hypothesis_array import get_strategies_namespace
xps = get_strategies_namespace(xp)
@given(xps.arrays(dtype=xps.scalar_strategies(), shape=xps.array_shapes()))
def your_test(array):
...
Contributors
@honno created these strategies with input from @mattip, @asmeurer, @rgommers and other great folk from @Quansight-Labs.
Inspiration was taken from the
NumPy strategies
that Hypothesis ships with at hypothesis.extra.numpy
.
Thanks to the Hypothesis contributors who helped shape it, including:
@Zac-HD,
@rsokl,
@DRMacIver,
@takluyver,
@rdturnermtl,
@kprzybyla,
@sobolevn,
@kir0ul,
@lmount,
@jdufresne,
@gsnsw-felixs and
@alexwlchan.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hypothesis-array-api-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e27aca1f3bb43c9cfde83baecd93cf8c198ea115178e8c888938a1d8c48a6da |
|
MD5 | f3e56e0e7bc1db9dfaf483031a9c9aeb |
|
BLAKE2b-256 | 7e22bc6b0783948ca0a9cf27131edd60c96e7ade67c418f0917355762f397924 |
Hashes for hypothesis_array_api-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3404a78b7177314f5b9aa3e1b3d7fa9f37ccc4638c1e7f2fadfe265d1069dba1 |
|
MD5 | e997b77f6c257bbed9a4082e8308a7d6 |
|
BLAKE2b-256 | 4e849e897b396ae16be4e78a9ef3726be56482d386f7bef2f3fcecc14222eadb |