parameter types for documentation
Are the appropriate parameter types for the docstrings, listed somewhere? In particular, in reviewing some docs I see both 'str' and 'string' used. Which one is correct? Chris
On Sun, Oct 25, 2009 at 12:14 AM, Christopher Burns
Are the appropriate parameter types for the docstrings, listed somewhere? In particular, in reviewing some docs I see both 'str' and 'string' used. Which one is correct?
Not all of them are listed in one place. For general advice, see the Parameters section of http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines One error on that page is {True, False}, that should be bool.
str is correct, string is not. Reason: str is the type. Partial list: str bool list tuple sequence ndarray array_like or if you can be more precise: list of str sequence of ints and for keywords, add ", optional" Cheers, Ralf
Chris _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Cool, thanks. Mind if I update the HOWTO_DOCUMENT adding in the
partial list below?
Chris
On Sat, Oct 24, 2009 at 3:19 PM, Ralf Gommers
Not all of them are listed in one place. For general advice, see the Parameters section of http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines One error on that page is {True, False}, that should be bool.
str is correct, string is not. Reason: str is the type.
Partial list: str bool list tuple sequence ndarray array_like
or if you can be more precise: list of str sequence of ints
and for keywords, add ", optional"
On Sun, Oct 25, 2009 at 12:42 AM, Christopher Burns
Cool, thanks. Mind if I update the HOWTO_DOCUMENT adding in the partial list below?
Sure, that would be useful. While you're at it, could you get rid of the {True, False}?
Cheers, Ralf
Chris
On Sat, Oct 24, 2009 at 3:19 PM, Ralf Gommers
wrote: Not all of them are listed in one place. For general advice, see the Parameters section of http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines One error on that page is {True, False}, that should be bool.
str is correct, string is not. Reason: str is the type.
Partial list: str bool list tuple sequence ndarray array_like
or if you can be more precise: list of str sequence of ints
and for keywords, add ", optional"
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Sun, Oct 25, 2009 at 1:11 AM, Christopher Burns
Done.
That section looks much better now. Except for the word "back-tics" :)
Thanks, Ralf
On Sat, Oct 24, 2009 at 3:52 PM, Ralf Gommers
wrote: Sure, that would be useful. While you're at it, could you get rid of the {True, False}?
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
One other comment (sorry I'm late chiming in): in general, for something
like "sequence of ints," usually what is really intended as viable input is
"array-like of int-likes," and indeed, in the process of confirming this for
various functions, I have found bugs where what was intended was in fact not
supported. So, though it's more work, i.e., will take more time, the ideal
scenario, IMO, when you're dealing w/ something like that, is to confirm
that the function does indeed presently support the full gamut of viable
inputs, note any strange behavior, post to the list if you're uncertain if
it's a bug, or just file a bug ticket if you are sure. And in the past,
when this has come up, I've been instructed to document the intended
behavior, not the present buggy behavior (which just reinforces the need to
file a bug report).
DG
On Sat, Oct 24, 2009 at 4:30 PM, Christopher Burns
Just committed a change to 'backticks'.
;)
On Sat, Oct 24, 2009 at 4:17 PM, Ralf Gommers
wrote: That section looks much better now. Except for the word "back-tics" :)
Thanks, Ralf
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (3)
-
Christopher Burns
-
David Goldsmith
-
Ralf Gommers