[pypy-commit] pypy remove-numpypy: some more fixes

bdkearns noreply at buildbot.pypy.org
Tue Oct 29 22:34:37 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: remove-numpypy
Changeset: r67707:92a9f1d35d4a
Date: 2013-10-29 17:09 -0400
http://bitbucket.org/pypy/pypy/changeset/92a9f1d35d4a/

Log:	some more fixes

diff --git a/pypy/module/micronumpy/appbridge.py b/pypy/module/micronumpy/appbridge.py
--- a/pypy/module/micronumpy/appbridge.py
+++ b/pypy/module/micronumpy/appbridge.py
@@ -12,8 +12,8 @@
         self.w_import = space.appexec([], """():
         def f():
             import sys
-            __import__('numpypy.core._methods')
-            return sys.modules['numpypy.core._methods']
+            __import__('numpy.core._methods')
+            return sys.modules['numpy.core._methods']
         return f
         """)
 
diff --git a/pypy/module/micronumpy/test/dummy_module.py b/pypy/module/micronumpy/test/dummy_module.py
--- a/pypy/module/micronumpy/test/dummy_module.py
+++ b/pypy/module/micronumpy/test/dummy_module.py
@@ -1,4 +1,5 @@
 from _numpypy.multiarray import *
 from _numpypy.umath import *
 
+newaxis = None
 ufunc = type(sin)
diff --git a/pypy/module/micronumpy/test/test_numarray.py b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -583,8 +583,7 @@
 
     def test_newaxis(self):
         import math
-        from numpypy import array, cos, zeros
-        from numpypy.core.numeric import newaxis
+        from numpypy import array, cos, zeros, newaxis
         a = array(range(5))
         b = array([range(5)])
         assert (a[newaxis] == b).all()
@@ -597,8 +596,7 @@
         assert ((cos(a)[:,newaxis] * cos(b).T) == expected).all()
 
     def test_newaxis_slice(self):
-        from numpypy import array
-        from numpypy.core.numeric import newaxis
+        from numpypy import array, newaxis
 
         a = array(range(5))
         b = array(range(1,5))
@@ -610,16 +608,14 @@
         assert (a[newaxis,1:] == c).all()
 
     def test_newaxis_assign(self):
-        from numpypy import array
-        from numpypy.core.numeric import newaxis
+        from numpypy import array, newaxis
 
         a = array(range(5))
         a[newaxis,1] = [2]
         assert a[1] == 2
 
     def test_newaxis_virtual(self):
-        from numpypy import array
-        from numpypy.core.numeric import newaxis
+        from numpypy import array, newaxis
 
         a = array(range(5))
         b = (a + a)[newaxis]
@@ -627,16 +623,14 @@
         assert (b == c).all()
 
     def test_newaxis_then_slice(self):
-        from numpypy import array
-        from numpypy.core.numeric import newaxis
+        from numpypy import array, newaxis
         a = array(range(5))
         b = a[newaxis]
         assert b.shape == (1, 5)
         assert (b[0,1:] == a[1:]).all()
 
     def test_slice_then_newaxis(self):
-        from numpypy import array
-        from numpypy.core.numeric import newaxis
+        from numpypy import array, newaxis
         a = array(range(5))
         b = a[2:]
         assert (b[newaxis] == [[2, 3, 4]]).all()


More information about the pypy-commit mailing list