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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ repos:
- id: trailing-whitespace
- id: no-commit-to-branch
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.22
rev: v0.16.0
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-check
args: [--preview, --select=CPY]
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.25.3
rev: v2.26.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/biomejs/pre-commit
rev: v2.5.4
rev: v2.5.5
hooks:
- id: biome-format
- repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
8 changes: 4 additions & 4 deletions src/fast_array_utils/_plugins/numba_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def box_matrix(typ: CSType, val: NativeValue, c: BoxContext) -> Value:

# See https://numba.readthedocs.io/en/stable/extending/overloading-guide.html
@overload(np.shape)
def overload_sparse_shape(x: CSType) -> None | Callable[[CSType], nbtypes.UniTuple]:
def overload_sparse_shape(x: CSType) -> Callable[[CSType], nbtypes.UniTuple] | None:
if not isinstance(x, CSType): # pragma: no cover
return None

Expand All @@ -195,7 +195,7 @@ def shape(x: CSType) -> nbtypes.UniTuple: # pragma: no cover


@overload_attribute(CSType, "ndim")
def overload_sparse_ndim(inst: CSType) -> None | Callable[[CSType], int]:
def overload_sparse_ndim(inst: CSType) -> Callable[[CSType], int] | None:
if not isinstance(inst, CSType): # pragma: no cover
return None

Expand All @@ -207,7 +207,7 @@ def ndim(inst: CSType) -> int: # pragma: no cover


@intrinsic
def _sparse_copy(
def _sparse_copy( # noqa: PLR0917
typingctx: TypingContext, # noqa: ARG001
inst: CSType,
data: nbtypes.Array, # noqa: ARG001
Expand Down Expand Up @@ -241,7 +241,7 @@ def _construct(


@overload_method(CSType, "copy")
def overload_sparse_copy(inst: CSType) -> None | Callable[[CSType], CSType]:
def overload_sparse_copy(inst: CSType) -> Callable[[CSType], CSType] | None:
if not isinstance(inst, CSType): # pragma: no cover
return None

Expand Down
2 changes: 1 addition & 1 deletion tests/test_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ def compiled(*_args: object, **_kwargs: object) -> bool:
],
)
def test_probe_needed(
*,
monkeypatch: pytest.MonkeyPatch,
platform_name: str,
machine: str,
loaded: tuple[str, ...],
layer: fa_numba.ThreadingLayer | fa_numba.TheadingCategory,
priority: tuple[fa_numba.ThreadingLayer, ...],
layers: dict[fa_numba.TheadingCategory, set[fa_numba.ThreadingLayer]] | None,
*,
expected: bool,
) -> None:
_set_runtime(monkeypatch, platform_name=platform_name, machine=machine, loaded=loaded, layer=layer, priority=priority, layers=layers)
Expand Down
1 change: 1 addition & 0 deletions tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def test_ndim_error(

@pytest.mark.array_type(skip=ATS_SPARSE_DS)
def test_sum(
*,
request: pytest.FixtureRequest,
array_type: ArrayType[CpuArray | GpuArray | DiskArray | types.DaskArray],
dtype_in: type[DTypeIn],
Expand Down
Loading