[Numpy-discussion] Ticket #798: `piecewise` exposes raw memory

Ondrej Certik ondrej@certik...
Wed May 21 15:26:23 CDT 2008


On Wed, May 21, 2008 at 11:53 AM, Ondrej Certik <ondrej@certik.cz> wrote:
> On Wed, May 21, 2008 at 11:30 AM, Stéfan van der Walt <stefan@sun.ac.za> wrote:
>> Referring to
>> http://scipy.org/scipy/numpy/ticket/798
>>
>> `piecewise` uses `empty` to allocate output memory.  If the conditions
>> do not sufficiently cover the output, then raw memory is returned,
>> e.g.,
>>
>> {{{
>> import numpy as np
>> np.piecewise([0,1,2],[True,False,False],[1])
>> }}}
>>
>> A patch which addresses the issue is available here for review:
>>
>> http://codereview.appspot.com/1105
>>
>> Documentation is being updated on the wiki.
>
> I'd like to invite everyone to take part in the review. It's fun, it's
> just talking, no coding. :)

Thanks Robert for taking part in the review:

http://codereview.appspot.com/1105/diff/22/122#newcode566

That's the way to go.

Ondrej


More information about the Numpy-discussion mailing list