#28708 closed defect (fixed)

5 cplex doctests failed in cplex_backend.pyx

Reported by: slabbe Owned by:
Priority: major Milestone: sage-9.0
Component: linear programming Keywords:
Cc: Merged in:
Authors: David Coudert Reviewers: Sébastien Labbé
Report Upstream: N/A Work issues:
Branch: 48845b9 (Commits, GitHub, GitLab) Commit: 48845b928e57ce6b9016a026b954327fe8e48218
Dependencies: Stopgaps:

Status badges

Description

sage -bt --optional=sage,optional,external src/sage/numerical/backends/cplex_backend.pyx

gives

sage -t src/sage/numerical/backends/cplex_backend.pyx
**********************************************************************
File "src/sage/numerical/backends/cplex_backend.pyx", line 595, in sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint
Failed example:
    p.add_linear_constraint(zip(range(5), range(5), 2.0, 2.0)  # optional - CPLEX
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1121, in compile_and_execute
        compiled = compiler(example)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 649, in compiler
        compileflags, 1)
      File "<doctest sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint[3]>", line 1
        p.add_linear_constraint(zip(range(Integer(5)), range(Integer(5)), RealNumber('2.0'), RealNumber('2.0'))  # optional - CPLEX
                                                                                                                                  ^
    SyntaxError: unexpected EOF while parsing
**********************************************************************
File "src/sage/numerical/backends/cplex_backend.pyx", line 596, in sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint
Failed example:
    p.row(0)                                                     # optional - CPLEX
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint[4]>", line 1, in <module>
        p.row(Integer(0))                                                     # optional - CPLEX
      File "sage/numerical/backends/cplex_backend.pyx", line 671, in sage.numerical.backends.cplex_backend.CPLEXBackend.row (build/cythonized/sage/numerical/backends/cplex_backend.c:8844)
        cpdef row(self, int index):
      File "sage/numerical/backends/cplex_backend.pyx", line 710, in sage.numerical.backends.cplex_backend.CPLEXBackend.row (build/cythonized/sage/numerical/backends/cplex_backend.c:8711)
        check(status)
      File "sage/numerical/backends/cplex_backend.pyx", line 1678, in sage.numerical.backends.cplex_backend.check (build/cythonized/sage/numerical/backends/cplex_backend.c:15103)
        raise MIPSolverException("CPLEX: "+errors.get(number,default))
    MIPSolverException: CPLEX: CPXERR_INDEX_RANGE
**********************************************************************
File "src/sage/numerical/backends/cplex_backend.pyx", line 598, in sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint
Failed example:
    p.row_bounds(0)                                              # optional - CPLEX
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint[5]>", line 1, in <module>
        p.row_bounds(Integer(0))                                              # optional - CPLEX
      File "sage/numerical/backends/cplex_backend.pyx", line 721, in sage.numerical.backends.cplex_backend.CPLEXBackend.row_bounds (build/cythonized/sage/numerical/backends/cplex_backend.c:9200)
        cpdef row_bounds(self, int index):
      File "sage/numerical/backends/cplex_backend.pyx", line 752, in sage.numerical.backends.cplex_backend.CPLEXBackend.row_bounds (build/cythonized/sage/numerical/backends/cplex_backend.c:8951)
        check(status)
      File "sage/numerical/backends/cplex_backend.pyx", line 1678, in sage.numerical.backends.cplex_backend.check (build/cythonized/sage/numerical/backends/cplex_backend.c:15103)
        raise MIPSolverException("CPLEX: "+errors.get(number,default))
    MIPSolverException: CPLEX: CPXERR_INDEX_RANGE
**********************************************************************
File "src/sage/numerical/backends/cplex_backend.pyx", line 600, in sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint
Failed example:
    p.add_linear_constraint(zip(range(5), range(5), 1.0, 1.0, name='foo') # optional - CPLEX
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1121, in compile_and_execute
        compiled = compiler(example)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 649, in compiler
        compileflags, 1)
      File "<doctest sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint[6]>", line 1
        p.add_linear_constraint(zip(range(Integer(5)), range(Integer(5)), RealNumber('1.0'), RealNumber('1.0'), name='foo') # optional - CPLEX
                                                                                                                                             ^
    SyntaxError: unexpected EOF while parsing
**********************************************************************
File "src/sage/numerical/backends/cplex_backend.pyx", line 601, in sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint
Failed example:
    p.row_name(1)                                                           # optional - CPLEX
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint[7]>", line 1, in <module>
        p.row_name(Integer(1))                                                           # optional - CPLEX
      File "sage/numerical/backends/cplex_backend.pyx", line 1151, in sage.numerical.backends.cplex_backend.CPLEXBackend.row_name (build/cythonized/sage/numerical/backends/cplex_backend.c:11698)
        cpdef row_name(self, int index):
      File "sage/numerical/backends/cplex_backend.pyx", line 1177, in sage.numerical.backends.cplex_backend.CPLEXBackend.row_name (build/cythonized/sage/numerical/backends/cplex_backend.c:11606)
        check(status)
      File "sage/numerical/backends/cplex_backend.pyx", line 1678, in sage.numerical.backends.cplex_backend.check (build/cythonized/sage/numerical/backends/cplex_backend.c:15103)
        raise MIPSolverException("CPLEX: "+errors.get(number,default))
    MIPSolverException: CPLEX: CPXERR_INDEX_RANGE
**********************************************************************
1 item had failures:
   5 of   9 in sage.numerical.backends.cplex_backend.CPLEXBackend.add_linear_constraint
    [266 tests, 5 failures, 0.10 s]
----------------------------------------------------------------------
sage -t src/sage/numerical/backends/cplex_backend.pyx  # 5 doctests failed
----------------------------------------------------------------------
Total time for all tests: 0.2 seconds
    cpu time: 0.1 seconds
    cumulative wall time: 0.1 seconds
External software detected for doctesting: cplex

Change History (3)

comment:1 Changed 20 months ago by dcoudert

  • Authors set to David Coudert
  • Branch set to public/numerical/28708_fix_doctests_with_cplex
  • Commit set to 48845b928e57ce6b9016a026b954327fe8e48218
  • Status changed from new to needs_review

I don't how this has not been seen before...


New commits:

48845b9trac #28708: fix doctests

comment:2 Changed 20 months ago by slabbe

  • Reviewers set to Sébastien Labbé
  • Status changed from needs_review to positive_review

comment:3 Changed 20 months ago by vbraun

  • Branch changed from public/numerical/28708_fix_doctests_with_cplex to 48845b928e57ce6b9016a026b954327fe8e48218
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.