Added function to load data for multiply MDSystem

This commit is contained in:
Sebastian Kloth 2023-11-07 10:25:29 +01:00
parent 6a7027bb34
commit 1a8134c002

View File

@ -42,3 +42,15 @@ class MDSystem(abc.ABC):
]
)
run(["mv", hdf5_temp_file, hdf5_file])
def load_and_concat_data(systems: list[MDSystem], key: str, verbose: bool = False):
data = []
for system in systems:
try:
data.append(system.load_results(key=key))
if verbose:
print(f"Load {system}")
except (FileNotFoundError, KeyError):
continue
return pd.concat(data, ignore_index=True)