[pypy-commit] pypy python-numpy: add mtrand for random module, patch ctypeslib for missing dtype.str
mattip
noreply at buildbot.pypy.org
Thu Aug 23 14:11:00 CEST 2012
Author: Matti Picus <matti.picus at gmail.com>
Branch: python-numpy
Changeset: r56821:b113d4778e19
Date: 2012-08-23 14:59 +0300
http://bitbucket.org/pypy/pypy/changeset/b113d4778e19/
Log: add mtrand for random module, patch ctypeslib for missing dtype.str
diff --git a/lib_pypy/numpy/ctypeslib.py b/lib_pypy/numpy/ctypeslib.py
--- a/lib_pypy/numpy/ctypeslib.py
+++ b/lib_pypy/numpy/ctypeslib.py
@@ -311,7 +311,10 @@
except AttributeError: pass
else: return
- typestr = _dtype(dtype).str
+ try:
+ typestr = _dtype(dtype).str
+ except:
+ typestr = _dtype(dtype).byteorder + _dtype(dtype).kind + '%d' % _dtype(dtype).itemsize
_typecodes[typestr] = simple_type
def __array_interface__(self):
diff --git a/lib_pypy/numpypy/__init__.py b/lib_pypy/numpypy/__init__.py
--- a/lib_pypy/numpypy/__init__.py
+++ b/lib_pypy/numpypy/__init__.py
@@ -60,6 +60,8 @@
setattr(_numpypy, 'frompyfunc', not_implemented_func)
setattr(_numpypy, 'mod', not_implemented_func)
setattr(_numpypy, 'conjugate', not_implemented_func)
+setattr(multiarray, '_flagdict', not_implemented_func)
+setattr(multiarray, 'flagsobj', not_implemented_func)
#mangle the __all__ of numpy.core so that import numpy.core.numerictypes works
from numpy import core
@@ -76,6 +78,11 @@
import fftpack_lite
sys.modules['fftpack_lite'] = fftpack_lite
-del _math
+import mtrand
+sys.modules['mtrand'] = mtrand
+
+
+
+
diff --git a/lib_pypy/numpypy/mtrand.py b/lib_pypy/numpypy/mtrand.py
new file mode 100644
--- /dev/null
+++ b/lib_pypy/numpypy/mtrand.py
@@ -0,0 +1,6 @@
+
+'''The original mtrand in numpy is based on the randomkit c package
+'''
+
+def random_sample(*args, **kwargs):
+ raise NotImplementedError("not implemented yet")
More information about the pypy-commit
mailing list