Skip to content

Commit b2e3f9b

Browse files
committed
mipy issues fix
1 parent bd08c2e commit b2e3f9b

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/fast_array_utils/conv/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ def to_dense(
7373
Dense form of ``x``
7474
7575
"""
76-
return to_dense_(x, order=order, to_cpu_memory=to_cpu_memory)
76+
return to_dense_(x, order=order, to_cpu_memory=to_cpu_memory) # type: ignore[no-any-return]

src/fast_array_utils/stats/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def is_constant(
7777
from ._is_constant import is_constant_
7878

7979
validate_axis(x.ndim, axis)
80-
return is_constant_(x, axis=axis)
80+
return is_constant_(x, axis=axis) # type: ignore[no-any-return]
8181

8282

8383
# TODO(flying-sheep): support CSDataset (TODO)
@@ -226,7 +226,7 @@ def _generic_op(
226226
assert dtype is None or op in get_args(DtypeOps), f"`dtype` is not supported for operation {op!r}"
227227

228228
validate_axis(x.ndim, axis)
229-
return generic_op(x, op, axis=axis, keep_cupy_as_array=keep_cupy_as_array, dtype=dtype)
229+
return generic_op(x, op, axis=axis, keep_cupy_as_array=keep_cupy_as_array, dtype=dtype) # type: ignore[no-any-return]
230230

231231
_generic_op.__name__ = op
232232
return cast("StatFunNoDtype | StatFunDtype", _generic_op)

src/fast_array_utils/stats/_generic_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
@singledispatch
2626
def generic_op(
27-
x: CpuArray | GpuArray | DiskArray | types.DaskArray,
27+
x: CpuArray | GpuArray | DiskArray | types.DaskArray | types.HasArrayNamespace,
2828
/,
2929
op: Ops,
3030
*,

src/fast_array_utils/stats/_power.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111

1212
if TYPE_CHECKING:
13-
from numpy.typing import Any, DTypeLike
13+
from typing import Any
14+
15+
from numpy.typing import DTypeLike
1416

1517
from fast_array_utils.typing import CpuArray, GpuArray
1618

@@ -21,7 +23,7 @@
2123
def power[Arr: Array](x: Arr, n: int, /, dtype: DTypeLike | None = None) -> Arr:
2224
"""Take array or matrix to a power."""
2325
# This wrapper is necessary because TypeVars can’t be used in `singledispatch` functions
24-
return _power(x, n, dtype=dtype) # type: ignore[return-value]
26+
return _power(x, n, dtype=dtype) # type: ignore[no-any-return]
2527

2628

2729
@singledispatch

0 commit comments

Comments
 (0)