Commit a868aa48 authored by daniele.corallo's avatar daniele.corallo
Browse files

[334-cleanup-mpppy] lists need to be comma-seperated for parsing

parent da7e616b
Pipeline #168571 failed with stages
in 24 minutes and 53 seconds
......@@ -13,4 +13,14 @@ start program on 4 procs at Tue Aug 11 17:30:59 2020
T: ........................ 2
dt: ....................... 0.03125
Random Parsing Info:
int and float: ............ [4.0, 2, 1.3, -4]
list with spaces: ......... [ 4.0, 2, 1.3, -4]
list with other spaces: ... [ 4.0, 2, 1.3, -4 ]
Table with spaces: ........ [ 4.000000, 2.000000, 1.300000, -4.000000 ]
end program after 19.28 seconds on 4 procs at Tue Aug 11 17:31:19 2020
......@@ -35,6 +35,13 @@ class TestLogParser(TestCase):
self.assertEqual(df.loc[0, "t0"], 0)
self.assertEqual(df.loc[0, "T"], 2)
self.assertEqual(df.loc[0, "dt"], 0.03125)
self.assertEqual(df.loc[0, "int and float"], [4.0, 2.0, 1.3, -4.0])
self.assertEqual(df.loc[0, "list with spaces"], [4.0, 2.0, 1.3, -4.0])
self.assertEqual(df.loc[0, "list with other spaces"], [4.0, 2.0, 1.3, -4.0])
self.assertEqual(df.loc[0, "Table with spaces"], [4.0, 2.0, 1.3, -4.0])
self.assertEqual(df.loc[0, "Computation Time"], "19.28 seconds")
def test_time_log(self):
......
......@@ -22,7 +22,7 @@ class LogParser:
self.float_pattern = re.compile(self.float_re)
# Example: [4.0, 2, 1.3]
self.vec_pattern = re.compile(r'\[([ ]*?' + self.float_re + r'[,]?[ ]*?)+\]')
self.vec_pattern = re.compile(r'\[([ ]*?' + self.float_re + r',[ ]*?)+\]')
# Finds strings with
self.string_pattern = re.compile(self.string_re)
......@@ -32,7 +32,7 @@ class LogParser:
# Example: Mesh width: .............
self.key_vec_pattern = re.compile(self.string_re + self.dots_re + r'\[([ ]*?' +
self.float_re + r'[,]?[ ]?)+\]')
self.float_re + r',[ ]?)+\]')
# Example: Mesh Name: .................. UnitSquare
self.key_string_pattern = re.compile(self.string_re + self.dots_re +
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment