[Numpy-discussion] [SciPy-Dev] 1.8.0rc1

Charles R Harris charlesr.harris at gmail.com
Wed Oct 2 12:24:24 EDT 2013


On Wed, Oct 2, 2013 at 10:12 AM, Benjamin Root <ben.root at ou.edu> wrote:

>
>
>
> On Wed, Oct 2, 2013 at 11:43 AM, Charles R Harris <
> charlesr.harris at gmail.com> wrote:
>
>> Hi Stefan,
>>
>>
>> On Wed, Oct 2, 2013 at 9:29 AM, Stéfan van der Walt <stefan at sun.ac.za>wrote:
>>
>>> Hi Chuck
>>>
>>> On Tue, Oct 1, 2013 at 1:07 AM, Charles R Harris
>>> <charlesr.harris at gmail.com> wrote:
>>> >> I'll bet the skimage problems come from
>>> >> https://github.com/numpy/numpy/pull/3811. They may be doing something
>>> >> naughty...
>>> >>
>>> >
>>> > Reverting that commit fixes those skimage failures. However, there are
>>> a
>>> > number of python2.7 failures that look pretty strange.
>>>
>>> What is the exact change in behavior with that PR?  I'm trying to
>>> figure out what skimage does wrong in this case.
>>>
>>>
>> The current master, and reverted for the 1.8 release only, is stricter
>> about np.bool only taking values 0 or 1. Apparently the convolve returns
>> boolean (I haven't checked) for boolean input, and consequently the check
>> if the return value matches the number of 1 elements in the convolution
>> kernel will fail when that number is greater than one. That is why the
>> proposed fix is to view the boolean as uint8 instead. Note that
>> out=(boolean) will still cause problems.
>>
>> Chuck
>>
>>
> So, just to be clear... what would happen if I had an array of floats
> between 0 and 1 inclusive and I cast that as a boolean using astype()?
>
>
You get zeros and ones. I don't think that has changed. Of course, you can
still mess things up using views ;)

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131002/e43f83ed/attachment.html>


More information about the NumPy-Discussion mailing list