Commit f260bf16 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

orchestration/experiment_output.py: dump formatted JSON

parent 9481133e
...@@ -70,7 +70,7 @@ class ExpOutput(object): ...@@ -70,7 +70,7 @@ class ExpOutput(object):
def dump(self, outpath: str) -> None: def dump(self, outpath: str) -> None:
pathlib.Path(outpath).parent.mkdir(parents=True, exist_ok=True) pathlib.Path(outpath).parent.mkdir(parents=True, exist_ok=True)
with open(outpath, 'w', encoding='utf-8') as file: with open(outpath, 'w', encoding='utf-8') as file:
json.dump(self.__dict__, file) json.dump(self.__dict__, file, sort_keys=True, indent=4)
def load(self, file: str) -> None: def load(self, file: str) -> None:
with open(file, 'r', encoding='utf-8') as fp: with open(file, 'r', encoding='utf-8') as fp:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment