From 366eefb07851a176b2c37be1faac06b929109783 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Fri, 11 Aug 2023 10:26:08 +0300 Subject: [PATCH] fix new mypy 1.5.0 errors --- meshmode/mesh/processing.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meshmode/mesh/processing.py b/meshmode/mesh/processing.py index a7e5c0792..0544216c2 100644 --- a/meshmode/mesh/processing.py +++ b/meshmode/mesh/processing.py @@ -1429,12 +1429,14 @@ def compute_new_map(old_map: AffineMap) -> AffineMap: for old_fagrp_list in mesh.facial_adjacency_groups: fagrp_list = [] for old_fagrp in old_fagrp_list: - if hasattr(old_fagrp, "aff_map"): - new_fields = {"aff_map": compute_new_map(old_fagrp.aff_map)} + if isinstance(old_fagrp, + (InteriorAdjacencyGroup, InterPartAdjacencyGroup)): + new_fagrp: FacialAdjacencyGroup = replace( + old_fagrp, aff_map=compute_new_map(old_fagrp.aff_map)) else: - new_fields = {} + new_fagrp = old_fagrp - fagrp_list.append(replace(old_fagrp, **new_fields)) + fagrp_list.append(new_fagrp) facial_adjacency_groups.append(fagrp_list) else: