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
xpst = get_strategies_namespace(xp)
@given(xpst.arrays(dtype=xpst.scalar_strategies(), shape=xpst.array_shapes()))
def your_test(array):
...
Contributors
@honno created these strategies with input from @mattip, @asmeurer, @rgommers and other great folk from @Quansight-Labs.
Great 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.
License
Most files are licensed under MPL
and are denoted as such in their header,
copyright to David R. MacIver and other contributors.
I have made modifications and additions to all these files,
excluding those in tests/common/
which remain unchanged.
Everything else is licensed under MIT
,
copyright to Matthew Barber.
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.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 694e89f490741f700761622600d7712760c5622dbc037f99061639e9ca981365 |
|
MD5 | cdcceb6e0f05ce8cb041982d94bff373 |
|
BLAKE2b-256 | 721f380f603960bf6b1955b48f81451d46a101329e91bc65bc80b22278666d2d |
Hashes for hypothesis_array_api-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b02394b2d7c5fced84c54ffca00ff2d97b4adc8d79b20fb97c6d133022329d |
|
MD5 | b12021027d2b9f14f8c464bea83f8704 |
|
BLAKE2b-256 | 805d7b6b3cb7dff36d2f4fc45256ac91d4679b2b39488b411fcf1191b762d5b2 |