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.
Metadata
Release files for hypothesis-array-api 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hypothesis-array-api-0.1.2.tar.gz | 19.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hypothesis_array_api-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.5 kB
Release files / hypothesis-array-api-0.1.2.tar.gz
| Download URL | hypothesis-array-api-0.1.2.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0428740925c5789b8aea9e2973435e35b6f743da22d42de4759625fdccbad40c
|
|
BLAKE2b-256 checksum How to use checksums |
f6091fb6909f6d1390d2c8f28d71c63fcb4f5ef454e82d3a43e77b4a49aab201
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.8.10 Linux/5.11.0-25-generic
|
Release files / hypothesis_array_api-0.1.2-py3-none-any.whl
| Download URL | hypothesis_array_api-0.1.2-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2aac37537f65b3283668fe067557ed84dd8a1e45f7f2252b6d97086d35be9a7b
|
|
BLAKE2b-256 checksum How to use checksums |
326d2cca57d0a5fa9a0debb3baba70e5561a9e40e09279ee65241b55d06e935b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.8.10 Linux/5.11.0-25-generic
|
Security for hypothesis-array-api 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.