From d430ca818e62aeae82f75cf3687093f1f63bf28a Mon Sep 17 00:00:00 2001 From: jrudz Date: Tue, 26 Mar 2024 15:34:22 +0100 Subject: [PATCH] fixed regex to skip lines in log with variables --- atomisticparsers/lammps/parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atomisticparsers/lammps/parser.py b/atomisticparsers/lammps/parser.py index 77c2bbd8..dea95aac 100644 --- a/atomisticparsers/lammps/parser.py +++ b/atomisticparsers/lammps/parser.py @@ -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] @@ -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,