Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unrequired assert statements for mypy #218

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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