Opened 3 years ago

Closed 3 years ago

#20600 closed defect (fixed)

more failing tests related to cplex / gurobi

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-7.3
Component: numerical Keywords: lp
Cc: vdelecroix, dimpase, chapoton Merged in:
Authors: Matthias Koeppe Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 03da03f (Commits) Commit: 03da03fccf7fd362991c7dd14f163d33857888e9
Dependencies: #20325 Stopgaps:

Description

This is a follow-up on #20328. Apparently there are still failing tests. Not sure how I missed them when testing #20328.

egret:~/s/sage/sage-develop (t/20548/public/20548)$ sage -t --optional=sage,coin,cvxopt,cplex,gurobi src/sage/numerical/
too few successful tests, not using stored timings
Running doctests with ID 2016-05-12-17-56-33-cc004516.
Git branch: t/20548/public/20548
Using --optional=coin,cplex,cvxopt,gurobi,sage
Doctesting 43 files.
[...]
sage -t src/sage/numerical/backends/cplex_backend.pyx
**********************************************************************
File "src/sage/numerical/backends/cplex_backend.pyx", line 196, in sage.numerical.backends.cplex_backend.CPLEXBackend.add_variables
Failed example:
    p.col_name(5)              # optional - CPLEX
Expected:
    'a'
Got:
    'b'
**********************************************************************
File "src/sage/numerical/backends/cplex_backend.pyx", line 1024, in sage.numerical.backends.cplex_backend.CPLEXBackend.get_relative_objective_gap
Failed example:
    pb.get_best_objective_value()                        # optional - CPLEX
Exception raised:
    Traceback (most recent call last):
      File "/Users/mkoeppe/cvs/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 496, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/mkoeppe/cvs/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 858, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.numerical.backends.cplex_backend.CPLEXBackend.get_relative_objective_gap[7]>", line 1, in <module>
        pb.get_best_objective_value()                        # optional - CPLEX
    AttributeError: 'sage.numerical.backends.cplex_backend.CPLEXBackend' object has no attribute 'get_best_objective_value'
**********************************************************************
2 items had failures:
   1 of  11 in sage.numerical.backends.cplex_backend.CPLEXBackend.add_variables
   1 of  10 in sage.numerical.backends.cplex_backend.CPLEXBackend.get_relative_objective_gap
    [265 tests, 2 failures, 0.20 s]
[...]
sage -t src/sage/numerical/backends/gurobi_backend.pyx
**********************************************************************
File "src/sage/numerical/backends/gurobi_backend.pyx", line 45, in sage.numerical.backends.gurobi_backend.GurobiBackend
Failed example:
    TestSuite(p.get_backend()).run(skip="_test_pickling")         # optional - Gurobi
