A number of the ufuncs in the reference doc are missing arguments, for example remainder(x1) Return element-wise remainder of division. mod(x1) Return element-wise remainder of division. fmod(x1) Return the element-wise remainder of division. absolute() Calculate the absolute value element-wise. rint() Round elements of the array to the nearest integer. sign() Returns an element-wise indication of the sign of a number. conj() Return the And this is true of binary ufuncs as well greater(x1) Return the truth value of (x1 > x2) element-wise. greater_equal(x1) Return the truth value of (x1 >= x2) element-wise. less(x1) Return the truth value of (x1 < x2) element-wise. less_equal(x1) Return the truth value of (x1 =< x2) element-wise. not_equal(x1) Return (x1 != x2) element-wise. equal(x1) Return (x1 == x2) element-wise. These are generated by the .. autosummary:: command, so the error probably lies there. Also, what is the easiest way to generate the reference guide for testing purposes? Can the autosummary command deal with classes that are only generated when modules are imported? I want to document the new polynomial classes but they are generated on the fly from templates. Chuck
On Sat, 14 May 2011 09:45:12 -0600, Charles R Harris wrote: [clip]
These are generated by the .. autosummary:: command, so the error probably lies there.
The problem is that the signature of these routines is written as remainder(x1, x2[, out]) and not as remainder(x1, x2, out=None) on the first line of the docstrings. The autosummary part tries to truncate the argument list if it is too long, but its parser chokes on the nonstandard syntax.
Also, what is the easiest way to generate the reference guide for testing purposes?
cd doc export PYTHONPATH=wherever-you-installed-numpy make html or just make dist
Can the autosummary command deal with classes that are only generated when modules are imported? I want to document the new polynomial classes but they are generated on the fly from templates.
Yes. Pauli
On Sat, May 14, 2011 at 10:48 AM, Pauli Virtanen <pav@iki.fi> wrote:
On Sat, 14 May 2011 09:45:12 -0600, Charles R Harris wrote: [clip]
These are generated by the .. autosummary:: command, so the error probably lies there.
The problem is that the signature of these routines is written as
remainder(x1, x2[, out])
and not as
remainder(x1, x2, out=None)
on the first line of the docstrings. The autosummary part tries to truncate the argument list if it is too long, but its parser chokes on the nonstandard syntax.
Looks like we also need to add the new keywords. There are a lot of them.
Also, what is the easiest way to generate the reference guide for testing purposes?
cd doc export PYTHONPATH=wherever-you-installed-numpy make html
or just
make dist
Thanks. <snip> Chuck
On Sat, May 14, 2011 at 10:48 AM, Pauli Virtanen <pav@iki.fi> wrote:
On Sat, 14 May 2011 09:45:12 -0600, Charles R Harris wrote: [clip]
These are generated by the .. autosummary:: command, so the error probably lies there.
The problem is that the signature of these routines is written as
remainder(x1, x2[, out])
and not as
remainder(x1, x2, out=None)
OK, the format for that part of the signature is in line 4910 in ufunc_object.c. The question is, which should we fix, the format or the autosummary? <snip> Chuck
On Sun, May 15, 2011 at 6:22 AM, Charles R Harris <charlesr.harris@gmail.com
wrote:
On Sat, May 14, 2011 at 10:48 AM, Pauli Virtanen <pav@iki.fi> wrote:
On Sat, 14 May 2011 09:45:12 -0600, Charles R Harris wrote: [clip]
These are generated by the .. autosummary:: command, so the error probably lies there.
The problem is that the signature of these routines is written as
remainder(x1, x2[, out])
and not as
remainder(x1, x2, out=None)
OK, the format for that part of the signature is in line 4910 in ufunc_object.c. The question is, which should we fix, the format or the autosummary?
The format please. That [, out] never made sense to me.
Ralf
On Sun, 15 May 2011 10:32:17 +0200, Ralf Gommers wrote:
OK, the format for that part of the signature is in line 4910 in ufunc_object.c. The question is, which should we fix, the format or the autosummary?
The format please. That [, out] never made sense to me.
The problem here is that there is no standard format for this: ceil(a, out=None) does not work, since `out` is not a keyword parameter. Anyway, I have a fix for the autosummary parser, so I think both fixing it, and making the above arguments real keyword arguments makes sense. Pauli
On Sun, May 15, 2011 at 3:35 AM, Pauli Virtanen <pav@iki.fi> wrote:
On Sun, 15 May 2011 10:32:17 +0200, Ralf Gommers wrote:
OK, the format for that part of the signature is in line 4910 in ufunc_object.c. The question is, which should we fix, the format or the autosummary?
The format please. That [, out] never made sense to me.
The problem here is that there is no standard format for this:
ceil(a, out=None)
does not work, since `out` is not a keyword parameter.
Anyway, I have a fix for the autosummary parser, so I think both fixing it, and making the above arguments real keyword arguments makes sense.
I think the formatting could be moved up into the Ufunc class in generate_umath.py or even into the ufunc docs themselves. That would make it more accessible than leaving it in the c code. Chuck
participants (3)
-
Charles R Harris
-
Pauli Virtanen
-
Ralf Gommers