Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repos:
- id: prettier
args: ["--tab-width", "2"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.4
rev: v0.16.5
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ assert not isinstance(array_api_strict, ArrayNamespaceFull)
```python
from array_api.latest import ShapedAnyArray as Array


def sum_last_axis[*TShape](x: Array[*TShape, Any]) -> Array[*TShape]:
return xp.sum(x, axis=-1)
```
Expand All @@ -117,6 +118,8 @@ assert not isinstance(array_api_strict, ArrayNamespaceFull)
```python
RTheta = NewType("RTheta", int)
XY = NewType("XY", int)


def polar_coordinates[*TShape](randtheta: Array[*TShape, RTheta]) -> Array[*TShape, XY]:
"""Convert polar coordinates to Cartesian coordinates."""
r = randtheta[..., 0]
Expand Down
Loading