Skip to content
Merged
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
9 changes: 7 additions & 2 deletions tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ def test_sum_benchmark(
except NotImplementedError:
pytest.skip("random_array not implemented for dtype")

stats.sum(arr, axis=axis) # type: ignore[arg-type] # warmup: numba compile
benchmark(stats.sum, arr, axis=axis)
def sum(arr: Array[Any], axis: int | None) -> Array[Any]: # noqa: A001
if hasattr(arr, "sum"):
return arr.sum(axis=axis)
return np.sum(arr, axis=axis) # type: ignore[arg-type]

sum(arr, axis=axis) # warmup: numba compile
benchmark(sum, arr, axis=axis)