Added function to load data for multiply MDSystem
This commit is contained in:
parent
6a7027bb34
commit
1a8134c002
@ -42,3 +42,15 @@ class MDSystem(abc.ABC):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
run(["mv", hdf5_temp_file, hdf5_file])
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user