Commit 5b90553c authored by Jan Dinkelbach's avatar Jan Dinkelbach

fix read_dpsim_log

parent 110b3ca8
...@@ -117,12 +117,11 @@ def read_dpsim_log(log_path): ...@@ -117,12 +117,11 @@ def read_dpsim_log(log_path):
log_file.close() log_file.close()
# Sectionize # Sectionize
log_sections = {'init':[], 'none':[], 'sysmat_stamp':[], 'sysmat_final':[], 'sourcevec_stamp':[], 'sourcevec_final':[], 'ludecomp':[]} log_sections = {'none':[], 'nodenumbers':[], 'sysmat_stamp':[], 'sysmat_final':[], 'sourcevec_stamp':[], 'sourcevec_final':[], 'ludecomp':[]}
section = 'init'
for line_pos in range(len(log_lines)): for line_pos in range(len(log_lines)):
if re.search('\[D\] Stamping .+ into system matrix:', log_lines[line_pos]): if re.search('\[D\] Stamping .+ into system matrix:', log_lines[line_pos]):
section = 'sysmat_stamp' section = 'sysmat_stamp'
elif re.search('[I] System matrix:', log_lines[line_pos]): elif re.search('\[I\] System matrix:', log_lines[line_pos]):
section = 'sysmat_final' section = 'sysmat_final'
elif re.search('\[D\] Stamping .+ into source vector:', log_lines[line_pos]): elif re.search('\[D\] Stamping .+ into source vector:', log_lines[line_pos]):
section = 'sourcevec_stamp' section = 'sourcevec_stamp'
...@@ -130,8 +129,8 @@ def read_dpsim_log(log_path): ...@@ -130,8 +129,8 @@ def read_dpsim_log(log_path):
section = 'sourcevec_final' section = 'sourcevec_final'
elif re.search('\[I\] LU decomposition:', log_lines[line_pos]): elif re.search('\[I\] LU decomposition:', log_lines[line_pos]):
section = 'ludecomp' section = 'ludecomp'
elif re.search('\[I\] Number of network simulation nodes:', log_lines[line_pos]): elif re.search('\[I\] Number of network (and virtual )?nodes:', log_lines[line_pos]):
section = 'none' section = 'nodenumbers'
elif re.search('\[I\] Added .+ to simulation.', log_lines[line_pos]): elif re.search('\[I\] Added .+ to simulation.', log_lines[line_pos]):
section = 'none' section = 'none'
elif re.search('\[I\] Initial switch status:', log_lines[line_pos]): elif re.search('\[I\] Initial switch status:', log_lines[line_pos]):
......
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