Skip to content

[TestScript] Enhanced the Robustness of the VTR Flow Log Parser Script #2744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion vtr_flow/scripts/python_libs/vtr/log_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class ParsePattern:
def __init__(self, name, filename, regex_str, default_value=None):
self._name = name
self._filename = filename
self._regex = re.compile(regex_str)
# Look for the specified pattern somewhere in the line, but any characters
# can occur before and after it. Detailed in GitHub Issue #2743.
self._regex = re.compile(f'^.*{regex_str}.*$')
self._default_value = default_value

def name(self):
Expand Down
3 changes: 0 additions & 3 deletions vtr_flow/scripts/python_libs/vtr/parse_vtr_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ def parse_file_and_update_results(filename, patterns, results):

with open(filepaths[0], "r") as file:
for line in file:
while line[0] == "#":
line = line[1:]

for parse_pattern in patterns:
match = parse_pattern.regex().match(line)
if match and match.groups():
Expand Down
Loading