diff --git a/pyiron_atomistics/lammps/output.py b/pyiron_atomistics/lammps/output.py index afa94ee47..4145fa2d8 100644 --- a/pyiron_atomistics/lammps/output.py +++ b/pyiron_atomistics/lammps/output.py @@ -325,27 +325,25 @@ def _collect_output_log( with open(file_name, "r") as f: dfs = [] read_thermo = False - thermo_lines = "" for l in f: l = l.lstrip() + if l.startswith("Step"): + thermo_lines = "" + read_thermo = True + if read_thermo: if l.startswith("Loop") or l.startswith("ERROR"): read_thermo = False dfs.append( pd.read_csv(StringIO(thermo_lines), sep="\s+", engine="c") ) - continue elif l.startswith("WARNING:"): logger.warning(f"A warning was found in the log:\n{l}") - continue - thermo_lines += l - - if l.startswith("Step"): - read_thermo = True - thermo_lines += l + else: + thermo_lines += l h5_dict = { "Step": "steps", @@ -361,7 +359,7 @@ def _collect_output_log( for i in range(len(dfs)): df = dfs[i] df["LogStep"] = np.ones(len(df)) * i - df = pd.concat(dfs) + df = pd.concat(dfs, ignore_index=True) for key in df.columns[df.columns.str.startswith("f_mean")]: h5_dict[key] = key.replace("f_", "")