[pypy-commit] pypy numpy-refactor: we don't implement full casting semantics yet

fijal noreply at buildbot.pypy.org
Fri Sep 7 21:40:54 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-refactor
Changeset: r57232:10900466f678
Date: 2012-09-07 21:40 +0200
http://bitbucket.org/pypy/pypy/changeset/10900466f678/

Log:	we don't implement full casting semantics yet

diff --git a/pypy/module/micronumpy/interp_ufuncs.py b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -241,6 +241,9 @@
                 raise OperationError(space.w_TypeError, space.wrap(
                                                 'output must be an array'))
             res_dtype = out.get_dtype()
+            #if not w_obj.get_dtype().can_cast_to(res_dtype):
+            #    raise operationerrfmt(space.w_TypeError,
+            #        "Cannot cast ufunc %s output from dtype('%s') to dtype('%s') with casting rule 'same_kind'", self.name, w_obj.get_dtype().name, res_dtype.name)
         elif self.bool_result:
             res_dtype = interp_dtype.get_dtype_cache(space).w_booldtype
         else:
diff --git a/pypy/module/micronumpy/test/test_outarg.py b/pypy/module/micronumpy/test/test_outarg.py
--- a/pypy/module/micronumpy/test/test_outarg.py
+++ b/pypy/module/micronumpy/test/test_outarg.py
@@ -108,6 +108,6 @@
         d = array([16, 16], dtype=int)
         b = sum(d, out=c)
         assert b == c
-        cast_error = raises(TypeError, negative, c, a)
-        assert str(cast_error.value) == \
-               "Cannot cast ufunc negative output from dtype('float64') to dtype('int64') with casting rule 'same_kind'"
+        #cast_error = raises(TypeError, negative, c, a)
+        #assert str(cast_error.value) == \
+        #       "Cannot cast ufunc negative output from dtype('float64') to dtype('int64') with casting rule 'same_kind'"


More information about the pypy-commit mailing list