Author: mattip <[email protected]>
Branch: str-dtype-improvement
Changeset: r62351:4adb8f504e1f
Date: 2013-03-14 16:16 -0700
http://bitbucket.org/pypy/pypy/changeset/4adb8f504e1f/

Log:    skip missing functionality

diff --git a/pypy/module/micronumpy/arrayimpl/concrete.py 
b/pypy/module/micronumpy/arrayimpl/concrete.py
--- a/pypy/module/micronumpy/arrayimpl/concrete.py
+++ b/pypy/module/micronumpy/arrayimpl/concrete.py
@@ -47,6 +47,9 @@
         if impl.is_scalar():
             self.fill(impl.get_scalar_value())
             return
+        if self.dtype.is_str_or_unicode():
+            raise OperationError(space.w_NotImplementedError, space.wrap(
+                "concatenate(%s) not implemented yet" % self.dtype))
         shape = shape_agreement(space, self.get_shape(), arr)
         if impl.storage == self.storage:
             impl = impl.copy()
@@ -276,7 +279,7 @@
         return ArrayBuffer(self)
 
     def astype(self, space, dtype):
-        if dtype.is_flexible_type():
+        if dtype.is_str_or_unicode():
             raise OperationError(space.w_NotImplementedError, space.wrap(
                 "astype(%s) not implemented yet" % dtype))
         new_arr = W_NDimArray.from_shape(self.get_shape(), dtype)
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
@@ -1480,10 +1480,13 @@
         a = (a + a)[::2]
         b = concatenate((a[:3], a[-3:]))
         assert (b == [2, 6, 10, 2, 6, 10]).all()
-        a = concatenate((array([1]), array(['abc'])))
-        assert a.dtype == 'S3'
-        a = concatenate((array([]), array(['abc'])))
-        assert a[0] == 'abc'
+        try:
+            a = concatenate((array([1]), array(['abc'])))
+            assert a.dtype == 'S3'
+            a = concatenate((array([]), array(['abc'])))
+            assert a[0] == 'abc'
+        except NotImplementedError:
+            skip('cannot concatenate numeric with string')
     
     def test_record_concatenate(self):
         # only an exact match can succeed
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to