Skip to main content

Hypothesis strategies for Array API libraries

Project description

Hypothesis strategies for Array API libraries

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.

Additionaly 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

hypothesis-array-api-0.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hypothesis_array_api-0.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file hypothesis-array-api-0.0.1.tar.gz.

File metadata

  • Download URL: hypothesis-array-api-0.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.10 Linux/5.8.0-63-generic

File hashes

Hashes for hypothesis-array-api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cf0182f8f0cfe879f3a6f361af81c696177a3b51b9dc0751a4b8c1fba86c1bd6
MD5 1c43572e449882b921ff599839c14dd9
BLAKE2b-256 465817c84ac3ff42c775936a0b661e280eb63bada50bdc9184cfa9b82ae4507e

See more details on using hashes here.

File details

Details for the file hypothesis_array_api-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: hypothesis_array_api-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.10 Linux/5.8.0-63-generic

File hashes

Hashes for hypothesis_array_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2332aa261cbe828b0b63b5b289a07e96cb559c3fbaa4cc556c584e133faf130
MD5 75f682efbd58a7500349ea410e7f88af
BLAKE2b-256 f556124f1ed069a5d6dc3274eeef090dc7bcef64be27d3d31933ca940d8c5728

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page