Skip to content

Relaxed stride checking in numpy 1.12 causes bottleneck unit test failures #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fmaussion opened this issue Jan 29, 2017 · 7 comments
Closed

Comments

@fmaussion
Copy link
Member

Hi, this is what reproduces the problem on my machine (linux mint):

In [1]: import numpy as np

In [2]: import bottleneck as bn

In [3]: print('numpy:', np.__version__)
numpy: 1.12.0

In [4]: print('bottleneck:', bn.__version__)
bottleneck: 1.2.0

In [5]: a = np.ones((3, 2))

In [6]: np.sum(a[:, [1]]), bn.nansum(a[:, [1]])
Out[6]: (3.0, 1.0)

In [7]: np.sum(a[:, [1]].copy()), bn.nansum(a[:, [1]].copy())
Out[7]: (3.0, 3.0)

This has been hitting the xarray test suite on debian.

Thanks!

@kwgoodman
Copy link
Collaborator

It works fine with numpy 1.11 which is what bottleneck 1.2 supports. So my guess is that you are using numpy 1.12. My second guess is that the unit test failures with numpy 1.12 is due to the change in numpy's relaxed stride checking. My third guess is that I don't understand what relaxed stride checking is. (That last one is not a guess.)

I've added your example as a unit test.

@kwgoodman kwgoodman changed the title nansum() fails to sum when given a view of an array Relaxed stride checking in numpy 1.12 causes bottleneck unit test failures Jan 29, 2017
@kwgoodman
Copy link
Collaborator

OK, I made the fix in master.

@kwgoodman kwgoodman reopened this Jan 29, 2017
@fmaussion
Copy link
Member Author

That was fast! Thanks a lot.

@kwgoodman
Copy link
Collaborator

Well, you rang the fire alarm. Thanks for reporting and thanks for a simple example.

@shoyer
Copy link
Member

shoyer commented Apr 3, 2017

Consider issuing a bug fix release including this fix? I don't think it break any NumPy 1.11 users...

@kwgoodman
Copy link
Collaborator

A bug in numpy 1.12.0 prevented me from making a bug fix release. But it should be possible now that 1.12.1 is out.

Ugh. The current blocker is here: #166.

@kwgoodman
Copy link
Collaborator

See #168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants