Skip to content

✨: add CanArrayX protocols #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3473691
✨: move HasArrayNamespace to _array.py and update imports
nstarman Jun 22, 2025
5d56158
✨: add Array class definition
nstarman Jun 22, 2025
c869543
refactor: rename type variable in HasArrayNamespace protocol for cons…
nstarman Jun 22, 2025
c1962cd
✨: add CanArrayPos protocol
nstarman Jun 22, 2025
f21c055
✨: add CanArrayNeg protocol
nstarman Jun 22, 2025
f862bf4
✨: add CanArrayAdd protocol
nstarman Jun 22, 2025
154e658
✨: add CanArraySub Protocol
nstarman Jun 22, 2025
bcac721
✨: add HasArrayMul protocol
nstarman Jun 22, 2025
dd7bc09
✨: add CanArrayTrueDiv protocol
nstarman Jun 22, 2025
15527d1
✨: add CanArrayFloorDiv protocol
nstarman Jun 22, 2025
47da1d3
✨: add CanArrayMod protocol
nstarman Jun 22, 2025
94e4c60
✨: add CanArrayPow protocol
nstarman Jun 22, 2025
ba6c5b4
✨: add CanArrayIAdd protocol
nstarman Jun 23, 2025
83b2f18
✨: add CanArrayISub protocol
nstarman Jun 23, 2025
bba937a
✨: add CanArrayIMul protocol
nstarman Jun 23, 2025
dce36c4
✨: add CanArrayITruediv protocol
nstarman Jun 23, 2025
c26f488
✨: add CanArrayIFloorDiv protocol
nstarman Jun 23, 2025
19cd5f9
✨: add CanArrayIPow protocol
nstarman Jun 23, 2025
6e2be2c
✨: add CanArrayIMod protocol
nstarman Jun 23, 2025
fe86cd6
✨: add CanArrayRAdd protocol
nstarman Jun 23, 2025
e19b28a
✨: add CanArrayRSub protocol
nstarman Jun 23, 2025
5165e18
✨: add CanArrayRMul protocol
nstarman Jun 23, 2025
0a935a8
✨: add CanArrayRTruediv protocol
nstarman Jun 23, 2025
fa4e6b8
✨: add CanArrayRFloorDiv protocol
nstarman Jun 23, 2025
6bb01a8
✨: add CanArrayRPow protocol
nstarman Jun 23, 2025
2ba52db
✨: add CanArrayRMod protocol
nstarman Jun 23, 2025
e346681
➕ `optype`!
jorenham Jul 1, 2025
839beed
📌 pin the correct python version
jorenham Jul 1, 2025
eeb588d
🔧 `ruff` <3 `optype`
jorenham Jul 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
]
dependencies = [
"typing-extensions>=4.14.0",
"optype>=0.9.3; python_version < '3.11'",
"optype>=0.10.0; python_version >= '3.11'",
]

[project.urls]
Expand Down Expand Up @@ -127,9 +129,12 @@ version_tuple = {version_tuple!r}
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D401", # First line of docstring should be in imperative mood
"FBT", # flake8-boolean-trap
"FIX", # flake8-fixme
"ISC001", # Conflicts with formatter
"PLW1641", # Object does not implement `__hash__` method
"PYI041", # Use `float` instead of `int | float`
]

[tool.ruff.lint.pylint]
Expand All @@ -143,10 +148,13 @@ version_tuple = {version_tuple!r}
]

[tool.ruff.lint.flake8-import-conventions]
banned-from = ["array_api_typing"]
banned-from = ["array_api_typing", "optype", "optype.numpy", "optype.numpy.compat"]

[tool.ruff.lint.flake8-import-conventions.extend-aliases]
array_api_typing = "xpt"
optype = "op"
"optype.numpy" = "onp"
"optype.numpy.compat" = "npc"

[tool.ruff.lint.isort]
combine-as-imports = true
Expand Down
3 changes: 2 additions & 1 deletion src/array_api_typing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Static typing support for the array API standard."""

__all__ = (
"Array",
"HasArrayNamespace",
"__version__",
"__version_tuple__",
)

from ._namespace import HasArrayNamespace
from ._array import Array, HasArrayNamespace
from ._version import version as __version__, version_tuple as __version_tuple__
Loading
Loading