Commits

Maciej Fijalkowski committed f732c09

rename numpy -> numpypy

Comments (0)

Files changed (8)

pypy/module/micronumpy/__init__.py

 
 
 class Module(MixedModule):
-    applevel_name = 'numpy'
+    applevel_name = 'numpypy'
 
     interpleveldefs = {
         'array': 'interp_numarray.SingleDimArray',

pypy/module/micronumpy/app_numpy.py

 import math
 
-import numpy
+import numpypy
 
 
 inf = float("inf")
 
 def mean(a):
     if not hasattr(a, "mean"):
-        a = numpy.array(a)
+        a = numpypy.array(a)
     return a.mean()

pypy/module/micronumpy/bench/add.py

 
-import numpy
+try:
+    import numpypy as numpy
+except:
+    import numpy
 
 def f():
     a = numpy.zeros(10000000)

pypy/module/micronumpy/bench/iterate.py

 
-import numpy
+try:
+    import numpypy as numpy
+except:
+    import numpy
 
 def f():
     sum = 0

pypy/module/micronumpy/test/test_dtypes.py

 
 class AppTestDtypes(BaseNumpyAppTest):
     def test_dtype(self):
-        from numpy import dtype
+        from numpypy import dtype
 
         d = dtype('?')
         assert d.num == 0
         raises(TypeError, dtype, 1042)
 
     def test_dtype_with_types(self):
-        from numpy import dtype
+        from numpypy import dtype
 
         assert dtype(bool).num == 0
         assert dtype(int).num == 7
         assert dtype(float).num == 12
 
     def test_array_dtype_attr(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
 
         a = array(range(5), long)
         assert a.dtype is dtype(long)
 
     def test_repr_str(self):
-        from numpy import dtype
+        from numpypy import dtype
 
         assert repr(dtype) == "<type 'numpy.dtype'>"
         d = dtype('?')
         assert str(d) == "bool"
 
     def test_bool_array(self):
-        import numpy
+        from numpypy import array, False_, True_
 
-        a = numpy.array([0, 1, 2, 2.5], dtype='?')
-        assert a[0] is numpy.False_
+        a = array([0, 1, 2, 2.5], dtype='?')
+        assert a[0] is False_
         for i in xrange(1, 4):
-            assert a[i] is numpy.True_
+            assert a[i] is True_
 
     def test_copy_array_with_dtype(self):
-        import numpy
+        from numpypy import array, False_, True_
 
-        a = numpy.array([0, 1, 2, 3], dtype=long)
+        a = array([0, 1, 2, 3], dtype=long)
         # int on 64-bit, long in 32-bit
         assert isinstance(a[0], (int, long))
         b = a.copy()
         assert isinstance(b[0], (int, long))
 
-        a = numpy.array([0, 1, 2, 3], dtype=bool)
-        assert a[0] is numpy.False_
+        a = array([0, 1, 2, 3], dtype=bool)
+        assert a[0] is False_
         b = a.copy()
-        assert b[0] is numpy.False_
+        assert b[0] is False_
 
     def test_zeros_bool(self):
-        import numpy
+        from numpypy import zeros, False_
 
-        a = numpy.zeros(10, dtype=bool)
+        a = zeros(10, dtype=bool)
         for i in range(10):
-            assert a[i] is numpy.False_
+            assert a[i] is False_
 
     def test_ones_bool(self):
-        import numpy
+        from numpypy import ones, True_
 
-        a = numpy.ones(10, dtype=bool)
+        a = ones(10, dtype=bool)
         for i in range(10):
-            assert a[i] is numpy.True_
+            assert a[i] is True_
 
     def test_zeros_long(self):
-        from numpy import zeros
+        from numpypy import zeros
         a = zeros(10, dtype=long)
         for i in range(10):
             assert isinstance(a[i], (int, long))
             assert a[1] == 0
 
     def test_ones_long(self):
-        from numpy import ones
+        from numpypy import ones
         a = ones(10, dtype=long)
         for i in range(10):
             assert isinstance(a[i], (int, long))
             assert a[1] == 1
 
     def test_overflow(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
         assert array([128], 'b')[0] == -128
         assert array([256], 'B')[0] == 0
         assert array([32768], 'h')[0] == -32768
         raises(OverflowError, "array([2**64], 'Q')")
 
     def test_bool_binop_types(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
         types = [
             '?', 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q', 'f', 'd'
         ]
             assert (a + array([0], t)).dtype is dtype(t)
 
     def test_binop_types(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
         tests = [('b','B','h'), ('b','h','h'), ('b','H','i'), ('b','i','i'),
                  ('b','l','l'), ('b','q','q'), ('b','Q','d'), ('B','h','h'),
                  ('B','H','H'), ('B','i','i'), ('B','I','I'), ('B','l','l'),
             assert (array([1], d1) + array([1], d2)).dtype is dtype(dout)
 
     def test_add_int8(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
 
         a = array(range(5), dtype="int8")
         b = a + a
             assert b[i] == i * 2
 
     def test_add_int16(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
 
         a = array(range(5), dtype="int16")
         b = a + a
             assert b[i] == i * 2
 
     def test_add_uint32(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
 
         a = array(range(5), dtype="I")
         b = a + a
             assert b[i] == i * 2
 
     def test_shape(self):
-        from numpy import dtype
+        from numpypy import dtype
 
         assert dtype(long).shape == ()
 
     def test_cant_subclass(self):
-        from numpy import dtype
+        from numpypy import dtype
 
         # You can't subclass dtype
         raises(TypeError, type, "Foo", (dtype,), {})

pypy/module/micronumpy/test/test_module.py

 
 class AppTestNumPyModule(BaseNumpyAppTest):
     def test_mean(self):
-        from numpy import array, mean
+        from numpypy import array, mean
         assert mean(array(range(5))) == 2.0
         assert mean(range(5)) == 2.0
 
     def test_average(self):
-        from numpy import array, average
+        from numpypy import array, average
         assert average(range(10)) == 4.5
         assert average(array(range(10))) == 4.5
 
     def test_constants(self):
         import math
-        from numpy import inf, e
+        from numpypy import inf, e
         assert type(inf) is float
         assert inf == float("inf")
         assert e == math.e
-        assert type(e) is float
+        assert type(e) is float

pypy/module/micronumpy/test/test_numarray.py

 
 class AppTestNumArray(BaseNumpyAppTest):
     def test_type(self):
-        from numpy import array
+        from numpypy import array
         ar = array(range(5))
         assert type(ar) is type(ar + ar)
 
     def test_init(self):
-        from numpy import zeros
+        from numpypy import zeros
         a = zeros(15)
         # Check that storage was actually zero'd.
         assert a[10] == 0.0
         assert a[13] == 5.3
 
     def test_size(self):
-        from numpy import array
+        from numpypy import array
         # XXX fixed on multidim branch
         #assert array(3).size == 1
         a = array([1, 2, 3])
         Test that empty() works.
         """
 
-        from numpy import empty
+        from numpypy import empty
         a = empty(2)
         a[1] = 1.0
         assert a[1] == 1.0
 
     def test_ones(self):
-        from numpy import ones
+        from numpypy import ones
         a = ones(3)
         assert len(a) == 3
         assert a[0] == 1
         assert a[2] == 4
 
     def test_copy(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a.copy()
         for i in xrange(5):
             assert b[i] == a[i]
 
     def test_iterator_init(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         assert a[3] == 3
 
     def test_repr(self):
-        from numpy import array, zeros
+        from numpypy import array, zeros
         a = array(range(5), float)
         assert repr(a) == "array([0.0, 1.0, 2.0, 3.0, 4.0])"
         a = array([], float)
         assert repr(a) == "array([True, False, True, False], dtype=bool)"
 
     def test_repr_slice(self):
-        from numpy import array, zeros
+        from numpypy import array, zeros
         a = array(range(5), float)
         b = a[1::2]
         assert repr(b) == "array([1.0, 3.0])"
         assert repr(b) == "array([0.0, 0.0, 0.0, ..., 0.0, 0.0, 0.0])"
 
     def test_str(self):
-        from numpy import array, zeros
+        from numpypy import array, zeros
         a = array(range(5), float)
         assert str(a) == "[0.0 1.0 2.0 3.0 4.0]"
         assert str((2*a)[:]) == "[0.0 2.0 4.0 6.0 8.0]"
         assert str(a) == "[0 1 2 3 4]"
 
     def test_str_slice(self):
-        from numpy import array, zeros
+        from numpypy import array, zeros
         a = array(range(5), float)
         b = a[1::2]
         assert str(b) == "[1.0 3.0]"
         assert str(b) == "[0.0 0.0 0.0 ..., 0.0 0.0 0.0]"
 
     def test_getitem(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         raises(IndexError, "a[5]")
         a = a + a
         raises(IndexError, "a[-6]")
 
     def test_getitem_tuple(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         raises(IndexError, "a[(1,2)]")
         for i in xrange(5):
             assert a[i] == b[i]
 
     def test_setitem(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         a[-1] = 5.0
         assert a[4] == 5.0
         raises(IndexError, "a[-6] = 3.0")
 
     def test_setitem_tuple(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         raises(IndexError, "a[(1,2)] = [0,1]")
         for i in xrange(5):
             assert a[i] == i
 
     def test_setslice_array(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = array(range(2))
         a[1:4:2] = b
         assert b[1] == 0.
 
     def test_setslice_of_slice_array(self):
-        from numpy import array, zeros
+        from numpypy import array, zeros
         a = zeros(5)
         a[::2] = array([9., 10., 11.])
         assert a[0] == 9.
         assert a[0] == 3.
 
     def test_setslice_list(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5), float)
         b = [0., 1.]
         a[1:4:2] = b
         assert a[3] == 1.
 
     def test_setslice_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5), float)
         a[1:4:2] = 0.
         assert a[1] == 0.
         assert a[3] == 0.
 
     def test_len(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         assert len(a) == 5
         assert len(a + a) == 5
 
     def test_shape(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         assert a.shape == (5,)
         b = a + a
         assert c.shape == (3,)
 
     def test_add(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a + a
         for i in range(5):
             assert c[i] == bool(a[i] + b[i])
 
     def test_add_other(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = array(range(4, -1, -1))
         c = a + b
             assert c[i] == 4
 
     def test_add_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a + 5
         for i in range(5):
             assert b[i] == i + 5
 
     def test_radd(self):
-        from numpy import array
+        from numpypy import array
         r = 3 + array(range(3))
         for i in range(3):
             assert r[i] == i + 3
 
     def test_add_list(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = list(reversed(range(5)))
         c = a + b
             assert c[i] == 4
 
     def test_subtract(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a - a
         for i in range(5):
             assert b[i] == 0
 
     def test_subtract_other(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = array([1, 1, 1, 1, 1])
         c = a - b
             assert c[i] == i - 1
 
     def test_subtract_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a - 5
         for i in range(5):
             assert b[i] == i - 5
 
     def test_mul(self):
-        import numpy
+        import numpypy
 
-        a = numpy.array(range(5))
+        a = numpypy.array(range(5))
         b = a * a
         for i in range(5):
             assert b[i] == i * i
 
-        a = numpy.array(range(5), dtype=bool)
+        a = numpypy.array(range(5), dtype=bool)
         b = a * a
-        assert b.dtype is numpy.dtype(bool)
-        assert b[0] is numpy.False_
+        assert b.dtype is numpypy.dtype(bool)
+        assert b[0] is numpypy.False_
         for i in range(1, 5):
-            assert b[i] is numpy.True_
+            assert b[i] is numpypy.True_
 
     def test_mul_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a * 5
         for i in range(5):
 
     def test_div(self):
         from math import isnan
-        from numpy import array, dtype, inf
+        from numpypy import array, dtype, inf
 
         a = array(range(1, 6))
         b = a / a
         assert c[2] == -inf
 
     def test_div_other(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = array([2, 2, 2, 2, 2], float)
         c = a / b
             assert c[i] == i / 2.0
 
     def test_div_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a / 5.0
         for i in range(5):
             assert b[i] == i / 5.0
 
     def test_pow(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5), float)
         b = a ** a
         for i in range(5):
             assert b[i] == i**i
 
     def test_pow_other(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5), float)
         b = array([2, 2, 2, 2, 2])
         c = a ** b
             assert c[i] == i ** 2
 
     def test_pow_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5), float)
         b = a ** 2
         for i in range(5):
             assert b[i] == i ** 2
 
     def test_mod(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(1,6))
         b = a % a
         for i in range(5):
             assert b[i] == 1
 
     def test_mod_other(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = array([2, 2, 2, 2, 2])
         c = a % b
             assert c[i] == i % 2
 
     def test_mod_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a % 2
         for i in range(5):
             assert b[i] == i % 2
 
     def test_pos(self):
-        from numpy import array
+        from numpypy import array
         a = array([1.,-2.,3.,-4.,-5.])
         b = +a
         for i in range(5):
             assert a[i] == i
 
     def test_neg(self):
-        from numpy import array
+        from numpypy import array
         a = array([1.,-2.,3.,-4.,-5.])
         b = -a
         for i in range(5):
             assert a[i] == -i
 
     def test_abs(self):
-        from numpy import array
+        from numpypy import array
         a = array([1.,-2.,3.,-4.,-5.])
         b = abs(a)
         for i in range(5):
             assert a[i + 5] == abs(i)
 
     def test_auto_force(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a - 1
         a[2] = 3
         assert c[1] == 4
 
     def test_getslice(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         s = a[1:5]
         assert len(s) == 4
         assert s[0] == 5
 
     def test_getslice_step(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(10))
         s = a[1:9:2]
         assert len(s) == 4
             assert s[i] == a[2*i+1]
 
     def test_slice_update(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         s = a[0:3]
         s[1] = 10
 
     def test_slice_invaidate(self):
         # check that slice shares invalidation list with
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         s = a[0:2]
         b = array([10,11])
         assert d[1] == 12
 
     def test_mean(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         assert a.mean() == 2.0
         assert a[:4].mean() == 1.5
 
     def test_sum(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         assert a.sum() == 10.0
         assert a[:4].sum() == 6.0
         assert a.sum() == 5
 
     def test_prod(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(1,6))
         assert a.prod() == 120.0
         assert a[:4].prod() == 24.0
 
     def test_max(self):
-        from numpy import array
+        from numpypy import array
         a = array([-1.2, 3.4, 5.7, -3.0, 2.7])
         assert a.max() == 5.7
         b = array([])
         raises(ValueError, "b.max()")
 
     def test_max_add(self):
-        from numpy import array
+        from numpypy import array
         a = array([-1.2, 3.4, 5.7, -3.0, 2.7])
         assert (a+a).max() == 11.4
 
     def test_min(self):
-        from numpy import array
+        from numpypy import array
         a = array([-1.2, 3.4, 5.7, -3.0, 2.7])
         assert a.min() == -3.0
         b = array([])
         raises(ValueError, "b.min()")
 
     def test_argmax(self):
-        from numpy import array
+        from numpypy import array
         a = array([-1.2, 3.4, 5.7, -3.0, 2.7])
         assert a.argmax() == 2
         b = array([])
         assert a.argmax() == 9
 
     def test_argmin(self):
-        from numpy import array
+        from numpypy import array
         a = array([-1.2, 3.4, 5.7, -3.0, 2.7])
         assert a.argmin() == 3
         b = array([])
         raises(ValueError, "b.argmin()")
 
     def test_all(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         assert a.all() == False
         a[0] = 3.0
         assert b.all() == True
 
     def test_any(self):
-        from numpy import array, zeros
+        from numpypy import array, zeros
         a = array(range(5))
         assert a.any() == True
         b = zeros(5)
         assert c.any() == False
 
     def test_dot(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         assert a.dot(a) == 30.0
 
         assert a.dot(range(5)) == 30
 
     def test_dot_constant(self):
-        from numpy import array
+        from numpypy import array
         a = array(range(5))
         b = a.dot(2.5)
         for i in xrange(5):
             assert b[i] == 2.5 * a[i]
 
     def test_dtype_guessing(self):
-        from numpy import array, dtype
+        from numpypy import array, dtype
 
         assert array([True]).dtype is dtype(bool)
         assert array([True, False]).dtype is dtype(bool)
 
     def test_comparison(self):
         import operator
-        from numpy import array, dtype
+        from numpypy import array, dtype
 
         a = array(range(5))
         b = array(range(5), float)
         cls.w_data = cls.space.wrap(struct.pack('dddd', 1, 2, 3, 4))
 
     def test_fromstring(self):
-        from numpy import fromstring
+        from numpypy import fromstring
         a = fromstring(self.data)
         for i in range(4):
             assert a[i] == i + 1

pypy/module/micronumpy/test/test_ufuncs.py

 
 class AppTestUfuncs(BaseNumpyAppTest):
     def test_ufunc_instance(self):
-        from numpy import add, ufunc
+        from numpypy import add, ufunc
 
         assert isinstance(add, ufunc)
         assert repr(add) == "<ufunc 'add'>"
         assert repr(ufunc) == "<type 'numpy.ufunc'>"
 
     def test_ufunc_attrs(self):
-        from numpy import add, multiply, sin
+        from numpypy import add, multiply, sin
 
         assert add.identity == 0
         assert multiply.identity == 1
         assert sin.nin == 1
 
     def test_wrong_arguments(self):
-        from numpy import add, sin
+        from numpypy import add, sin
 
         raises(ValueError, add, 1)
         raises(TypeError, add, 1, 2, 3)
         raises(ValueError, sin)
 
     def test_single_item(self):
-        from numpy import negative, sign, minimum
+        from numpypy import negative, sign, minimum
 
         assert negative(5.0) == -5.0
         assert sign(-0.0) == 0.0
         assert minimum(2.0, 3.0) == 2.0
 
     def test_sequence(self):
-        from numpy import array, negative, minimum
+        from numpypy import array, negative, minimum
         a = array(range(3))
         b = [2.0, 1.0, 0.0]
         c = 1.0
             assert min_c_b[i] == min(b[i], c)
 
     def test_negative(self):
-        from numpy import array, negative
+        from numpypy import array, negative
 
         a = array([-5.0, 0.0, 1.0])
         b = negative(a)
         assert negative(a + a)[3] == -6
 
     def test_abs(self):
-        from numpy import array, absolute
+        from numpypy import array, absolute
 
         a = array([-5.0, -0.0, 1.0])
         b = absolute(a)
             assert b[i] == abs(a[i])
 
     def test_add(self):
-        from numpy import array, add
+        from numpypy import array, add
 
         a = array([-5.0, -0.0, 1.0])
         b = array([ 3.0, -2.0,-3.0])
             assert c[i] == a[i] + b[i]
 
     def test_divide(self):
-        from numpy import array, divide
+        from numpypy import array, divide
 
         a = array([-5.0, -0.0, 1.0])
         b = array([ 3.0, -2.0,-3.0])
             assert c[i] == a[i] / b[i]
 
     def test_fabs(self):
-        from numpy import array, fabs
+        from numpypy import array, fabs
         from math import fabs as math_fabs
 
         a = array([-5.0, -0.0, 1.0])
             assert b[i] == math_fabs(a[i])
 
     def test_minimum(self):
-        from numpy import array, minimum
+        from numpypy import array, minimum
 
         a = array([-5.0, -0.0, 1.0])
         b = array([ 3.0, -2.0,-3.0])
             assert c[i] == min(a[i], b[i])
 
     def test_maximum(self):
-        from numpy import array, maximum
+        from numpypy import array, maximum
 
         a = array([-5.0, -0.0, 1.0])
         b = array([ 3.0, -2.0,-3.0])
         assert isinstance(x, (int, long))
 
     def test_multiply(self):
-        from numpy import array, multiply
+        from numpypy import array, multiply
 
         a = array([-5.0, -0.0, 1.0])
         b = array([ 3.0, -2.0,-3.0])
             assert c[i] == a[i] * b[i]
 
     def test_sign(self):
-        from numpy import array, sign, dtype
+        from numpypy import array, sign, dtype
 
         reference = [-1.0, 0.0, 0.0, 1.0]
         a = array([-5.0, -0.0, 0.0, 6.0])
         assert a[1] == 0
 
     def test_reciporocal(self):
-        from numpy import array, reciprocal
+        from numpypy import array, reciprocal
 
         reference = [-0.2, float("inf"), float("-inf"), 2.0]
         a = array([-5.0, 0.0, -0.0, 0.5])
             assert b[i] == reference[i]
 
     def test_subtract(self):
-        from numpy import array, subtract
+        from numpypy import array, subtract
 
         a = array([-5.0, -0.0, 1.0])
         b = array([ 3.0, -2.0,-3.0])
             assert c[i] == a[i] - b[i]
 
     def test_floor(self):
-        from numpy import array, floor
+        from numpypy import array, floor
 
         reference = [-2.0, -1.0, 0.0, 1.0, 1.0]
         a = array([-1.4, -1.0, 0.0, 1.0, 1.4])
             assert b[i] == reference[i]
 
     def test_copysign(self):
-        from numpy import array, copysign
+        from numpypy import array, copysign
 
         reference = [5.0, -0.0, 0.0, -6.0]
         a = array([-5.0, 0.0, 0.0, 6.0])
 
     def test_exp(self):
         import math
-        from numpy import array, exp
+        from numpypy import array, exp
 
         a = array([-5.0, -0.0, 0.0, 12345678.0, float("inf"),
                    -float('inf'), -12343424.0])
 
     def test_sin(self):
         import math
-        from numpy import array, sin
+        from numpypy import array, sin
 
         a = array([0, 1, 2, 3, math.pi, math.pi*1.5, math.pi*2])
         b = sin(a)
 
     def test_cos(self):
         import math
-        from numpy import array, cos
+        from numpypy import array, cos
 
         a = array([0, 1, 2, 3, math.pi, math.pi*1.5, math.pi*2])
         b = cos(a)
 
     def test_tan(self):
         import math
-        from numpy import array, tan
+        from numpypy import array, tan
 
         a = array([0, 1, 2, 3, math.pi, math.pi*1.5, math.pi*2])
         b = tan(a)
 
     def test_arcsin(self):
         import math
-        from numpy import array, arcsin
+        from numpypy import array, arcsin
 
         a = array([-1, -0.5, -0.33, 0, 0.33, 0.5, 1])
         b = arcsin(a)
 
     def test_arccos(self):
         import math
-        from numpy import array, arccos
+        from numpypy import array, arccos
 
         a = array([-1, -0.5, -0.33, 0, 0.33, 0.5, 1])
         b = arccos(a)
 
     def test_arctan(self):
         import math
-        from numpy import array, arctan
+        from numpypy import array, arctan
 
         a = array([-3, -2, -1, 0, 1, 2, 3, float('inf'), float('-inf')])
         b = arctan(a)
 
     def test_arcsinh(self):
         import math
-        from numpy import arcsinh, inf
+        from numpypy import arcsinh, inf
 
         for v in [inf, -inf, 1.0, math.e]:
             assert math.asinh(v) == arcsinh(v)
 
     def test_arctanh(self):
         import math
-        from numpy import arctanh
+        from numpypy import arctanh
 
         for v in [.99, .5, 0, -.5, -.99]:
             assert math.atanh(v) == arctanh(v)
             assert arctanh(v) == math.copysign(float("inf"), v)
 
     def test_reduce_errors(self):
-        from numpy import sin, add
+        from numpypy import sin, add
 
         raises(ValueError, sin.reduce, [1, 2, 3])
         raises(TypeError, add.reduce, 1)
 
     def test_reduce(self):
-        from numpy import add, maximum
+        from numpypy import add, maximum
 
         assert add.reduce([1, 2, 3]) == 6
         assert maximum.reduce([1]) == 1
 
     def test_comparisons(self):
         import operator
-        from numpy import equal, not_equal, less, less_equal, greater, greater_equal
+        from numpypy import equal, not_equal, less, less_equal, greater, greater_equal
 
         for ufunc, func in [
             (equal, operator.eq),