Opened 8 years ago

Last modified 8 years ago

#15194 closed defect

properly import exceptions for MIPSolver in #12418 — at Initial Version

Reported by: dimpase Owned by:
Priority: major Milestone: sage-5.12
Component: coding theory Keywords:
Cc: ppurka Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #12418 Stopgaps:

Status badges


the exceptions are not properly imported there, and there are no doctests for them:

sage: delsarte_bound_additive_hamming_space(11,3,4,d_star=9)
NameError                                 Traceback (most recent call last)
<ipython-input-1-14fed6190a46> in <module>()
----> 1 delsarte_bound_additive_hamming_space(Integer(11),Integer(3),Integer(4),d_star=Integer(9))

/usr/local/src/sage/sage-5.12.beta4/local/lib/python2.7/site-packages/sage/misc/ in sage.misc.lazy_import.LazyImport.__call__ (sage/misc/lazy_import.c:2550)()

/usr/local/src/sage/sage-5.12.beta4/local/lib/python2.7/site-packages/sage/coding/delsarte_bounds.pyc in delsarte_bound_additive_hamming_space(n, d, q, d_star, q_base, isinteger, return_data, solver)
    261       try:
    262         bd=p.solve()
--> 263       except sage.numerical.mip.MIPSolverException, exc:
    264         print "Solver exception: ", exc, exc.args
    265         if return_data:

NameError: global name 'sage' is not defined

Attached is the patch that puts in proper imports for MIPSolver exceptions, and doctests for them.

Change History (1)

Changed 8 years ago by dimpase

the straightforward patch

Note: See TracTickets for help on using tickets.