From 9efd683f31503396901a607469a7db0dd7d3ee1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Aradi?= Date: Wed, 8 May 2024 17:23:38 +0200 Subject: [PATCH 1/2] Fix element name convention --- sktools/src/sktools/skdef.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sktools/src/sktools/skdef.py b/sktools/src/sktools/skdef.py index 22bfca39..54a7de70 100644 --- a/sktools/src/sktools/skdef.py +++ b/sktools/src/sktools/skdef.py @@ -441,8 +441,6 @@ class OnecenterParameters(sc.ClassDict): `calculator`. """ - _PATTERN_DEFAULT = re.compile(r"^([a-z:]+(?:,[a-z:]+)*)$", re.IGNORECASE) - @classmethod def fromhsd(cls, root, query): """Returns one center parameters with substituted defaults.""" @@ -492,7 +490,8 @@ class TwocenterParameters(sc.ClassDict): `calculator`. """ - _PATTERN_DEFAULT = re.compile(r"^([a-z:]+)-([a-z:]+)$", re.IGNORECASE) + _PATTERN_DEFAULT = re.compile( + r"^([a-z][a-z0-9_]*)-([a-z][a-z0-9_]*)$", re.IGNORECASE) @classmethod def fromhsd(cls, root, query): From ecac7d9e383985ef72880c169bcbd2475aeab2ae Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Wed, 22 May 2024 15:26:28 +0200 Subject: [PATCH 2/2] Fix syntax of format statement --- sktools/src/sktools/skdef.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sktools/src/sktools/skdef.py b/sktools/src/sktools/skdef.py index 54a7de70..5652cdbc 100644 --- a/sktools/src/sktools/skdef.py +++ b/sktools/src/sktools/skdef.py @@ -503,7 +503,7 @@ def fromhsd(cls, root, query): name = node.tag match = cls._PATTERN_DEFAULT.match(name) if not match: - msg = "Invalid two center interaction '{}'".name + msg = "Invalid two center interaction '{}'".format(name) raise sc.SkgenException(msg) name1, name2 = match.groups() key = min(name1, name2), max(name1, name2)