IAP GITLAB

Skip to content
Snippets Groups Projects
Commit b36d7513 authored by Remy Prechelt's avatar Remy Prechelt Committed by ralfulrich
Browse files

Make summary.yaml file optional for all outputs.

parent 1de042d2
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,9 @@ class Output(ABC):
"""
Load the top-level summary from a given library path.
If there is not a summary file for this output, then an
empty dictionary is returned.
Parameters
----------
path: str
......@@ -154,12 +157,11 @@ class Output(ABC):
-------
dict:
The summary as a python dictionary.
Raises
------
FileNotFoundError
If the summary file cannot be found
"""
with open(op.join(path, "summary.yaml"), "r") as f:
return yaml.load(f, Loader=yaml.Loader)
# if the summary file doesn't exist, we just an empty dict
if not op.exists(op.join(path, "summary.yaml")):
return {}
else:
with open(op.join(path, "summary.yaml"), "r") as f:
return yaml.load(f, Loader=yaml.Loader)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment