Commits

mattip  committed e86621c

add empty function definitions

  • Participants
  • Parent commits 401cb59
  • Branches python-numpy

Comments (0)

Files changed (3)

File lib_pypy/numpypy/__init__.py

 #from _numpypy import *
 #from .core import *
 
-import sys, types
+import sys
 #sys.modules.setdefault('numpy', sys.modules['numpypy'])
 
-nt = types.ModuleType('numerictype','fake numerictypes module')
-setattr(nt, 'sctypeDict',{})
 import _numpypy as umath
 import multiarray
+import numerictypes
 sys.modules['numpy.core.multiarray'] = multiarray
 sys.modules['numpy.core.umath'] = umath
 
-sys.modules['numerictypes'] = nt
-sys.modules['numpy.core.numerictypes'] = nt
+sys.modules['numerictypes'] = numerictypes
+sys.modules['numpy.core.numerictypes'] = numerictypes

File lib_pypy/numpypy/multiarray/__init__.py

     return 1
 
 def empty_like(a, dtype=None, order='K', subok=True):
-    if not hasattr(a,'dtype'):
-        a = ndarray(a)
     if dtype is None:
         dtype = a.dtype
     if order != 'K' and order != 'C':
 
 def fromfile(_file, dtype=float, count=-1, sep=''):
     raise ValueError('not implemented yet')
+
+def frombuffer(buffer, dtype=float, count=-1, offset=0):
+    raise ValueError('not implemented yet')
+
+def newbuffer(size):
+    return bytearray(size)
+
+def getbuffer(a, *args):
+    if not hasattr(a,'size'):
+        a = ndarray(a)
+    offset = 0
+    size = a.size
+    if len(args)>0:
+        offset = args[0]
+    if len(args)>1:
+        size = args[1]
+    raise ValueError('not implemented yet')
+
+def int_asbuffer(*args, **kwargs):
+    raise ValueError('not implemented yet')
+
+def _fastCopyAndTranspose(*args, **kwargs):
+    raise ValueError('not implemented yet')
+
+def set_numeric_ops(**kwargw):
+    raise ValueError('not implemented yet')
+
+def can_cast(fromtype, totype, casting = 'safe'):
+    if not isinstance(fromtype, dtype):
+        raise ValueError('improper call to can_cast')
+    if not isinstance(totype, dtype):
+        raise ValueError('improper call to can_cast')
+    if casting not in ('no', 'equiv', 'safe', 'same_kind', 'unsafe'):
+        raise ValueError('improper call to can_cast')
+    raise ValueError('not implemented yet')
+
+def promote_types(type1, type2):
+    if not isinstance(type1, dtype):
+        raise ValueError('improper call to can_cast')
+    if not isinstance(type2, dtype):
+        raise ValueError('improper call to can_cast')
+    raise ValueError('not implemented yet')
+
+def min_scalar_type(a):
+    raise ValueError('not implemented yet')
+
+def result_type(*args):
+    raise ValueError('not implemented yet')
+
+def lexsort(keys, axis=-1):
+    raise ValueError('not implemented yet')
+
+def compare_chararrays(*args, **kwargs):
+    raise ValueError('not implemented yet')
+
+def putmask(a, mask, values):
+    raise ValueError('not implemented yet')
+
+def einsum(subscripts, *operands, **kwargs):
+    #kwargs is out=None, dtype=None, order='K', casting='safe'
+    raise ValueError('not implemented yet')
+
+def inner(a,b):
+    raise ValueError('not implemented yet')
+
+def format_longfloat(*args, **kwargs):
+    raise ValueError('not implemented yet')
+
+def datetime_as_string(*args, **kwargs):
+    raise ValueError('not implemented yet')
+

File lib_pypy/numpypy/numerictypes.py

+sctypeDict = {}
+
+def sctype2char(sctype):
+    raise ValueError('not implemented yet')
+