Beispiel #1
0
def test_solver():
    """Test assignment of different solvers."""
    config = Configuration()
    config.solver = "glpk"
    assert interface_to_str(config.solver) == "glpk"
    config.solver = "glpk_exact"
    assert interface_to_str(config.solver) == "glpk_exact"
    # Restore default solver.
    config.solver = "glpk"
def test_solver():
    """Test assignment of different solvers."""
    config = Configuration()
    config.solver = "glpk"
    assert interface_to_str(config.solver) == "glpk"
    config.solver = "glpk_exact"
    assert interface_to_str(config.solver) == "glpk_exact"
    # Restore default solver.
    config.solver = "glpk"
Beispiel #3
0
def test_default_tolerance(model):
    """Verify the default solver tolerance."""
    config = Configuration()
    config.solver = "glpk"
    assert config.tolerance == 1e-07
    # Test the consistency between cobra.core.Configuration.tolerance and
    # cobra.core.Model.tolerance
    assert config.tolerance == model.tolerance
def test_default_tolerance(model):
    """Verify the default solver tolerance."""
    config = Configuration()
    config.solver = "glpk"
    assert config.tolerance == 1e-07
    # Test the consistency between cobra.core.Configuration.tolerance and
    # cobra.core.Model.tolerance
    assert config.tolerance == model.tolerance