From: Dag Sverre Seljebotn Date: Thu, 24 Sep 2009 19:50:25 +0000 (+0200) Subject: Failing numpy.pxd dtype serialization testcase X-Git-Tag: 0.11.3.rc0~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=56eb63f02e05277a8d24f1a60fe1159fc36b4bda;p=cython.git Failing numpy.pxd dtype serialization testcase --- diff --git a/tests/run/numpy_test.pyx b/tests/run/numpy_test.pyx index ec3909c4..cc85db7f 100644 --- a/tests/run/numpy_test.pyx +++ b/tests/run/numpy_test.pyx @@ -199,6 +199,10 @@ try: 1,1 1,1 8,16 + + >>> test_point_record() + array([(0.0, 0.0), (1.0, -1.0), (2.0, -2.0)], + dtype=[('x', '!f8'), ('y', '!f8')]) """ except: @@ -392,4 +396,15 @@ def test_complextypes(): print "%d,%d" % (sizeof(x64), sizeof(x128)) - +cdef struct Point: + np.float64_t x, y + +def test_point_record(): + cdef np.ndarray[Point] test + Point_dtype = np.dtype([('x', np.float64), ('y', np.float64)]) + test = np.zeros(3, Point_dtype) + cdef int i + for i in range(3): + test[i].x = i + test[i].y = -i + print repr(test).replace('<', '!').replace('>', '!')