mattip  committed 8f80720

add document

  • Participants
  • Parent commits 3b1313f
  • Branches python-numpy

Comments (0)

Files changed (1)


+All the numpy python code has been imported into lib_pypy/numpy,
+from a random version of numpy (git version fd15162 to be exact).
+pypy has a builtin module called _numpypy that provides things like
+ndarray, dtypes, ufuncs, and binfuncs.
+The branch will be complete when it is possible to run
+pypy -c 'import numpy;numpy.test()' and most tests pass.
+The strategy for completing the branch is:
+1. Set up pypy and cpython
+2. Find missing functionality or a failing test 
+3. Fix and test
+Currently, 'import numpy' fails, since we are missing the
+c-level multiarray module.
+So what we need in the short-term is to implement a python version of
+multiarray, work has been begun and it lives in lib_pypy/numpypy/
+And in more detail:
+1a. Get a recent trunk version of numpy
+1a. Install numpy into python, for extra points use virtualenv, by running 'python install' in the numpy trunk
+1c. Get the source tree for this branch of pypy
+1d. Download a nightly build of pypy and put the binary into the source tree, preferably at pypy/translator/goal/pypy. Alternatively, translate pypy
+2a. Run 'pypy/translator/goal/pypy -c 'import numpy;numpy.test()'
+2b. Something will fail. Poke around to see what the missing function or import is supposed to do. Hint: try
+2c. Let us know you are planning to work on this, usually a note on IRC will be sufficient.
+2c. Write a test for the missing functionality. For instance, tests for multiarray live in lib_pypy/numpypy/test/ Try to think of corner cases: inappropriate arguments, missing defaults, and other wierd combination of arguments.
+3a. Try to find where numpy implemented it and stare at that till it makes sense.
+3b. Write some code
+3c. Test under pypy, python, and then think again about the tests, did you miss a corner case? Testing is done by:
+ pypy/translator/pypy lib_pypy/numpypy/test
+as well as
+ python lib_pypy/numpypy/test
+3d. Rerun 2a to make sure you accomplished what you set out to do
+3e. Commit and push your changes, if you are working on a fork let us know what you have done.