Blog Post: "How to referee Sage Trac tickets"

5 views
Skip to first unread message

William Stein

unread,
Nov 1, 2010, 1:23:55 AM11/1/10
to sage-devel
http://sagemath.blogspot.com/2010/10/how-to-referee-sage-trac-tickets.html

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Jason Grout

unread,
Nov 1, 2010, 6:30:55 AM11/1/10
to sage-...@googlegroups.com
On 11/1/10 12:23 AM, William Stein wrote:
> http://sagemath.blogspot.com/2010/10/how-to-referee-sage-trac-tickets.html
>


Nice. I'll have more comments later, but I did notice that this:

from sage.misc.misc import deprecation
deprecation("function_name is deprecated, using new_function_name instead!")


came out in formatting wrong (the second line looks like this in my
firefox (3.6.12, osx snow leopard):

deprecation("function_name is deprecated, using new

Also, you may want to put in the Sage version number to give people a
clue about when to remove the function (see the second argument to
deprecation).

Thanks,

Jason

Johan S. R. Nielsen

unread,
Nov 2, 2010, 4:03:28 AM11/2/10
to sage-devel
Very nice. Will this be put somewhere persistent where new Sage
developers can be expected to find it? E.g. as a supplement to the
Developer's Guide.

I have one comment: In the current version, sage.misc.misc.deprecation
has some steep limitations. Trac #9919 (along with #9907) fixes it so
it can be used on non-function callables (e.g. methods). Trac #9907
moves it to sage.misc.decorators.deprecation. Trac #9976 patches
Sphinx so decorated callables in general will not have their signature
reduced to a generic one in the documentation. These tracs depend on
each other in that order and they all need review (hint hint).
Especially the relocation of the decorator should perhaps be kept in
mind for the blog entry.

Cheers, Johan

On Nov 1, 11:30 am, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 11/1/10 12:23 AM, William Stein wrote:
>
> >http://sagemath.blogspot.com/2010/10/how-to-referee-sage-trac-tickets...
Message has been deleted

William Stein

unread,
Nov 2, 2010, 9:40:58 PM11/2/10
to sage-...@googlegroups.com
On Tue, Nov 2, 2010 at 1:03 AM, Johan S. R. Nielsen
<J.S.R....@mat.dtu.dk> wrote:
> Very nice. Will this be put somewhere persistent where new Sage
> developers can be expected to find it? E.g. as a supplement to the
> Developer's Guide.

I encourage somebody to add it!

Here's the raw html, if that is helpful:

http://wstein.org/edu/2010/581d/notes/2010-11-01.html

William


>
> I have one comment: In the current version, sage.misc.misc.deprecation
> has some steep limitations. Trac #9919 (along with #9907) fixes it so
> it can  be used on non-function callables (e.g. methods). Trac #9907
> moves it to sage.misc.decorators.deprecation. Trac #9976 patches
> Sphinx so decorated callables in general will not have their signature
> reduced to a generic one in the documentation. These tracs depend on
> each other in that order and they all need review (hint hint).
> Especially the relocation of the decorator should perhaps be kept in
> mind for the blog entry.
>
> Cheers, Johan
>
> On Nov 1, 11:30 am, Jason Grout <jason-s...@creativetrax.com> wrote:
>> On 11/1/10 12:23 AM, William Stein wrote:
>>
>> >http://sagemath.blogspot.com/2010/10/how-to-referee-sage-trac-tickets...
>>
>> Nice.  I'll have more comments later, but I did notice that this:
>>
>> from sage.misc.misc import deprecation
>> deprecation("function_name is deprecated, using new_function_name instead!")
>>
>> came out in formatting wrong (the second line looks like this in my
>> firefox (3.6.12, osx snow leopard):
>>
>> deprecation("function_name is deprecated, using new
>>
>> Also, you may want to put in the Sage version number to give people a
>> clue about when to remove the function (see the second argument to
>> deprecation).
>>
>> Thanks,
>>
>> Jason
>

> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org

Florent Hivert

unread,
Nov 3, 2010, 3:59:01 AM11/3/10
to sage-...@googlegroups.com
Hi there,

Actually there is a more handy tools for this precise purpose namely
deprecated_function_alias:

sage: from sage.misc.misc import deprecated_function_alias
sage: g = deprecated_function_alias(number_of_partitions,
... 'Sage Version 42.132')
sage: g(5)
doctest:...: DeprecationWarning: (Since Sage Version 42.132) g is deprecated. Please use number_of_partitions instead.
7

This also works for methods::

sage: class cls(object):
... def new_meth(self): return 42
... old_meth = deprecated_function_alias(new_meth,
... 'Sage Version 42.132')
sage: cls().old_meth()
doctest:...: DeprecationWarning: (Since Sage Version 42.132) old_meth is deprecated. Please use new_meth instead.
42

Cheers,

Florent

Johan S. R. Nielsen

unread,
Nov 5, 2010, 4:20:06 AM11/5/10
to sage-devel
On Nov 3, 8:59 am, Florent Hivert <florent.hiv...@univ-rouen.fr>
wrote:
>       Hi there,
>
>
>
> On Mon, Nov 01, 2010 at 05:30:55AM -0500, Jason Grout wrote:
> > On 11/1/10 12:23 AM, William Stein wrote:
> > >http://sagemath.blogspot.com/2010/10/how-to-referee-sage-trac-tickets...
Very nice - I wasn't aware of that decorator. I have been working with
a few things regarding decorators in Sage, so I noticed some
shortcomings with deprecated_function_alias:
1) Following Trac #9907, deprecated_function_alias should perhaps be
moved to sage.misc.decorators.
2) Without the wraps-decorator, deprecated_function_alias will seem to
swallow all introspection information on the decorated callable
(actually, sage_wraps should then be used to allow for some Sage-
specific introspection, this in turn requires Trac #9919).
3) Currently, any decorator (even one using sage_wraps) will disrupt
documentation in Sphinx. This is fixed in #9976 and requires no change
in the decorators, however.
Perhaps a Trac should be opened to fix these things under the
assumption of #9907 and #9919, but I don't have time to do it myself
right now (I'm procrastinating terribly as it is)...
Reply all
Reply to author
Forward
0 new messages