Skip to content

Commit

Permalink
fixed regex to skip lines in log with variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudz committed Mar 26, 2024
1 parent bf24430 commit d430ca8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion atomisticparsers/lammps/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ def __init__(self):

def init_quantities(self):
def str_op(val):
if "${" in val:
return None
val = val.split("#")[0]
val = val.replace("&\n", " ").split()
val = val if len(val) > 1 else val[0]
Expand All @@ -666,7 +668,7 @@ def str_op(val):
self._quantities = [
Quantity(
name,
r"\n\s*%s\s+([\w\. \/\#\-]+)(\&\n[\w\. \/\#\-]*)*" % name,
r"\n\s*%s\s+(?!.*\$\{)([${}\w\. \/\#\-]+)(\&\n[\w\. \/\#\-]*)*" % name,
str_operation=str_op,
comment="#",
repeats=True,
Expand Down

0 comments on commit d430ca8

Please sign in to comment.