Exemple #1
0
def test_snapshot(model):
    """Expect the OpenAPI docs to be served at root."""
    with open(join(DATA_PATH, "store.json")) as file_handle:
        validator = Draft4Validator(json.load(file_handle))
    code, result = memote.test_model(
        model=model, results=True, pytest_args=["--tb", "no"]
    )
    assert validator.is_valid(result)
    config = memote.ReportConfiguration.load()
    report = memote.SnapshotReport(result=result, configuration=config)
    obj = report.render_json()
    assert validator.is_valid(obj)
Exemple #2
0
def model_snapshot(model):
    """Run memote on the given model and create a snapshot report."""
    configuration = cobra.Configuration()
    configuration.processes = 1
    _, result = memote.test_model(
        model,
        results=True,
        pytest_args=["-vv", "--tb", "long"],
        solver_timeout=20,
        skip=("test_inconsistent_min_stoichiometry", ),
    )
    config = memote.ReportConfiguration.load()
    report = memote.SnapshotReport(result=result, configuration=config)
    return model, report
Exemple #3
0
def model_snapshot(model):
    _, result = memote.test_model(model,
                                  results=True,
                                  pytest_args=["--tb", "no"])
    config = memote.ReportConfiguration.load()
    return memote.SnapshotReport(result=result, configuration=config)
Exemple #4
0
import cobra
import memote

model = cobra.io.read_sbml_model("/home/agustin/FBA_Tesis/H37Rv-CHROM.sbml")
result = memote.test_model(model, skip=["test_consistency"], results=True)
report = memote.snapshot_report(result[1], config=None, html=True)
with open("H37Rv-CHROM.html", "w") as handle:
    handle.write(report)