Opened 3 years ago

Closed 3 years ago

#28756 closed defect (fixed)

py3: fix doctests with gurobi

Reported by: David Coudert Owned by:
Priority: major Milestone: sage-9.0
Component: linear programming Keywords:
Cc: Sébastien Labbé, John Palmieri, Frédéric Chapoton Merged in:
Authors: David Coudert Reviewers: Sébastien Labbé
Report Upstream: N/A Work issues:
Branch: 5c6d5fb (Commits, GitHub, GitLab) Commit: 5c6d5fb9b8702850de160bf6e11f29aaf3d2cc0e
Dependencies: Stopgaps:

Status badges

Description (last modified by Sébastien Labbé)

With sage 9.0.beta6 and gurobi, we get 17 failing doctests due to str vs bytes (TypeError: expected bytes, str found), char vs str, and the change of behavior of zip between py2 and py3 (TypeError: object of type 'zip' has no len()). Some problems were fixed in #28206, but it was apparently not enough. Try:

sage -t --long --optional=sage,optional,external src/sage/numerical/linear_functions.pyx src/sage/numerical/linear_tensor.py src/sage/numerical/linear_tensor_constraints.py  src/sage/numerical/linear_tensor_element.pyx  src/sage/numerical/mip.pyx  src/sage/numerical/backends/gurobi_backend.pyx

which gives

----------------------------------------------------------------------
sage -t src/sage/numerical/linear_functions.pyx  # 29 doctests failed
sage -t src/sage/numerical/linear_tensor.py  # 20 doctests failed
sage -t src/sage/numerical/linear_tensor_constraints.py  # 28 doctests failed
sage -t src/sage/numerical/linear_tensor_element.pyx  # 23 doctests failed
sage -t src/sage/numerical/mip.pyx  # 4 doctests failed
sage -t src/sage/numerical/backends/gurobi_backend.pyx  # 17 doctests failed
----------------------------------------------------------------------

We also fix some compilation warnings.

Change History (7)

comment:1 Changed 3 years ago by David Coudert

Branch: public/linear_programming/28756_gurobi
Commit: 5c6d5fb9b8702850de160bf6e11f29aaf3d2cc0e
Description: modified (diff)
Status: newneeds_review

New commits:

5c6d5fbtrac #28756: fix failing doctests and compilation warnings

comment:2 Changed 3 years ago by David Coudert

Cc: Sébastien Labbé John Palmieri Frédéric Chapoton added
Description: modified (diff)

if you have gurobi, your help reviewing this ticket will be appreciated ;)

comment:3 Changed 3 years ago by Sébastien Labbé

When Gurobi is the default your branch also fixes many other failures:

sage -t --optional=sage,optional,external src/sage/numerical/linear_functions.pyx src/sage/numerical/linear_tensor.py src/sage/numerical/linear_tensor_constraints.py  src/sage/numerical/linear_tensor_element.pyx  src/sage/numerical/mip.pyx

Let me update the description of the ticket.

comment:4 Changed 3 years ago by Sébastien Labbé

Description: modified (diff)

comment:5 Changed 3 years ago by Sébastien Labbé

Reviewers: Sébastien Labbé
Status: needs_reviewpositive_review

comment:6 Changed 3 years ago by David Coudert

Cool, more problems fixed than expected ;) Thank you !

comment:7 Changed 3 years ago by Volker Braun

Branch: public/linear_programming/28756_gurobi5c6d5fb9b8702850de160bf6e11f29aaf3d2cc0e
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.