Skip to content

Commit

Permalink
Merge pull request #85 from aradi/elementName
Browse files Browse the repository at this point in the history
Fix element name convention
  • Loading branch information
vanderhe authored May 27, 2024
2 parents 016865e + ecac7d9 commit 0b2aa17
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sktools/src/sktools/skdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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):
Expand All @@ -504,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)
Expand Down

0 comments on commit 0b2aa17

Please sign in to comment.