[Numpy-discussion] List of function-like things with an 'out' parameter

Anne Archibald peridot.faceted at gmail.com
Wed May 28 19:26:05 EDT 2008


2008/5/28 Alan McIntyre <alan.mcintyre at gmail.com>:
> On Wed, May 28, 2008 at 3:34 PM, Charles R Harris >> I wonder if this
> is something that ought to be looked at for all
>>> functions with an "out" parameter?  ndarray.compress also had problems
>>> with array type mismatch (#789); I can't imagine that it's safe to
>>> assume only these two functions were doing it incorrectly. (Unless of
>>> course somebody has recently looked at all of them)
>>
>> I think that is an excellent idea! A good start would be to list all the
>> functions with the out parameter and then write some tests. The current
>> behavior is inconsistent and we not only need to specify the behavior, but
>> fix all the places that don't follow the rules.
>
> Here's a list of things in numpy that have an 'out' argument (and
> their arguments); I think I eliminated all the duplicated items (that
> are imported from a subpackage into one of the main packages, for
> example).  There's stuff that's missing, probably; I think the
> C-implemented functions don't have argument lists programmatically
> available so I may parse their docstrings or something, but this is a
> start.

Nice!

One noticeable absence is all the ufuncs. (Partly this is because it's
not actually called "out", or on fact anything at all; it's just the
last parameter if there are enough.) You might also check things like
objects returned by vectorize() and frompyfunc().

Does it make sense to put this list on the Wiki somewhere, so that
people who come across new things that take output parameters (however
named) can post them?

Anne



More information about the NumPy-Discussion mailing list