Commits

mattip committed b113d47

add mtrand for random module, patch ctypeslib for missing dtype.str

  • Participants
  • Parent commits 1fee8b3
  • Branches python-numpy

Comments (0)

Files changed (3)

File lib_pypy/numpy/ctypeslib.py

         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):

File lib_pypy/numpypy/__init__.py

 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
 
 import fftpack_lite
 sys.modules['fftpack_lite'] = fftpack_lite
-del _math
 
+import mtrand
+sys.modules['mtrand'] = mtrand
 
+
+
+
+

File lib_pypy/numpypy/mtrand.py

+
+'''The original mtrand in numpy is based on the randomkit c package
+'''
+
+def random_sample(*args, **kwargs):
+    raise NotImplementedError("not implemented yet")