Skip to content

Commit

Permalink
the parser works when using many thermo_style
Browse files Browse the repository at this point in the history
before the parser was adding all the data in the same array, and parsing
the numbers with the last headers found messing up if many headers and
data columns were present in the output file.
Now, if many header are present, the old data is forgotten as soon as a
new Step ... header is found, and only the last one will be parsed in
the output. This allows to parse output from LammpsRawCalculation
with different thermo_style without errors, as the one found in
https://docs.lammps.org/compute_heat_flux.html#example-input-file
  • Loading branch information
rikigigi committed Nov 12, 2024
1 parent 44a5cf3 commit 8579a66
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/aiida_lammps/parsers/parse_raw/lammps_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def parse_outputfile(
)

if line.startswith("Step"):
_data = []
end_found = False
header_line_position = index
header_line = [
re.sub("[^a-zA-Z0-9_]", "__", entry) for entry in line.split()
Expand Down

0 comments on commit 8579a66

Please sign in to comment.