Skip to content

Commit 506c745

Browse files
committed
fix: handle bc%dir% key format in remove_higher_dimensional_keys
PR #1432 renamed bc_x%beg -> bc%x%beg. The remove_higher_dimensional_keys helper only matched the old _y/_z separator style (.+_y, y_.+), so bc%y%beg and bc%z%beg were not removed for lower-dimensional cases. Add %{dim}% substring check to cover the new compound key format.
1 parent 81fcf1d commit 506c745

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

toolchain/mfc/case_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def remove_higher_dimensional_keys(case: dict, ndims: int) -> dict:
1111
rm_keys = set()
1212
for key in case.keys():
1313
for dim in rm_dims:
14-
if any([re.match(f".+_{dim}", key), re.match(f"{dim}_.+", key), re.match(f"%{dim}", key), f"%vel({dim_ids[dim]})" in key]):
14+
if any([re.match(f".+_{dim}", key), re.match(f"{dim}_.+", key), re.match(f"%{dim}", key), f"%vel({dim_ids[dim]})" in key, f"%{dim}%" in key]):
1515
rm_keys.add(key)
1616
break
1717

0 commit comments

Comments
 (0)