Skip to content

Commit c704259

Browse files
committed
ignore comments update and mypy test
1 parent e28f176 commit c704259

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ envs.docs.dependency-groups = [ "doc" ]
6666
envs.docs.scripts.build = "sphinx-build -M html docs docs/_build"
6767
envs.docs.scripts.clean = "git clean -fdX docs"
6868
envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
69-
envs.hatch-test.default-args = []
69+
envs.hatch-test.default-args = [ ]
7070
envs.hatch-test.dependency-groups = [ "test-min" ]
7171
# TODO: remove scipy once https://github.com/pypa/hatch/pull/2127 is released
7272
envs.hatch-test.extra-dependencies = [ "ipykernel", "ipycytoscape", "scipy" ]
@@ -91,7 +91,7 @@ metadata.hooks.docstring-description = {}
9191
metadata.hooks.fancy-pypi-readme.content-type = "text/x-rst"
9292
metadata.hooks.fancy-pypi-readme.fragments = [ { path = "README.rst", start-after = ".. begin" } ]
9393
version.source = "vcs"
94-
version.raw-options = { local_scheme = "no-local-version" } # be able to publish dev version
94+
version.raw-options = { local_scheme = "no-local-version" } # be able to publish dev version
9595

9696
[tool.uv]
9797
override-dependencies = [ "sphinx>=9.0.1" ]
@@ -132,7 +132,7 @@ lint.per-file-ignores."typings/**/*.pyi" = [ "A002", "F403", "F405", "N801" ]
132132
lint.allowed-confusables = [ "×", "" ]
133133
lint.flake8-bugbear.extend-immutable-calls = [ "testing.fast_array_utils.Flags" ]
134134
lint.flake8-copyright.notice-rgx = "SPDX-License-Identifier: MPL-2\\.0"
135-
lint.flake8-type-checking.exempt-modules = []
135+
lint.flake8-type-checking.exempt-modules = [ ]
136136
lint.flake8-type-checking.strict = true
137137
lint.isort.known-first-party = [ "fast_array_utils" ]
138138
lint.isort.lines-after-imports = 2
@@ -179,6 +179,10 @@ implicit_reexport = true
179179
explicit_package_bases = true
180180
mypy_path = [ "$MYPY_CONFIG_FILE_DIR/typings", "$MYPY_CONFIG_FILE_DIR/src" ]
181181

182+
[[tool.mypy.overrides]]
183+
module = [ "jax", "jax.*" ]
184+
ignore_missing_imports = true
185+
182186
[tool.pyright]
183187
stubPath = "./typings"
184188
reportPrivateUsage = false

src/fast_array_utils/conv/_to_dense.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# fallback’s arg0 type has to include types of registered functions
2222
@singledispatch
2323
def to_dense_(
24-
x: CpuArray | GpuArray | DiskArray | types.DaskArray | types.sparray | types.spmatrix | types.CupySpMatrix,
24+
x: CpuArray | GpuArray | DiskArray | types.DaskArray | types.sparray | types.spmatrix | types.CupySpMatrix | types.HasArrayNamespace,
2525
/,
2626
*,
2727
order: Literal["K", "A", "C", "F"] = "K",

src/fast_array_utils/stats/_generic_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _generic_op_numpy(
5656
) -> NDArray[Any] | np.number[Any]:
5757
del keep_cupy_as_array
5858
arr = getattr(np, op)(x, axis=axis, **_dtype_kw(dtype, op))
59-
return arr.toarray() if isinstance(arr, types.CupyCOOMatrix) else arr
59+
return arr.toarray() if isinstance(arr, types.CupyCOOMatrix) else arr # type: ignore[return-value]
6060

6161

6262
@generic_op.register(types.HasArrayNamespace)

src/fast_array_utils/stats/_power.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
def power[Arr: Array](x: Arr, n: int, /, dtype: DTypeLike | None = None) -> Arr:
2222
"""Take array or matrix to a power."""
2323
# This wrapper is necessary because TypeVars can’t be used in `singledispatch` functions
24-
return _power(x, n, dtype=dtype) # type: ignore[no-any-return]
24+
return _power(x, n, dtype=dtype) # type: ignore[return-value]
2525

2626

2727
@singledispatch
2828
def _power(x: Array, n: int, /, dtype: DTypeLike | None = None) -> Array:
2929
if TYPE_CHECKING:
3030
assert not isinstance(x, types.DaskArray | types.CSBase | types.CupyCSMatrix)
31-
return x**n if dtype is None else np.power(x, n, dtype=dtype) # type: ignore[operator]
31+
return x**n if dtype is None else np.power(x, n, dtype=dtype) # type: ignore[arg-type]
3232

3333

3434
@_power.register(np.ndarray)
@@ -42,7 +42,7 @@ def _power_array_api(x: types.HasArrayNamespace, n: int, /, dtype: DTypeLike | N
4242
import array_api_compat
4343

4444
xp = array_api_compat.array_namespace(x)
45-
return xp.pow(x, n) if dtype is None else xp.pow(xp.astype(x, dtype), n)
45+
return xp.pow(x, n) if dtype is None else xp.pow(xp.astype(x, dtype), n) # type: ignore[no-any-return]
4646

4747

4848
@_power.register(types.CSBase | types.CupyCSMatrix)

0 commit comments

Comments
 (0)