diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07657e7..9684217 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/README.md b/README.md index bc2684a..7e670cf 100644 --- a/README.md +++ b/README.md @@ -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) ``` @@ -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]