Expected nothing
Got:
    Failure in _test_add_linear_constraints:
    Traceback (most recent call last):
      File "/Users/mkoeppe/cvs/sage/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 283, in run
        test_method(tester = tester)
      File "sage/numerical/backends/generic_backend.pyx", line 556, in sage.numerical.backends.generic_backend.GenericBackend._test_add_linear_constraints (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:6154)
        p.add_linear_constraints(nrows_added, None, 2)
      File "sage/numerical/backends/generic_backend.pyx", line 509, in sage.numerical.backends.generic_backend.GenericBackend.add_linear_constraints (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:5924)
        cpdef add_linear_constraints(self, int number, lower_bound, upper_bound, names=None):
      File "sage/numerical/backends/generic_backend.pyx", line 535, in sage.numerical.backends.generic_backend.GenericBackend.add_linear_constraints (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:5809)
        raise NotImplementedError()
    NotImplementedError
    ------------------------------------------------------------
    Failure in _test_copy:
    Traceback (most recent call last):
      File "/Users/mkoeppe/cvs/sage/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 283, in run
        test_method(tester = tester)
      File "sage/numerical/backends/generic_backend.pyx", line 1129, in sage.numerical.backends.generic_backend.GenericBackend._test_copy (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:10824)
        self._do_test_problem_data(tester, cp)
      File "sage/numerical/backends/generic_backend.pyx", line 1103, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:10548)
        assert_equal_problem_data(method)
      File "sage/numerical/backends/generic_backend.pyx", line 1100, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data.assert_equal_problem_data (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:9925)
        tester.assertEqual(getattr(self, method)(), getattr(cp, method)(),
      File "/Users/mkoeppe/cvs/sage/local/lib/python/unittest/case.py", line 515, in assertEqual
        assertion_func(first, second, msg=msg)
      File "/Users/mkoeppe/cvs/sage/local/lib/python/unittest/case.py", line 508, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: problem_name does not match
    ------------------------------------------------------------
    Failure in _test_copy_does_not_share_data:
    Traceback (most recent call last):
      File "/Users/mkoeppe/cvs/sage/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 283, in run
        test_method(tester = tester)
      File "sage/numerical/backends/generic_backend.pyx", line 1139, in sage.numerical.backends.generic_backend.GenericBackend._test_copy_does_not_share_data (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:11033)
        self._do_test_problem_data(tester, cpcp)
      File "sage/numerical/backends/generic_backend.pyx", line 1103, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:10548)
        assert_equal_problem_data(method)
      File "sage/numerical/backends/generic_backend.pyx", line 1100, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data.assert_equal_problem_data (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:9925)
        tester.assertEqual(getattr(self, method)(), getattr(cp, method)(),
      File "/Users/mkoeppe/cvs/sage/local/lib/python/unittest/case.py", line 515, in assertEqual
        assertion_func(first, second, msg=msg)
      File "/Users/mkoeppe/cvs/sage/local/lib/python/unittest/case.py", line 508, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: problem_name does not match
    ------------------------------------------------------------
    Failure in _test_copy_some_mips:
    Traceback (most recent call last):
      File "/Users/mkoeppe/cvs/sage/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 283, in run
        test_method(tester = tester)
      File "sage/numerical/backends/generic_backend.pyx", line 1148, in sage.numerical.backends.generic_backend.GenericBackend._test_copy_some_mips (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:11206)
        p.add_linear_constraints(5, 0, None)
      File "sage/numerical/backends/generic_backend.pyx", line 509, in sage.numerical.backends.generic_backend.GenericBackend.add_linear_constraints (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:5924)
        cpdef add_linear_constraints(self, int number, lower_bound, upper_bound, names=None):
      File "sage/numerical/backends/generic_backend.pyx", line 535, in sage.numerical.backends.generic_backend.GenericBackend.add_linear_constraints (/Users/mkoeppe/cvs/sage/src/build/cythonized/sage/numerical/backends/generic_backend.c:5809)
        raise NotImplementedError()
    NotImplementedError
    ------------------------------------------------------------
    The following tests failed: _test_add_linear_constraints, _test_copy, _test_copy_does_not_share_data, _test_copy_some_mips
**********************************************************************
File "src/sage/numerical/backends/gurobi_backend.pyx", line 476, in sage.numerical.backends.gurobi_backend.GurobiBackend.remove_constraint
Failed example:
    p.get_values([x,y])                          # optional - Gurobi
Expected:
    [0.0, 3.0]
Got:
    [-0.0, 3.0]
**********************************************************************
File "src/sage/numerical/backends/gurobi_backend.pyx", line 511, in sage.numerical.backends.gurobi_backend.GurobiBackend.add_linear_constraint
Failed example:
    p.row(0)                                                                # optional - Gurobi
Expected:
    ([0, 1, 2, 3, 4], [0.0, 1.0, 2.0, 3.0, 4.0])
Got:
    ([1, 2, 3, 4], [1.0, 2.0, 3.0, 4.0])
**********************************************************************
File "src/sage/numerical/backends/gurobi_backend.pyx", line 581, in sage.numerical.backends.gurobi_backend.GurobiBackend.row
Failed example:
    p.row(0)                                                         # optional - Gurobi
Expected:
    ([0, 1, 2, 3, 4], [0.0, 1.0, 2.0, 3.0, 4.0])
Got:
    ([1, 2, 3, 4], [1.0, 2.0, 3.0, 4.0])
**********************************************************************
File "src/sage/numerical/backends/gurobi_backend.pyx", line 634, in sage.numerical.backends.gurobi_backend.GurobiBackend.row_bounds
Failed example:
    p.row(0)                                                          # optional - Gurobi
Expected:
    ([0, 1, 2, 3, 4], [0.0, 1.0, 2.0, 3.0, 4.0])
Got:
    ([1, 2, 3, 4], [1.0, 2.0, 3.0, 4.0])
**********************************************************************
5 items had failures:
   1 of   3 in sage.numerical.backends.gurobi_backend.GurobiBackend
   1 of   9 in sage.numerical.backends.gurobi_backend.GurobiBackend.add_linear_constraint
   1 of  12 in sage.numerical.backends.gurobi_backend.GurobiBackend.remove_constraint
   1 of   7 in sage.numerical.backends.gurobi_backend.GurobiBackend.row
   1 of   7 in sage.numerical.backends.gurobi_backend.GurobiBackend.row_bounds
    [212 tests, 5 failures, 0.23 s]
----------------------------------------------------------------------
sage -t src/sage/numerical/backends/cplex_backend.pyx  # 2 doctests failed
sage -t src/sage/numerical/backends/gurobi_backend.pyx  # 5 doctests failed
----------------------------------------------------------------------

Change History (7)

comment:1 Changed 3 years ago by mkoeppe

  • Dependencies set to #20325

comment:2 Changed 3 years ago by mkoeppe

  • Branch set to u/mkoeppe/more_failing_tests_related_to_cplex___gurobi

comment:3 Changed 3 years ago by git

  • Commit set to 03da03fccf7fd362991c7dd14f163d33857888e9

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

d061abfGenericBackend.add_linear_constraints: New
8b73e2dCoinBackend.add_linear_constraints: Remove, inherit from GenericBackend
16ed7e9CVXOPTBackend.add_linear_constraints: Remove, inherit from GenericBackend
afad991InteractiveLPBackend.add_linear_constraints: Remove, inherit from GenericBackend
941d30bGurobiBackend.add_variables: Remove, inherit from GenericBackend
987f609GenericBackend._test_add_linear_constraints: Add tests from COINBackend, CVXOPTBackend
5447320Merge branch 't/20325/genericbackend__add_default_implementation_of__add_variables__and__add_linear_constraints_' into t/20600/more_failing_tests_related_to_cplex___gurobi
938ed67_test_copy_some_mips: Fix for backends that don't have add_col
66193fePPLBackend.add_linear_constraints: Fix handling of 'names' argument
03da03fGenericBackend, CPLEXBackend: Remove test for nonexisting method get_best_objective_value

comment:4 Changed 3 years ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Status changed from new to needs_review

comment:5 Changed 3 years ago by dimpase

  • Status changed from needs_review to positive_review

looks good to me

comment:6 Changed 3 years ago by dimpase

  • Reviewers set to Dima Pasechnik

comment:7 Changed 3 years ago by vbraun

  • Branch changed from u/mkoeppe/more_failing_tests_related_to_cplex___gurobi to 03da03fccf7fd362991c7dd14f163d33857888e9
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.