Skip to content

Commit

Permalink
Remove unrequired assert statements for mypy (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy authored Sep 29, 2023
1 parent 2825a18 commit b359e62
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion examples/polar_cap/simons_5_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def _create_plot(ax: npt.NDArray, position: tuple[int, int], theta_max: int) ->
slepian = sleplet.slepian.SlepianPolarCap(L, np.deg2rad(theta_max))
axs = ax[position]
legend = "full" if position == LEGEND_POS else False
assert isinstance(slepian.order, np.ndarray) # noqa: S101
orders = np.abs(slepian.order[:RANKS])
labels = np.array([f"$\\pm${m}" if m != 0 else m for m in orders])
idx = np.argsort(orders)
Expand Down
6 changes: 0 additions & 6 deletions src/sleplet/meshes/_mesh_slepian_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def _integrate_region(self, rank: int) -> float:
\int\limits_{R} \dd{x}
f(x) \overline{S_{p}(x)}.
"""
assert isinstance(self.u, np.ndarray) # noqa: S101
s_p = sleplet.harmonic_methods.mesh_inverse(
self.mesh_slepian.mesh,
self.mesh_slepian.slepian_functions[rank],
Expand All @@ -72,7 +71,6 @@ def _integrate_mesh(self, rank: int) -> float:
\int\limits_{x} \dd{x}
f(x) \overline{S_{p}(x)}.
"""
assert isinstance(self.u, np.ndarray) # noqa: S101
s_p = sleplet.harmonic_methods.mesh_inverse(
self.mesh_slepian.mesh,
self.mesh_slepian.slepian_functions[rank],
Expand Down Expand Up @@ -111,10 +109,6 @@ def _detect_method(self) -> None:

def _validate_rank(self, rank: int) -> None:
"""Checks the requested rank is valid."""
assert isinstance( # noqa: S101
self.mesh_slepian.mesh.number_basis_functions,
int,
)
if not isinstance(rank, int):
raise TypeError("rank should be an integer")
if rank < 0:
Expand Down
3 changes: 0 additions & 3 deletions src/sleplet/slepian/_slepian_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def _integrate_region(self, rank: int) -> complex:
\int\limits_{R} \dd{\Omega(\omega)}
f(\omega) \overline{S_{p}(\omega)}.
"""
assert isinstance(self.mask, np.ndarray) # noqa: S101
assert isinstance(self.f, np.ndarray) # noqa: S101
s_p = ssht.inverse(
self.slepian.eigenvectors[rank],
self.L,
Expand All @@ -76,7 +74,6 @@ def _integrate_sphere(self, rank: int) -> complex:
\int\limits_{S^{2}} \dd{\Omega(\omega)}
f(\omega) \overline{S_{p}(\omega)}.
"""
assert isinstance(self.f, np.ndarray) # noqa: S101
s_p = ssht.inverse(
self.slepian.eigenvectors[rank],
self.L,
Expand Down

0 comments on commit b359e62

Please sign in to comment.