Ticket #5997 (closed enhancement: fixed)

Opened 16 months ago

Last modified 15 months ago

[with patch, positive review] deprecate the "order" method on elements of rings.

Reported by: was Owned by: tbd
Priority: minor Milestone: sage-4.0
Component: algebra Keywords:
Cc: Author(s): John Palmieri
Report Upstream: Reviewer(s): Minh Van Nguyen
Merged in: 4.0.alpha0 Work issues:

Description

There was a vote in sage-devel in the thread entitled "order of elements in the field" to deprecate the order method on ring elements, and keep just the additive_order and multiplicative_order methods. The order method is too ambiguous in the context of rings, and does cause regular confusion.

This should be officially deprecated, and only removed after >= 6 months.

Attachments

trac_5997.patch Download (1.1 KB) - added by jhpalmieri 16 months ago.
trac_5997-reviewer.patch Download (0.6 KB) - added by mvngu 16 months ago.
reviewer patch; fix trivial typo

Change History

Changed 16 months ago by jhpalmieri

  • summary changed from deprecate the "order" method on elements of rings. to [with patch, needs review] deprecate the "order" method on elements of rings.

Here's a very simple patch.

Changed 16 months ago by mabshoff

Shouldn't this patch add a doctest while adding the deprecation warning? Otherwise it isn't obvious that the function is depreacted from looking at "order?"

Cheers,

Michael

Changed 16 months ago by jhpalmieri

Shouldn't this patch add a doctest while adding the deprecation warning?

No, I don't think so... Just kidding. Here's a new patch with a doctest.

Changed 16 months ago by jhpalmieri

Changed 16 months ago by mvngu

reviewer patch; fix trivial typo

Changed 16 months ago by mvngu

REFEREE REPORT

The patch trac_5997.patch applies OK against the "post-final" sage-3.4.2 and all doctests pass with the options -t -long. Now say we create an element in Z/12Z like so:

sage: a = Integers(12)(5)

Then both a.order() and a.additive_order() return the same result, but a.order() additionally gives a deprecation warning:

sage: a.order()
/scratch/mvngu/sage-3.4.2-sage.math-only-x86_64-Linux/local/lib/python2.5/site-packages/IPython/iplib.py:2073: DeprecationWarning: The function order is deprecated for ring elements; use additive_order or multiplicative_order instead.
  exec code_obj in self.user_global_ns, self.user_ns
12



However, there's one trivial typo in the patch. This is fixed in the reviewer patch trac_5997-reviewer.patch. Basically, I give positive review to John's patch. Only my patch needs to be reviewed.

Changed 16 months ago by mabshoff

  • summary changed from [with patch, needs review] deprecate the "order" method on elements of rings. to [with patch, positive review] deprecate the "order" method on elements of rings.

Rubber stamp. We don't need no stinkin' review for trivial review patches fixing an obvious typo ;)

Cheers,

Michael

Changed 16 months ago by mabshoff

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from sage-4.0.1 to sage-4.0

Merged both patches in Sage 4.0.alpha0.

Cheers,

Michael

Changed 15 months ago by davidloeffler

  • reviewer set to Minh Van Nguyen
  • merged set to 4.0.alpha0
  • author set to John Palmieri
Note: See TracTickets for help on using tickets.