Source

pypy / pypy / module / micronumpy / __init__.py

Full commit
Alex Gaynor 1b189fc 
Maciej Fijalkows… ae38962 
Alex Gaynor 2a49d4e 
Alex Gaynor 9b76d83 


Maciej Fijalkows… a8481f7 
Maciej Fijalkows… 50fcaa0 
Alex Gaynor 9b76d83 


Maciej Fijalkows… ae38962 
Maciej Fijalkows… be18c01 
Alex Gaynor 1b189fc 
Alex Gaynor 9b76d83 



Maciej Fijalkows… ae38962 
Alex Gaynor 55386ad 
Alex Gaynor 2322508 
Alex Gaynor c3db364 
Alex Gaynor 2322508 
Alex Gaynor 55386ad 
Alex Gaynor 1b189fc 
MostAwesomeDude 4aa3956 
Alex Gaynor 0ab53e4 
Maciej Fijalkows… 9318155 
Maciej Fijalkows… 65b3eb1 
Alex Gaynor 2483076 
Maciej Fijalkows… 24f7e35 
Maciej Fijalkows… 8d9c1bd 
Maciej Fijalkows… 5da12de 
Maciej Fijalkows… 257a319 
Alex Gaynor 1847537 
Maciej Fijalkows… 616ba3d 
Alex Gaynor b15db18 
Maciej Fijalkows… f53826f 

Alex Gaynor 7578bf6 

Alex Gaynor 9e74aaa 
Maciej Fijalkows… 040a65b 

Alex Gaynor 9e74aaa 



Alex Gaynor 716c084 
Alex Gaynor 64e5eaa 
Maciej Fijalkows… 25d1652 
Alex Gaynor 9e74aaa 
Maciej Fijalkows… 25d1652 
Alex Gaynor 716c084 
Maciej Fijalkows… e275565 
Alex Gaynor f1d05c0 
Maciej Fijalkows… 25d1652 
Alex Gaynor 716c084 
Maciej Fijalkows… e275565 
Alex Gaynor f1d05c0 
Maciej Fijalkows… e275565 
Alex Gaynor 716c084 
Maciej Fijalkows… e275565 
Alex Gaynor b443d8b 
Alex Gaynor 716c084 
Maciej Fijalkows… b91d1bd 

Alex Gaynor d7a04dc 
Alex Gaynor 64e5eaa 

Maciej Fijalkows… c14c527 
Alex Gaynor 24a17a8 
Alex Gaynor 64e5eaa 
Maciej Fijalkows… 6f8ec88 
Maciej Fijalkows… e275565 
Maciej Fijalkows… a3f0a90 
Maciej Fijalkows… 80adf83 


Maciej Fijalkows… a3f0a90 
Alex Gaynor 2a49d4e 
Alex Gaynor 1b189fc 
Alex Gaynor 2a49d4e 







Taavi Burns e903788 
Amaury Forgeot d… 0f03693 
Alex Gaynor 7eb1a79 
Alex Gaynor 755ade3 
Alex Gaynor 2a49d4e 

Amaury Forgeot d… 41b77bb 
Alex Gaynor 2a49d4e 
Maciej Fijalkows… a045db5 
Alex Gaynor 618b0bb 
Alex Gaynor 2a49d4e 
Taavi Burns 0dbdb7b 

Alex Gaynor 2a49d4e 
Taavi Burns 3fff4b2 

Taavi Burns 3174a08 
Alex Gaynor 2a49d4e 
mattip f57dcc7 
Taavi Burns 68288dd 
Alex Gaynor 618b0bb 



Alex Gaynor 2a49d4e 



Alex Gaynor 618b0bb 
Neil Blakey-Miln… 5051a26 


Taavi Burns 9dc6857 
Alex Gaynor 2a49d4e 

Taavi Burns 71971e6 
Alex Gaynor 2a49d4e 
Amaury Forgeot d… 41b77bb 
Alex Gaynor 2a49d4e 
Maciej Fijalkows… ad86736 
Taavi Burns 128dd4b 
Alex Gaynor 2a49d4e 
Amaury Forgeot d… 41b77bb 
Maciej Fijalkows… 35596eb 

