diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ef085c3..2b949ca7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: exclude: ".ipynb" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.10 + rev: v0.5.0 hooks: - id: ruff args: ["--fix"] diff --git a/sparse/numba_backend/_common.py b/sparse/numba_backend/_common.py index ac396904..19c0a563 100644 --- a/sparse/numba_backend/_common.py +++ b/sparse/numba_backend/_common.py @@ -24,9 +24,7 @@ def _is_scipy_sparse_obj(x): """ Tests if the supplied argument is a SciPy sparse object. """ - if hasattr(x, "__module__") and x.__module__.startswith("scipy.sparse"): - return True - return False + return bool(hasattr(x, "__module__") and x.__module__.startswith("scipy.sparse")) def _check_device(func):