Typing for array API and array-api-compat
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Python array API standard typing
Documentation: https://array-api.readthedocs.io
Source Code: https://github.com/34j/array-api
Typing for array API and array-api-compat
Installation
Install this via pip (or your favourite package manager):
pip install array-api
Usage
Type stubs
Provices type stubs for array-api-compat
.
import array_api_compat
xp = array_api_compat.array_namespace(x)
Array Type
from array_api._2024_12 import Array
def my_function[TArray: Array](x: TArray) -> TArray:
return x + 1
Namespace Type
You can test if an object matches the Protocol by:
import array_api_strict
from array_api._2024_12 import ArrayNamespace, ArrayNamespaceFull
assert isinstance(array_api_strict, ArrayNamespace)
# Full version contains fft and linalg
# fft and linalg are not included by default in array_api_strict
assert not isinstance(array_api_strict, ArrayNamespaceFull)
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file array_api-1.0.0.tar.gz
.
File metadata
- Download URL: array_api-1.0.0.tar.gz
- Upload date:
- Size: 365.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
e354c466f68daadc6a45330e1c90df5560d2c3fcaa351fd003ce8f1b85a37e17
|
|
MD5 |
e8bd062f18e30440a7c1549ef1eb01a9
|
|
BLAKE2b-256 |
ea69c5015ba09a4c7dfc59de091c60c96d8555cfe81a3ab97b3491552c7ddda9
|
Provenance
The following attestation bundles were made for array_api-1.0.0.tar.gz
:
Publisher:
ci.yml
on 34j/array-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
array_api-1.0.0.tar.gz
-
Subject digest:
e354c466f68daadc6a45330e1c90df5560d2c3fcaa351fd003ce8f1b85a37e17
- Sigstore transparency entry: 236981726
- Sigstore integration time:
-
Permalink:
34j/array-api@02345bdc73329f6f6bde545550b4fdd1716dadcb
-
Branch / Tag:
refs/heads/main
- Owner: https://github.com/34j
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
ci.yml@02345bdc73329f6f6bde545550b4fdd1716dadcb
-
Trigger Event:
push
-
Statement type:
File details
Details for the file array_api-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: array_api-1.0.0-py3-none-any.whl
- Upload date:
- Size: 368.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5bdc02b81c6c3f957324869b6abed19744630777541097e400e26f07881c8b07
|
|
MD5 |
c9c42a5eecd985201216cd8f76713f90
|
|
BLAKE2b-256 |
71772e33ceaf3fdf7959a18222a7ed1c56b1f7e746d3c07f9bf7f4810283da06
|
Provenance
The following attestation bundles were made for array_api-1.0.0-py3-none-any.whl
:
Publisher:
ci.yml
on 34j/array-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
array_api-1.0.0-py3-none-any.whl
-
Subject digest:
5bdc02b81c6c3f957324869b6abed19744630777541097e400e26f07881c8b07
- Sigstore transparency entry: 236981728
- Sigstore integration time:
-
Permalink:
34j/array-api@02345bdc73329f6f6bde545550b4fdd1716dadcb
-
Branch / Tag:
refs/heads/main
- Owner: https://github.com/34j
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
ci.yml@02345bdc73329f6f6bde545550b4fdd1716dadcb
-
Trigger Event:
push
-
Statement type: