#28756 closed defect (fixed)

py3: fix doctests with gurobi

Reported by: dcoudert Owned by:
Priority: major Milestone: sage-9.0
Component: linear programming Keywords:
Cc: slabbe, jhpalmieri, 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 slabbe)

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 23 months ago by dcoudert

  • Branch set to public/linear_programming/28756_gurobi
  • Commit set to 5c6d5fb9b8702850de160bf6e11f29aaf3d2cc0e
  • Description modified (diff)
  • Status changed from new to needs_review

New commits:

5c6d5fbtrac #28756: fix failing doctests and compilation warnings

comment:2 Changed 23 months ago by dcoudert

  • Cc slabbe jhpalmieri chapoton added
  • Description modified (diff)

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

comment:3 Changed 23 months ago by slabbe

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 23 months ago by slabbe

  • Description modified (diff)

comment:5 Changed 23 months ago by slabbe

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

comment:6 Changed 23 months ago by dcoudert

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

comment:7 Changed 22 months ago by vbraun

  • Branch changed from public/linear_programming/28756_gurobi to 5c6d5fb9b8702850de160bf6e11f29aaf3d2cc0e
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.