aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/manifest.py17
-rwxr-xr-xscripts/results.py17
2 files changed, 34 insertions, 0 deletions
diff --git a/scripts/manifest.py b/scripts/manifest.py
index 74e737e..37bcda4 100755
--- a/scripts/manifest.py
+++ b/scripts/manifest.py
@@ -219,6 +219,23 @@ def find_manifest(filename="manifest.yaml"):
raise FileNotFoundError("cannot found manifest file: %s" % filename)
+def get_manifest(filename="manifest.yaml"):
+ """
+ Find the manifest file and return the Manifest instance of it.
+
+ Parameters
+ ----------
+ filename : str, optional
+ Filename of the manifest file (default: ``manifest.yaml``)
+
+ Returns
+ -------
+ manifest : `~Manifest`
+ Manifest instance of the found manifest file.
+ """
+ return Manifest(find_manifest(filename))
+
+
def cmd_show(args, manifest):
"""
Default sub-command "show": Show manifest contents.
diff --git a/scripts/results.py b/scripts/results.py
index 7536e2f..1bf504e 100755
--- a/scripts/results.py
+++ b/scripts/results.py
@@ -13,6 +13,23 @@ Manage the analysis results in YAML format.
import manifest
+def get_results(filename="results.yaml"):
+ """
+ Find the results file and return the Manifest instance of it.
+
+ Parameters
+ ----------
+ filename : str, optional
+ Filename of the results file (default: ``results.yaml``)
+
+ Returns
+ -------
+ results : `~Manifest`
+ Manifest instance (i.e., results) of the found results file.
+ """
+ return manifest.get_manifest(filename)
+
+
def main(description="Manage the analysis results (YAML format)",
default_file="results.yaml"):
manifest.main(description=description, default_file=default_file)