Author: mattip <[email protected]>
Branch: numpy-fixes
Changeset: r76950:f169593652bc
Date: 2015-04-29 08:12 +0300
http://bitbucket.org/pypy/pypy/changeset/f169593652bc/

Log:    typos, add failing view test

diff --git a/pypy/module/micronumpy/ndarray.py 
b/pypy/module/micronumpy/ndarray.py
--- a/pypy/module/micronumpy/ndarray.py
+++ b/pypy/module/micronumpy/ndarray.py
@@ -852,7 +852,7 @@
                 # Strides, shape does not change
                 if dtype.is_object() != impl.dtype.is_object():
                     raise oefmt(space.w_ValueError, 'expect trouble in 
ndarray.view,'
-                        ' target dtype %r but self.dtype %r',dtype, impl.dtype)
+                        ' one of target dtype or dtype is object dtype')
                 
                 base = impl.base()
                 if base is None:
diff --git a/pypy/module/micronumpy/test/test_ndarray.py 
b/pypy/module/micronumpy/test/test_ndarray.py
--- a/pypy/module/micronumpy/test/test_ndarray.py
+++ b/pypy/module/micronumpy/test/test_ndarray.py
@@ -1820,6 +1820,10 @@
         assert v.strides == s.strides
         assert v.base is s.base
         assert (v == 2).all()
+        y = empty([6,6], 'uint32')
+        s = y.swapaxes(0, 1)
+        v = s.view(y.__class__)
+        assert v.strides == (4, 24)
     
     def test_tolist_scalar(self):
         from numpy import dtype
diff --git a/pypy/module/micronumpy/test/test_subtype.py 
b/pypy/module/micronumpy/test/test_subtype.py
--- a/pypy/module/micronumpy/test/test_subtype.py
+++ b/pypy/module/micronumpy/test/test_subtype.py
@@ -405,7 +405,7 @@
 
     def test_setstate_no_version(self):
         # Some subclasses of ndarray, like MaskedArray, do not use
-        # version in __setstare__
+        # version in __setstate__
         from numpy import ndarray, array
         from pickle import loads, dumps
         import sys, new
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to