Skip to content

Commit

Permalink
fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
majosm committed Jun 27, 2022
1 parent 0c4be92 commit 2d78953
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions meshmode/mesh/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"""

from functools import reduce
from numbers import Real
from typing import Optional, Union, Any, Tuple, Dict, List, Set, Sequence

from dataclasses import dataclass
Expand Down Expand Up @@ -151,9 +150,10 @@ def _filter_mesh_groups(
# {{{ filter vertex indices

filtered_vertex_indices = [
mesh.groups[igrp].vertex_indices[
grp.vertex_indices[
filtered_group_elements[igrp], :]
for igrp in range(len(mesh.groups))]
for igrp, grp in enumerate(mesh.groups)
if grp.vertex_indices is not None]

filtered_vertex_indices_flat = np.concatenate([indices.ravel() for indices
in filtered_vertex_indices])
Expand Down Expand Up @@ -1322,14 +1322,14 @@ def map_mesh(mesh, f): # noqa
# {{{ affine map

def affine_map(mesh,
A: Optional[Union[Real, np.ndarray]] = None, # noqa: N803
b: Optional[Union[Real, np.ndarray]] = None):
A: Optional[Union[np.generic, np.ndarray]] = None, # noqa: N803
b: Optional[Union[np.generic, np.ndarray]] = None):
"""Apply the affine map :math:`f(x) = A x + b` to the geometry of *mesh*."""

if isinstance(A, Real):
if isinstance(A, np.generic):
A = np.diag([A] * mesh.ambient_dim) # noqa: N806

if isinstance(b, Real):
if isinstance(b, np.generic):
b = np.array([b] * mesh.ambient_dim)

if A is None and b is None:
Expand Down Expand Up @@ -1432,7 +1432,7 @@ def _get_rotation_matrix_from_angle_and_axis(theta, axis):


def rotate_mesh_around_axis(mesh, *,
theta: Real,
theta: np.generic,
axis: Optional[np.ndarray] = None):
"""Rotate the mesh by *theta* radians around the axis *axis*.
Expand Down

0 comments on commit 2d78953

Please sign in to comment.