Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12691 closed enhancement (fixed)

Create a stopgap warning

Reported by: roed Owned by: jason
Priority: major Milestone: sage-5.0
Component: misc Keywords: rd2
Cc: Merged in: sage-5.0.beta10
Authors: David Roe, William Stein Reviewers: R. Andrew Ohana
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #12702 Stopgaps:

Description (last modified by ohanar)

Sometimes issues can produce mathematically incorrect results, and we should warn users of the problem. If the issue is fixed promptly then nothing more needs to be done, but sometimes tickets remain unresolved for months or years (c.f. #11358). This ticket adds a function that makes it easy to create a second ticket warning users of the problem while it's being resolved.

On trac, this functionality will be supported by the Stopgaps field. Create a new ticket that uses the stopgap function and include a link to it in the Stopgaps field in the original ticket.


Apply attachment:trac_12691-faster.patch

Attachments (2)

12691.patch (2.4 KB) - added by roed 8 years ago.
trac_12691-faster.patch (4.0 KB) - added by was 8 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 8 years ago by roed

  • Status changed from new to needs_review

Changed 8 years ago by roed

comment:2 Changed 8 years ago by jen

  • Keywords rd2 added
  • Status changed from needs_review to positive_review

Looks good.

comment:3 Changed 8 years ago by jhpalmieri

See #12702 for a followup.

comment:4 Changed 8 years ago by was

I think this code is too slow. We want it to be highly optimized so as to not have much of a performance penalty for introducing a stopgap. I'm going to attach a different patch that implements stopgaps, and is an *order of magnitude* faster than this code:

sage: timeit("sage.misc.misc.stopgap('abc', 123)", number=10^5)
100000 loops, best of 3: 2.49 µs per loop
sage: import sage.misc.stopgap
sage: timeit("sage.misc.stopgap.stopgap('abc', 123)", number=10^5)
100000 loops, best of 3: 388 ns per loop
sage: 2.49 / .388
6.41752577319588

comment:5 Changed 8 years ago by was

  • Status changed from positive_review to needs_work

comment:6 Changed 8 years ago by was

  • Status changed from needs_work to needs_review

Changed 8 years ago by was

comment:7 Changed 8 years ago by ohanar

  • Authors changed from David Roe to David Roe, William Stein
  • Reviewers set to R. Andrew Ohana
  • Status changed from needs_review to positive_review

everything looks good to me and works how I expect it to, positive review!

comment:8 Changed 8 years ago by ohanar

  • Description modified (diff)

comment:9 Changed 8 years ago by kcrisman

Just clarification; this doesn't

create a second ticket warning users of the problem

right, or even 'make it easy' to do so? It seems to function more like deprecations; it doesn't do anything, but warns users that something might be wrong. Let me know if I'm wrong about this, otherwise I hope to use it in the future.

Nice addition.

comment:10 Changed 8 years ago by jhpalmieri

kcrisman: you're right, it doesn't create a ticket or make it easy to create a ticket, but it makes it easy to print a nice warning, like a deprecation. Does the documentation at #12702 make it clearer?

comment:11 Changed 8 years ago by kcrisman

Yeah, that's great. Wish I could be helping with this, but looks like RD2 is going very well.

comment:12 Changed 8 years ago by jhpalmieri

  • Dependencies set to #12702

comment:13 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.0.beta10
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:14 Changed 8 years ago by jdemeyer

Why not display the stopgap warnings in doctests? I would prefer documentation to show the stopgap warnings. It also would allow to see which parts of Sage are affected by stopgapped tickets.

It would also prevent sillyness like

sage: 1+1
********************************************************************************
Addition of integers can sometimes return wrong results.
This issue is being tracked at http://trac.sagemath.org/sage_trac/ticket/123456.
********************************************************************************
2
Note: See TracTickets for help on using tickets.