Skip to content

Update documentation for numpy >=1.9 #424

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
wbinventor opened this issue Jul 27, 2015 · 5 comments
Closed

Update documentation for numpy >=1.9 #424

wbinventor opened this issue Jul 27, 2015 · 5 comments
Milestone

Comments

@wbinventor
Copy link
Contributor

I recently started using OpenMC again for the first time in a month. In the process, I've learned that PR #404 made numpy versions >=1.9 a new requirement to use the Python API. The reason is that the numpy types (e.g., numpy.int32, numpy.float64, etc.) only register themselves as Python numbers.Integral and numbers.Real datatypes starting in version 1.9 (link). Many of the check_type(...) calls in the Python API look for types of Integral and Real in places where a numpy datatype is in use (i.e., any downstream data processing from an HDF5 statepoint file). If an older version of numpy is installed, these type checks will fail since the numpy datatype(s) will not appear as Integral or Real.

Of course it would appear that the quick and easy fix is to install numpy 1.9. The default version of numpy installed with the apt-get package manager in Ubuntu 14.10 is 1.8.2, but 1.9 can be (somewhat less easily) installed with pip. However, one must first remove the older version of numpy installed with apt-get (or any other package manager), which also happens to remove any versions of scipy, matplotlib and h5py installed with apt-get. Any attempt to re-install one of these with apt-get requires one to first blacklist the old python-numpy package since apt-get will attempt to install it alongside all of these three packages. The alternative I took is to install all three of these packages using pip which is slightly more painful since it required installing some unmet dependencies myself (i.e., libhd5f).

Have any others run into this issue lately? I don't think that this is cause to change the Python API back to checking for explicit numpy datatypes, but I do think this should be reflected in the installation docs.

@paulromano
Copy link
Contributor

That is a good point -- I didn't realize that #404 made numpy 1.9 a requirement, so we should reflect that in our docs. I currently am on Ubuntu 14.10 with both the python-numpy package installed as well as numpy from pip. The former goes to /usr/lib/... and the latter goes to /usr/local/lib/.... By default, the Python interpreter picks up the latter first. What makes you say that the apt version must be removed before installing a pip version?

@wbinventor
Copy link
Contributor Author

Well for some reason, the apt-get NumPy was always chosen over the pip
version on my system. This was the case if I installed matplotlib, scipy,
or h5py using apt-get, which also installed numpy v1.8.2, which always
preceded pip's version on my system. I'll have to take a look at the
installation paths on my system but I believe they are the same as those
you cited (as of course they should be).
On Jul 30, 2015 3:47 AM, "Paul Romano" [email protected] wrote:

That is a good point -- I didn't realize that #404
#404 made numpy 1.9 a
requirement, so we should reflect that in our docs. I currently am on
Ubuntu 14.10 with both the python-numpy package installed as well as numpy
from pip. The former goes to /usr/lib/... and the latter goes to
/usr/local/lib/.... By default, the Python interpreter picks up the latter
first. What makes you say that the apt version must be removed before
installing a pip version?


Reply to this email directly or view it on GitHub
#424 (comment).

@paulromano
Copy link
Contributor

That's odd. What does sys.path give you on your system?

@paulromano
Copy link
Contributor

Oh, I see @smharper implemented a work-around for this in #425, so this may all be a moot point.

@paulromano paulromano added this to the v0.7 milestone Aug 5, 2015
@wbinventor
Copy link
Contributor Author

Closed per #425

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

No branches or pull requests

2 participants