diff --git a/pyproject.toml b/pyproject.toml index 9db4655c..a22fcb95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -124,6 +124,7 @@ plugins = [ ] strict = true warn_return_any = false +warn_unreachable = true [tool.pytest.ini_options] addopts = [ diff --git a/src/sleplet/functions/slepian.py b/src/sleplet/functions/slepian.py index e5a579c1..e0d28f82 100644 --- a/src/sleplet/functions/slepian.py +++ b/src/sleplet/functions/slepian.py @@ -82,9 +82,6 @@ def _check_rank( cls, # noqa: ANN101 v: int, ) -> int: - if not isinstance(v, int): - msg = "rank should be an integer" - raise TypeError(msg) if v < 0: msg = "rank cannot be negative" raise ValueError(msg) diff --git a/src/sleplet/functions/spherical_harmonic.py b/src/sleplet/functions/spherical_harmonic.py index 8f01c6e5..998b0288 100644 --- a/src/sleplet/functions/spherical_harmonic.py +++ b/src/sleplet/functions/spherical_harmonic.py @@ -55,9 +55,6 @@ def _check_ell( v: int, info: pydantic.ValidationInfo, ) -> int: - if not isinstance(v, int): - msg = "ell should be an integer" - raise TypeError(msg) if v < 0: msg = "ell should be positive" raise ValueError(msg) @@ -72,9 +69,6 @@ def _check_m( v: int, info: pydantic.ValidationInfo, ) -> int: - if not isinstance(v, int): - msg = "m should be an integer" - raise TypeError(msg) if abs(v) > info.data["ell"]: msg = "the magnitude of m should be less than ell" raise ValueError(msg) diff --git a/src/sleplet/meshes/_mesh_slepian_decomposition.py b/src/sleplet/meshes/_mesh_slepian_decomposition.py index 3809b9f7..94160194 100644 --- a/src/sleplet/meshes/_mesh_slepian_decomposition.py +++ b/src/sleplet/meshes/_mesh_slepian_decomposition.py @@ -117,9 +117,6 @@ def _detect_method(self: typing_extensions.Self) -> None: def _validate_rank(self: typing_extensions.Self, rank: int) -> None: """Check the requested rank is valid.""" - if not isinstance(rank, int): - msg = "rank should be an integer" - raise TypeError(msg) if rank < 0: msg = "rank cannot be negative" raise ValueError(msg) diff --git a/src/sleplet/meshes/mesh_basis_functions.py b/src/sleplet/meshes/mesh_basis_functions.py index a29d46d1..1d4630ad 100644 --- a/src/sleplet/meshes/mesh_basis_functions.py +++ b/src/sleplet/meshes/mesh_basis_functions.py @@ -69,9 +69,6 @@ def _check_rank( cls, # noqa: ANN101 v: int, ) -> int: - if not isinstance(v, int): - msg = "rank should be an integer" - raise TypeError(msg) if v < 0: msg = "rank cannot be negative" raise ValueError(msg) diff --git a/src/sleplet/meshes/mesh_slepian_functions.py b/src/sleplet/meshes/mesh_slepian_functions.py index 1bd29a73..788287ed 100644 --- a/src/sleplet/meshes/mesh_slepian_functions.py +++ b/src/sleplet/meshes/mesh_slepian_functions.py @@ -71,9 +71,6 @@ def _check_rank( cls, # noqa: ANN101 v: int, ) -> int: - if not isinstance(v, int): - msg = "rank should be an integer" - raise TypeError(msg) if v < 0: msg = "rank cannot be negative" raise ValueError(msg) diff --git a/src/sleplet/slepian/_slepian_decomposition.py b/src/sleplet/slepian/_slepian_decomposition.py index ee14ed4c..79ac2948 100644 --- a/src/sleplet/slepian/_slepian_decomposition.py +++ b/src/sleplet/slepian/_slepian_decomposition.py @@ -123,9 +123,6 @@ def _detect_method(self: typing_extensions.Self) -> None: def _validate_rank(self: typing_extensions.Self, rank: int) -> None: """Check the requested rank is valid.""" - if not isinstance(rank, int): - msg = "rank should be an integer" - raise TypeError(msg) if rank < 0: msg = "rank cannot be negative" raise ValueError(msg)