Skip to content

Commit 772a3d4

Browse files
committed
fix mypy errors
1 parent 0c4be92 commit 772a3d4

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

meshmode/mesh/processing.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"""
2222

2323
from functools import reduce
24-
from numbers import Real
2524
from typing import Optional, Union, Any, Tuple, Dict, List, Set, Sequence
2625

2726
from dataclasses import dataclass
@@ -151,9 +150,10 @@ def _filter_mesh_groups(
151150
# {{{ filter vertex indices
152151

153152
filtered_vertex_indices = [
154-
mesh.groups[igrp].vertex_indices[
153+
grp.vertex_indices[
155154
filtered_group_elements[igrp], :]
156-
for igrp in range(len(mesh.groups))]
155+
for igrp, grp in enumerate(mesh.groups)
156+
if grp.vertex_indices is not None]
157157

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

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

1329-
if isinstance(A, Real):
1329+
if np.isscalar(A):
13301330
A = np.diag([A] * mesh.ambient_dim) # noqa: N806
13311331

1332-
if isinstance(b, Real):
1332+
if np.isscalar(b):
13331333
b = np.array([b] * mesh.ambient_dim)
13341334

13351335
if A is None and b is None:
@@ -1432,7 +1432,7 @@ def _get_rotation_matrix_from_angle_and_axis(theta, axis):
14321432

14331433

14341434
def rotate_mesh_around_axis(mesh, *,
1435-
theta: Real,
1435+
theta: np.generic,
14361436
axis: Optional[np.ndarray] = None):
14371437
"""Rotate the mesh by *theta* radians around the axis *axis*.
14381438

0 commit comments

Comments
 (0)