Opened 8 years ago

Closed 8 years ago

#15194 closed defect (fixed)

properly import exceptions for MIPSolver in #12418

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

Status badges

Description (last modified by dimpase)

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.



Attachments (1)

exception_imports.patch (1.8 KB) - added by dimpase 8 years ago.
the straightforward patch

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by dimpase

the straightforward patch

comment:1 Changed 8 years ago by dimpase

  • Cc ppurka added
  • Description modified (diff)

Purely my oversight in #12418...

comment:2 Changed 8 years ago by dimpase

  • Status changed from new to needs_review

comment:3 Changed 8 years ago by ppurka

  • Authors set to Dmitrii Pasechnik
  • Reviewers set to Punarbasu Purkayastha
  • Status changed from needs_review to positive_review

Looks good to me. Missed this in the previous ticket :-/

comment:4 Changed 8 years ago by ppurka

Not sure what is up with the patchbot. It applies and doctests just fine.

comment:5 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.12.rc0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.