예제 #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"
예제 #2
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"
예제 #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
예제 #4
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