Re: [sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Robert Bradshaw
On Mon, Feb 28, 2011 at 11:39 PM, Simon King wrote: > Hi Robert, > > On 1 Mrz., 00:15, Robert Bradshaw > wrote: >> ... >> > Namely, cached_method tries to obtain certain attributes common to >> > python functions from its argument. func_defaults is just one among >> > others. >> >> We don't have

[sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Simon King
Hi Robert, On 1 Mrz., 00:15, Robert Bradshaw wrote: > ... > > Namely, cached_method tries to obtain certain attributes common to > > python functions from its argument. func_defaults is just one among > > others. > > We don't have as much freedom here, as C-defined and python-defined > functions

Re: [sage-devel] mpmath and plot incompatibility

2011-02-28 Thread Francois Bissey
> On Mon, 28 Feb 2011 at 01:26PM -0800, jtyard wrote: > > I'm running sage 4.6.1 and cannot use plot after loading mpmath. > > Namely, running > > > > > from mpmath import * > > > plot(lambda t: sin(2*pi*t), [1, 4]) > > > > produces no output in the notebook. I'm loading mpmath because I need >

Re: [sage-devel] mpmath and plot incompatibility

2011-02-28 Thread Dan Drake
On Mon, 28 Feb 2011 at 01:26PM -0800, jtyard wrote: > I'm running sage 4.6.1 and cannot use plot after loading mpmath. > Namely, running > > > from mpmath import * > > plot(lambda t: sin(2*pi*t), [1, 4]) > > produces no output in the notebook. I'm loading mpmath because I need > to make plots of

[sage-devel] Re: mpmath and plot incompatibility

2011-02-28 Thread Jason Grout
On 2/28/11 3:26 PM, jtyard wrote: Hi, I'm running sage 4.6.1 and cannot use plot after loading mpmath. Namely, running from mpmath import * plot(lambda t: sin(2*pi*t), [1, 4]) produces no output in the notebook. I'm loading mpmath because I need to make plots of theta functions, and the pag

Re: [sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Robert Bradshaw
On Mon, Feb 28, 2011 at 2:35 PM, Simon King wrote: > Hi Robert! > > On 28 Feb., 21:00, Robert Bradshaw > wrote: >> ... >> Sorry, I forgot to mention that it must be declared as "cdef public >> object __doc__". Otherwise it doesn't create a Python-visible wrapper, >> so you're still (from Python)

[sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Simon King
Hi Robert! On 28 Feb., 21:00, Robert Bradshaw wrote: > ... > Sorry, I forgot to mention that it must be declared as "cdef public > object __doc__". Otherwise it doesn't create a Python-visible wrapper, > so you're still (from Python) accessing the class-level __doc__. So, is there a difference b

[sage-devel] mpmath and plot incompatibility

2011-02-28 Thread jtyard
Hi, I'm running sage 4.6.1 and cannot use plot after loading mpmath. Namely, running > from mpmath import * > plot(lambda t: sin(2*pi*t), [1, 4]) produces no output in the notebook. I'm loading mpmath because I need to make plots of theta functions, and the page http://mpmath.googlecode.com/sv

Re: [sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Robert Bradshaw
On Mon, Feb 28, 2011 at 11:38 AM, Simon King wrote: > Hi Robert, > > On 28 Feb., 19:56, Robert Bradshaw > wrote: >> If you add a "cdef object __doc__" member to that class, you should be >> able to assign to it. > > I am afraid this is not true. > > One is not able to assign it. __doc__ is read o

[sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Simon King
Hi Robert, On 28 Feb., 19:56, Robert Bradshaw wrote: > If you add a "cdef object __doc__" member to that class, you should be > able to assign to it. I am afraid this is not true. One is not able to assign it. __doc__ is read only, even if you define it cpdef or : sage: cython('''cdef class C:

Re: [sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Robert Bradshaw
On Mon, Feb 28, 2011 at 3:32 AM, Simon King wrote: > On 28 Feb., 12:18, Simon King wrote: >> ... >> I recall that it is impossible >> to modifiy __doc__ in Cython - could this be a related problem? > > That could very well be: cached_method is defined in sage/misc/ > cachefunc.py, whereas coerce_

[sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Simon King
On 28 Feb., 12:18, Simon King wrote: > ... > I recall that it is impossible > to modifiy __doc__ in Cython - could this be a related problem? That could very well be: cached_method is defined in sage/misc/ cachefunc.py, whereas coerce_binop is an alias for a cdef-class NamedBinopMethod from sage/

[sage-devel] Re: Documentation of prcedures with decorator

2011-02-28 Thread Simon King
Hi Marco, On 28 Feb., 11:00, mmarco wrote: > I think that it is because of the @coerce_binop decorator before the > definition of the procedure. So i wonder if it is a general problem > (that is, when you build the html documentation of a procedure which > is defined after a decorator, you get th

[sage-devel] Documentation of prcedures with decorator

2011-02-28 Thread mmarco
I have been making some patch to the .resultant() procedure in /sage/ rings/polynomial/polynomial_element.pyx, and i have noticed something strange when building the documentation. If you ask for help both in the notebook or the command line, it shows fine. But when you build the html help, what y