IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 02445d4e authored by Remy Prechelt's avatar Remy Prechelt
Browse files

Add loading of the summary files for each output.

parent cedacf87
No related branches found
No related tags found
1 merge request!317Output infrastructure and Python analysis library.
......@@ -45,8 +45,9 @@ class Library(object):
# store the top-level path
self.path = path
# load the config file
# load the config and summary files
self.config = self.load_config(path)
self.summary = self.load_summary(path)
# build the list of outputs
self.__outputs = self.__build_outputs(path)
......@@ -101,6 +102,31 @@ class Library(object):
with open(op.join(path, "config.yaml"), "r") as f:
return yaml.load(f, Loader=yaml.Loader)
@staticmethod
def load_summary(path: str) -> Dict[str, Any]:
"""
Load the top-level summary from a given library path.
Parameters
----------
path: str
The path to the directory containing the library.
Returns
-------
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)
@staticmethod
def __valid_library(path: str) -> bool:
"""
......
......@@ -106,3 +106,27 @@ class Output(ABC):
"""
with open(op.join(path, "config.yaml"), "r") as f:
return yaml.load(f, Loader=yaml.Loader)
@staticmethod
def load_summary(path: str) -> Dict[str, Any]:
"""
Load the top-level summary from a given library path.
Parameters
----------
path: str
The path to the directory containing the library.
Returns
-------
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)
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