memote.suite.api module

Programmatically interact with the memote test suite.

memote.suite.api.test_model(model, filename=None, results=False, pytest_args=None)[source]

Test a model and optionally store results as JSON.

Parameters:

model : cobra.Model

The metabolic model under investigation.

filename : str or pathlib.Path, optional

A filename if JSON output of the results is desired.

results : bool, optional

Whether to return the results in addition to the return code.

pytest_args : list, optional

Additional arguments for the pytest suite.

Returns:

int

The return code of the pytest suite.

dict, optional

A nested dictionary structure that contains the complete test results.

memote.suite.api.basic_report(results, filename)[source]

Test a model and save a basic report.

Parameters:

results : dict

Nested dictionary structure as returned from the test suite.

filename : str or pathlib.Path

A filename for the HTML report.

memote.suite.api.diff_report()[source]

Coming soon™.

memote.suite.api.history_report(repository, directory, filename, index='hash')[source]

Test a model and save a history report.

Parameters:

repository : git.Repo, optional

An instance of the working directory git repository.

directory : str or pathlib.Path

Use the JSON files in the directory that correspond to this git branch’s commit history to generate the report.

filename : str or pathlib.Path

A filename for the HTML report.

index : {“hash”, “time”}, optional

The default horizontal axis type for all plots.