I've downloaded PyPy portable version from the link https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-src.tar.bz2 and I've installed numpy for PyPy with the command pip install git+https://bitbucket.org/pypy/numpy.git
Installing was successfull, but I can't use numpy.min function like this.
>>>> numpy.min([1,2,3])
Traceback (most recent call last):
...
TypeError: expected integer, got NoneType object
so, I've run numpy.test() and the result is
FAILED (KNOWNFAIL=5, SKIP=24, errors=886, failures=152)
<nose.result.TextTestResult run=3367 errors=886 failures=152>
It seems to be unstable version of numpy that I installed. How can I get the stable version of numpy for PyPy?
Also I tried just pip install numpy (not pip install git+https://bitbucket.org/pypy/numpy.git)
However, I've faced another problem discussed in the link PIP Install Numpy throws an error "ascii codec can't decode byte 0xe2"
The answer is using apt-get for installing numpy but, this answer is just for CPython. is there a good solution for PyPy?
I just downloaded Pypy 2.4 and its numpy (via the git install). Looks like the
ufuncfunctionality has a bug or is just incomplete.but if I give it an
outattribute theseufuncversions work (sortof)But it does not return a value in the
outparameterRegular
numpywould object aboutynot being an array (or having the wrong dimensions).np.min(x)is that same asnp.core.umath.minimum.reduce(x,None,None,None), where thereducearguments are(variable, axis, dtype, out).np.core.umath.minimum.reduce(x)works fine.np.core.umath.add.accumulateworks as expected with respect to theoutargument, so the problem seems to be isolated to thereduce.If you install with git clone you get the full repository on your machine, which you can explore. That info is also available online. I'm still trying to figure out where the ufunc reduce is defined, and whether it was fully functional or not. This module is still very much in the development stage.
http://buildbot.pypy.org/numpy-status/latest.html is a numpy status table. It references a
pypy/module/micronumpydirectory. I haven't figured out how this relates to the https://bitbucket.org/pypy/numpy.git repository (on the download page). I can find theufunc.reducecode in themicronumpytree, but not in thenumpy.gittree.In
core/_methods.py,sumis defined as a call toadd.reduce.minandmaxsimilarly. Keyword parameters become positional ones.But it looks like the order of those parameters is wrong.
outis the 4th, but when I tryadd.reducedirectly, I have to make the 6th.I saw in passing that there is a
commitin themicronumpytree dealing with a wrong parameter order forreduce. That may be fixing this error.In regular
numpythesumcall is:which works fine. Apparently someone was trying to squeeze out a bit of performance by minimizing keyword parameters.
module/micronumpy/ufuncs.pydefinesreduceas: