Skip to content

Commit 0d22588

Browse files
majosminducer
authored andcommitted
fix mypy errors
1 parent 0802a4a commit 0d22588

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

meshmode/mesh/processing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ def _filter_mesh_groups(mesh, selected_elements, vertex_id_dtype):
149149
filtered_vertex_indices = [
150150
mesh.groups[i_old_grp].vertex_indices[
151151
filtered_group_elements[i_new_grp], :]
152-
for i_new_grp, i_old_grp in enumerate(new_group_to_old_group)]
152+
for i_new_grp, i_old_grp in enumerate(new_group_to_old_group)
153+
if mesh.groups[i_old_grp].vertex_indices is not None]
153154

154155
if n_new_groups > 0:
155156
filtered_vertex_indices_flat = np.concatenate([indices.ravel() for indices
@@ -1287,14 +1288,14 @@ def map_mesh(mesh, f): # noqa
12871288
# {{{ affine map
12881289

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

1294-
if isinstance(A, Real):
1295+
if A is not None and not isinstance(A, np.ndarray):
12951296
A = np.diag([A] * mesh.ambient_dim) # noqa: N806
12961297

1297-
if isinstance(b, Real):
1298+
if b is not None and not isinstance(b, np.ndarray):
12981299
b = np.array([b] * mesh.ambient_dim)
12991300

13001301
if A is None and b is None:

0 commit comments

Comments
 (0)