1
0
Fork 0
mirror of https://github.com/Findus23/halo_comparison.git synced 2024-09-19 16:03:50 +02:00

add missing util function

This commit is contained in:
Lukas Winkler 2022-07-05 15:41:01 +02:00
parent 7d7fc65283
commit bc441fc2ad
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -29,3 +29,12 @@ def create_figure() -> Tuple[Figure, Axes]:
def read_swift_config(dir: Path):
with (dir / "used_parameters.yml").open() as f:
return yaml.safe_load(f)
def print_wall_time(dir: Path):
with(dir / "swift.log").open() as f:
last_line = f.readlines()[-1]
print(last_line)
assert "main: done. Bye." in last_line
seconds = float(last_line[1:].split("]")[0])
print(f"Runtime: {seconds / 60 / 60:.2f} hours")