Closed kliem closed 4 years ago
Reviewer: Matthias Koeppe, ...
Tests run at https://github.com/mkoeppe/sage/actions/runs/129317169
Branch pushed to git repo; I updated commit sha1. New commits:
9427aa1 | src/sage/libs/glpk/error.pyx: Fixup doctest markup |
New test at https://github.com/mkoeppe/sage/runs/755764195
Branch pushed to git repo; I updated commit sha1. New commits:
28024ac | src/sage/libs/glpk/error.pyx: Make doctest more flexible |
New tests at https://github.com/mkoeppe/sage/actions/runs/130367945
Branch pushed to git repo; I updated commit sha1. New commits:
8acdf34 | Fixup doctest |
Passes tests now - see for example https://github.com/mkoeppe/sage/runs/756778388
I have also tested with https://github.com/mkoeppe/sage-numerical-interactive-mip (which uses some of these methods).
I would be ready to set it to positive_review
; but we need another reviewer for my (trivial) changes.
+ We install this error handler so that an error does not lead to
+ an immediate error exit of the process. Instead, we raise a
+ ``GLPKError`` for the convenience of developers.
The sage process never exited, but the error left GLPK unusable from that point forward -- for example returning nothing instead of solving subsequent problems as in the ticket description. The error handler itself is fine; it's toggling the "there was an error" bit off afterwards that's causing all this trouble.
I still think it's perverse to leave around 150 lines of code with a docstring that says "don't use this," but where we are is not even locally optimal, so let's just do it.
Replying to @orlitzky:
150 lines of code with a docstring that says "don't use this,"
... "for production".
Changed reviewer from Matthias Koeppe, ... to Matthias Koeppe, Michael Orlitzky
Thank you for doing this.
Changed branch from u/mkoeppe/ticket/29493 to 8acdf34
At the moment there are two failing doctests, when using the glpk from the system, e.g. on ubuntu eoan https://github.com/mkoeppe/sage/runs/542655821
This doctest was mentioned before in #29317 with a suggestion for a fix.
The problem is that we have doctests that rely on error-recovery behavior added by a custom patch [#20710 comment:18], which wasn't accepted by upstream. (The doctest for the patch was added in #20832.)
The present ticket fixes the failures by
glp_intopt
toglp_simplex_then_intopt
, which is more robust;CC: @jdemeyer @mkoeppe @orlitzky @jpflori @embray @sagetrac-gouezel @kiwifb @dcoudert @dimpase
Component: packages: standard
Keywords: glpk, patches
Author: Michael Orlitzky, Matthias Koeppe
Branch/Commit:
8acdf34
Reviewer: Matthias Koeppe, Michael Orlitzky
Issue created by migration from https://trac.sagemath.org/ticket/29493