Alex Gaynor 402f6ef 
Maciej Fijalkows… 6a5df76 
Taavi Burns 24b6c8a 

Taavi Burns 348c30d 
Maciej Fijalkows… 200be74 

Taavi Burns 9f1ca75 

Taavi Burns 012a53b 
Maciej Fijalkows… 0d51aa8 



Taavi Burns bfea598 



Neil Blakey-Miln… 2242a6b 
Neil Blakey-Miln… 5b3e480 
Taavi Burns 36652d6 

Alex Gaynor 2a49d4e 

Maciej Fijalkows… ae38962 
Alex Gaynor 117991c 
Alex Gaynor 549f847 
Jeff Terrace d4d7f06 

Jeff Terrace 2ff54fe 
Jasper Schulz b145fd6 
Jeff Terrace d4d7f06 
mattip d306832 
Anders Lehmann 8d399fa 
Alex Gaynor 117991c 
from pypy.interpreter.mixedmodule import MixedModule


class PyPyModule(MixedModule):
    interpleveldefs = {
        'debug_repr': 'interp_extras.debug_repr',
        'remove_invalidates': 'interp_extras.remove_invalidates',
        'set_invalidation': 'interp_extras.set_invalidation',
    }
    appleveldefs = {}

class Module(MixedModule):
    applevel_name = '_numpypy'

    submodules = {
        'pypy': PyPyModule
    }

    interpleveldefs = {
        'ndarray': 'interp_numarray.W_NDimArray',
        'dtype': 'interp_dtype.W_Dtype',
        'ufunc': 'interp_ufuncs.W_Ufunc',

        'array': 'interp_numarray.array',
        'zeros': 'interp_numarray.zeros',
        'empty': 'interp_numarray.zeros',
        'ones': 'interp_numarray.ones',
        'dot': 'interp_numarray.dot',
        'fromstring': 'interp_support.fromstring',
        'flatiter': 'interp_numarray.W_FlatIterator',
        'isna': 'interp_numarray.isna',
        'concatenate': 'interp_numarray.concatenate',
        'repeat': 'interp_numarray.repeat',
        'where': 'interp_arrayops.where',

        'set_string_function': 'appbridge.set_string_function',

        'count_reduce_items': 'interp_numarray.count_reduce_items',

        'True_': 'types.Bool.True',
        'False_': 'types.Bool.False',

        'typeinfo': 'interp_dtype.get_dtype_cache(space).w_typeinfo',

        'generic': 'interp_boxes.W_GenericBox',
        'number': 'interp_boxes.W_NumberBox',
        'integer': 'interp_boxes.W_IntegerBox',
        'signedinteger': 'interp_boxes.W_SignedIntegerBox',
        'unsignedinteger': 'interp_boxes.W_UnsignedIntegerBox',
        'bool_': 'interp_boxes.W_BoolBox',
        'bool8': 'interp_boxes.W_BoolBox',
        'int8': 'interp_boxes.W_Int8Box',
        'byte': 'interp_boxes.W_Int8Box',
        'uint8': 'interp_boxes.W_UInt8Box',
        'ubyte': 'interp_boxes.W_UInt8Box',
        'int16': 'interp_boxes.W_Int16Box',
        'short': 'interp_boxes.W_Int16Box',
        'uint16': 'interp_boxes.W_UInt16Box',
        'ushort': 'interp_boxes.W_UInt16Box',
        'int32': 'interp_boxes.W_Int32Box',
        'intc': 'interp_boxes.W_Int32Box',
        'uint32': 'interp_boxes.W_UInt32Box',
        'uintc': 'interp_boxes.W_UInt32Box',
        'int64': 'interp_boxes.W_Int64Box',
        'uint64': 'interp_boxes.W_UInt64Box',
        'longlong': 'interp_boxes.W_LongLongBox',
        'ulonglong': 'interp_boxes.W_ULongLongBox',
        'int_': 'interp_boxes.W_LongBox',
        'inexact': 'interp_boxes.W_InexactBox',
        'floating': 'interp_boxes.W_FloatingBox',
        'float_': 'interp_boxes.W_Float64Box',
        'float32': 'interp_boxes.W_Float32Box',
        'float64': 'interp_boxes.W_Float64Box',
        'intp': 'types.IntP.BoxType',
        'uintp': 'types.UIntP.BoxType',
        'flexible': 'interp_boxes.W_FlexibleBox',
        'character': 'interp_boxes.W_CharacterBox',
        'str_': 'interp_boxes.W_StringBox',
        'unicode_': 'interp_boxes.W_UnicodeBox',
        'void': 'interp_boxes.W_VoidBox',
    }

    # ufuncs
    for exposed, impl in [
        ("abs", "absolute"),
        ("absolute", "absolute"),
        ("add", "add"),
        ("arccos", "arccos"),
        ("arcsin", "arcsin"),
        ("arctan", "arctan"),
        ("arctan2", "arctan2"),
        ("arccosh", "arccosh"),
        ("arcsinh", "arcsinh"),
        ("arctanh", "arctanh"),
        ("copysign", "copysign"),
        ("cos", "cos"),
        ("cosh", "cosh"),
        ("divide", "divide"),
        ("true_divide", "true_divide"),
        ("equal", "equal"),
        ("exp", "exp"),
        ("exp2", "exp2"),
        ("expm1", "expm1"),
        ("fabs", "fabs"),
        ("fmax", "fmax"),
        ("fmin", "fmin"),
        ("fmod", "fmod"),
        ("floor", "floor"),
        ("ceil", "ceil"),
        ("trunc", "trunc"),
        ("greater", "greater"),
        ("greater_equal", "greater_equal"),
        ("less", "less"),
        ("less_equal", "less_equal"),
        ("maximum", "maximum"),
        ("minimum", "minimum"),
        ("multiply", "multiply"),
        ("negative", "negative"),
        ("not_equal", "not_equal"),
        ("radians", "radians"),
        ("degrees", "degrees"),
        ("deg2rad", "radians"),
        ("rad2deg", "degrees"),
        ("reciprocal", "reciprocal"),
        ("sign", "sign"),
        ("signbit", "signbit"),
        ("sin", "sin"),
        ("sinh", "sinh"),
        ("subtract", "subtract"),
        ('sqrt', 'sqrt'),
        ('square', 'square'),
        ("tan", "tan"),
        ("tanh", "tanh"),
        ('bitwise_and', 'bitwise_and'),
        ('bitwise_or', 'bitwise_or'),
        ('bitwise_xor', 'bitwise_xor'),
        ('bitwise_not', 'invert'),
        ('left_shift', 'left_shift'),
        ('right_shift', 'right_shift'),
        ('invert', 'invert'),
        ('isnan', 'isnan'),
        ('isinf', 'isinf'),
        ('isneginf', 'isneginf'),
        ('isposinf', 'isposinf'),
        ('isfinite', 'isfinite'),
        ('logical_and', 'logical_and'),
        ('logical_xor', 'logical_xor'),
        ('logical_not', 'logical_not'),
        ('logical_or', 'logical_or'),
        ('log', 'log'),
        ('log2', 'log2'),
        ('log10', 'log10'),
        ('log1p', 'log1p'),
        ('power', 'power'),
        ('floor_divide', 'floor_divide'),
        ('logaddexp', 'logaddexp'),
        ('logaddexp2', 'logaddexp2'),
    ]:
        interpleveldefs[exposed] = "interp_ufuncs.get(space).%s" % impl

    appleveldefs = {
        'average': 'app_numpy.average',
        'sum': 'app_numpy.sum',
        'min': 'app_numpy.min',
        'identity': 'app_numpy.identity',
        'eye': 'app_numpy.eye',
        'max': 'app_numpy.max',
        'arange': 'app_numpy.arange',
        'count_nonzero': 'app_numpy.count_nonzero',
    }