Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 optional gurobi doctest failing #26999

Closed
seblabbe opened this issue Jan 2, 2019 · 17 comments
Closed

1 optional gurobi doctest failing #26999

seblabbe opened this issue Jan 2, 2019 · 17 comments

Comments

@seblabbe
Copy link
Contributor

seblabbe commented Jan 2, 2019

Using 8.6.beta1 with Gurobi installed and available in Sage (as explained here), the command

sage -t --optional=sage,external src/sage/numerical/backends/gurobi_backend.pyx

gives

Using --optional=external,memlimit,sage
External software to be detected: cplex,ffmpeg,graphviz,gurobi,imagemagick,internet,latex,macaulay2,magma,maple,mathematica,matlab,octave,pandoc,scilab
Doctesting 1 file.
sage -t src/sage/numerical/backends/gurobi_backend.pyx
**********************************************************************
File "src/sage/numerical/backends/gurobi_backend.pyx", line 50, 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_copy:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 296, in run
        test_method(tester = tester)
      File "sage/numerical/backends/generic_backend.pyx", line 1255, in sage.numerical.backends.generic_backend.GenericBackend._test_copy (build/cythonized/sage/numerical/backends/generic_backend.c:14740)
        self._do_test_problem_data(tester, cp)
      File "sage/numerical/backends/generic_backend.pyx", line 1229, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data (build/cythonized/sage/numerical/backends/generic_backend.c:14457)
        assert_equal_problem_data(method)
      File "sage/numerical/backends/generic_backend.pyx", line 1226, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data.assert_equal_problem_data (build/cythonized/sage/numerical/backends/generic_backend.c:13727)
        tester.assertEqual(getattr(self, method)(), getattr(cp, method)(),
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/unittest/case.py", line 513, in assertEqual
        assertion_func(first, second, msg=msg)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/unittest/case.py", line 506, 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 "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/misc/sage_unittest.py", line 296, in run
        test_method(tester = tester)
      File "sage/numerical/backends/generic_backend.pyx", line 1265, in sage.numerical.backends.generic_backend.GenericBackend._test_copy_does_not_share_data (build/cythonized/sage/numerical/backends/generic_backend.c:14947)
        self._do_test_problem_data(tester, cpcp)
      File "sage/numerical/backends/generic_backend.pyx", line 1229, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data (build/cythonized/sage/numerical/backends/generic_backend.c:14457)
        assert_equal_problem_data(method)
      File "sage/numerical/backends/generic_backend.pyx", line 1226, in sage.numerical.backends.generic_backend.GenericBackend._do_test_problem_data.assert_equal_problem_data (build/cythonized/sage/numerical/backends/generic_backend.c:13727)
        tester.assertEqual(getattr(self, method)(), getattr(cp, method)(),
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/unittest/case.py", line 513, in assertEqual
        assertion_func(first, second, msg=msg)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/unittest/case.py", line 506, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: problem_name does not match
    ------------------------------------------------------------
    The following tests failed: _test_copy, _test_copy_does_not_share_data
**********************************************************************
1 item had failures:
   1 of   3 in sage.numerical.backends.gurobi_backend.GurobiBackend
    [207 tests, 1 failure, 0.14 s]
----------------------------------------------------------------------
sage -t src/sage/numerical/backends/gurobi_backend.pyx  # 1 doctest 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: gurobi

Component: linear programming

Author: Erik Bray

Branch/Commit: 8cd23e4

Reviewer: Sébastien Labbé

Issue created by migration from https://trac.sagemath.org/ticket/26999

@seblabbe seblabbe added this to the sage-8.6 milestone Jan 2, 2019
@seblabbe
Copy link
Contributor Author

seblabbe commented Jan 3, 2019

comment:1

This failure was first seen in 8.6.beta0 and was not present in 8.5.beta5. Looking at what was merged in 8.5.beta6 and 8.6.beta0, the first natural hypothesis would be that this failure was introduced in #24740 merged in 8.6.beta0.

@seblabbe

This comment has been minimized.

@seblabbe

This comment has been minimized.

@embray
Copy link
Contributor

embray commented Jan 3, 2019

comment:4

Probably so; I don't think we've tested against all optional packages (though perhaps that's just something I'm going to start doing, at least with all the optional packages I can successfully install on a give platform...).

@embray embray self-assigned this Jan 3, 2019
@embray
Copy link
Contributor

embray commented Jan 3, 2019

comment:5

I see now; this is not even an optional package, but an external dependency of proprietary software :( Nevertheless, the issue seems straightforward...

@embray
Copy link
Contributor

embray commented Jan 3, 2019

comment:6

On second thought, looking at the relevant code changes, it's not at all clear what would have changed to result in this difference, especially on Python 2. It's possible #24740 is not even related.

It would help if you could do some examples manually, since the output from the test suite is not very helpful (it would be better if it showed the actual difference).

What does it show if you do:

sage: from copy import copy
sage: p = MixedIntegerLinearProgram(solver="Gurobi")
sage: b = p.get_backend()
sage: b.problem_name()
???
sage: b2 = copy(b)
sage: b2.problem_name()
???

That seems to be the test this is doing, though I'm not positive if that's all that's needed to reproduce the failure, and without access to Gurobi I can't easily debug it :(

@seblabbe
Copy link
Contributor Author

seblabbe commented Jan 4, 2019

comment:7

I have access to two machines with Gurobi installed, one running 8.5.beta4 and the other running 8.6.rc0:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.5.beta4, Release Date: 2018-11-18               │
│ Using Python 2.7.15. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage: from copy import copy
sage: p = MixedIntegerLinearProgram(solver="Gurobi")
sage: b = p.get_backend()
sage: b.problem_name()
''
sage: b2 = copy(b)
sage: b2.problem_name()
''
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.6.rc0, Release Date: 2019-01-03                 │
│ Using Python 2.7.15. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage: from copy import copy
sage: p = MixedIntegerLinearProgram(solver="Gurobi")
sage: b = p.get_backend()
sage: b.problem_name()
''
sage: b2 = copy(b)
sage: b2.problem_name()
'(null)_copy'

@seblabbe
Copy link
Contributor Author

seblabbe commented Jan 4, 2019

comment:8

Replying to @embray:

I see now; this is not even an optional package, but an external dependency of proprietary software :(

"For University Users: If you are a student, faculty, or staff member at a recognized degree-granting institution, you may be eligible for a free, full-featured, no-size limit, academic version of Gurobi."

Source: http://www.gurobi.com/academia/academia-center

@embray
Copy link
Contributor

embray commented Jan 4, 2019

comment:9

Thanks--all of the above is useful info.

@embray
Copy link
Contributor

embray commented Jan 4, 2019

comment:10

I haven't tested, but this should fix it. (You were right of course by it being introduced by #24740; not surprising though the reason was a bit subtle.)


New commits:

8cd23e4Trac #26999: fix GurobiBackend.problem_name()

@embray
Copy link
Contributor

embray commented Jan 4, 2019

Author: Erik Bray

@embray
Copy link
Contributor

embray commented Jan 4, 2019

Branch: u/embray/ticket-26999

@embray
Copy link
Contributor

embray commented Jan 4, 2019

Commit: 8cd23e4

@seblabbe
Copy link
Contributor Author

seblabbe commented Jan 4, 2019

comment:11

It fixes the issue.

@seblabbe
Copy link
Contributor Author

seblabbe commented Jan 4, 2019

Reviewer: Sébastien Labbé

@embray
Copy link
Contributor

embray commented Jan 15, 2019

comment:12

Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist.

@embray embray modified the milestones: sage-8.6, sage-8.7 Jan 15, 2019
@vbraun
Copy link
Member

vbraun commented Jan 22, 2019

Changed branch from u/embray/ticket-26999 to 8cd23e4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants