Skip to content

Commit 66aa5d0

Browse files
authored
fix: adding field_X as a valid pattern (#206)
1 parent bd3b9ea commit 66aa5d0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

geos-trame/src/geos/trame/app/components/properties_checker.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright 2023-2024 TotalEnergies.
3-
# SPDX-FileContributor: Kitware
3+
# SPDX-FileContributor: Kitware, Jacques Franc
44
from typing import Any
5+
import re
56

67
from trame_client.widgets.core import AbstractElement
78
from trame_simput import get_simput_manager
@@ -65,7 +66,8 @@ def _check_field( self, field: dict, array_names: list[ str ] ) -> None:
6566
field[ "invalid_properties" ].append( attr )
6667
continue
6768
for array_name in arrays:
68-
if array_name not in array_names:
69+
pattern = re.compile( rf'^{re.escape(array_name)}(?:_\d)?$' )
70+
if all( not pattern.match( item ) for item in array_names ):
6971
field[ "invalid_properties" ].append( attr )
7072
break
7173

0 commit comments

Comments
 (0)