memote.suite.api
¶
Programmatically interact with the memote test suite.
Module Contents¶
Functions¶
validate_model (path) |
Validate a model structurally and optionally store results as JSON. |
test_model (model, sbml_version=None, results=False, pytest_args=None, exclusive=None, skip=None, experimental=None, solver_timeout=10) |
Test a model and optionally store results as JSON. |
snapshot_report (result, config=None, html=True) |
Generate a snapshot report from a result set and configuration. |
history_report (history, config=None, html=True) |
Test a model and save a history report. |
diff_report (diff_results, config=None, html=True) |
Generate a diff report from a result set and configuration. |
-
memote.suite.api.
validate_model
(path)[source]¶ Validate a model structurally and optionally store results as JSON.
Parameters: - path
Path to model file.
Returns: - tuple
- cobra.Model
The metabolic model under investigation.
- tuple
A tuple reporting on the SBML level, version, and FBC package version used (if any) in the SBML document.
- dict
A simple dictionary containing a list of errors and warnings.
-
memote.suite.api.
test_model
(model, sbml_version=None, results=False, pytest_args=None, exclusive=None, skip=None, experimental=None, solver_timeout=10)[source]¶ Test a model and optionally store results as JSON.
Parameters: - model : cobra.Model
The metabolic model under investigation.
- sbml_version: tuple, optional
A tuple reporting on the level, version, and FBC use of the SBML file.
- results : bool, optional
Whether to return the results in addition to the return code.
- pytest_args : list, optional
Additional arguments for the pytest suite.
- exclusive : iterable, optional
Names of test cases or modules to run and exclude all others. Takes precedence over
skip
.- skip : iterable, optional
Names of test cases or modules to skip.
- solver_timeout: int, optional
Timeout in seconds to set on the mathematical optimization solver (default 10).
Returns: - int
The return code of the pytest suite.
- memote.Result, optional
A nested dictionary structure that contains the complete test results.
-
memote.suite.api.
snapshot_report
(result, config=None, html=True)[source]¶ Generate a snapshot report from a result set and configuration.
Parameters: - result : memote.MemoteResult
Nested dictionary structure as returned from the test suite.
- config : dict, optional
The final test report configuration (default None).
- html : bool, optional
Whether to render the report as full HTML or JSON (default True).
-
memote.suite.api.
history_report
(history, config=None, html=True)[source]¶ Test a model and save a history report.
Parameters: - history : memote.HistoryManager
The manager grants access to previous results.
- config : dict, optional
The final test report configuration.
- html : bool, optional
Whether to render the report as full HTML or JSON (default True).
-
memote.suite.api.
diff_report
(diff_results, config=None, html=True)[source]¶ Generate a diff report from a result set and configuration.
Parameters: - diff_results : iterable of memote.MemoteResult
Nested dictionary structure as returned from the test suite.
- config : dict, optional
The final test report configuration (default None).
- html : bool, optional
Whether to render the report as full HTML or JSON (default True).