RuntimeWarning: invalid value encountered in powerĮRROR: Failure: ValueError (can't handle version 187 of numpy.ndarray pickle)įile "/home/david/coding/python3.3/local-install/lib/python3.3/site-packages/nose-1.1.2-p圓.3.egg/nose/failure.py", line 37, in runTest With these changes, the numpy test suite runs, with just these remaining errors:įile "/home/david/coding/python3.3/local-install/lib/python3.3/site-packages/numpy/core/tests/test_regression.py", line 41, in test_pickle_transposedĮRROR: test_power_zero (test_umath.TestPower)įile "/home/david/coding/python3.3/local-install/lib/python3.3/site-packages/numpy/core/tests/test_umath.py", line 139, in test_power_zeroĪssert_complex_equal(np.power(zero, 0+1j), cnan) I may of course be misunderstanding the insides of numpy. So I hacked those test from out of CPython :) I'm attaching the diff I've got against cpython (clearly just a hack at this stage). At that point, it's unlikely that the resulting 4-byte values are below 0x10ffff, leading to various failures from inside CPython's unicode handling. The other wart is that, AIUI, numpy supports byte-swapping the values within an array, and when this is done for a unicode array, it byte-swaps the 4-byte UCS4 values. So I had to reimplement parts of unicode creation in-place within numpy's PyArray_Scalar, copying macros from out of cpython's unicodeobject.c unicode_new_subtype calls tp_alloc but passes in 0 for the size, so we can't use that.
Think3 and esw Patch#
I'm attaching my latest work-in-progress patch for numpy, which mostly works (it has 3 remaining errors).ĪIUI, the "numpy.str_" type subclasses PyUnicodeObject but with its own custom allocator, which takes a size (this is called in PyArray_Scalar when type_num = NPY_UNICODE). Numpy pokes at the insides of PyUnicodeObject in a few places and is thus affected by the PEP 393 changes in Python 3.3 I've been trying to get numpy working with Python 3.3, and to so I had to make some changes to CPython - hence I'm posting this to the Python bug tracker. Hack-out-test-against-MAX_UNICODE-from-cpython-3.3.patchĭirty dirty hack applied to CPython 3.3. Work-in-progress patch for numpy to get it working with 3.3 Arfrever, alex, certik, dmalcolm, loewis, ncoghlan, pitrou, skrah, teoliphant, vstinnerĬreated on 21:10 by dmalcolm, last changed 15:59 by teoliphant.