[pypy-commit] pypy ufuncapi: document where api is still not compatable (help will be appreciated)
mattip
noreply at buildbot.pypy.org
Sat Aug 16 22:49:15 CEST 2014
Author: mattip <matti.picus at gmail.com>
Branch: ufuncapi
Changeset: r72830:8e348173655b
Date: 2014-08-16 23:48 +0300
http://bitbucket.org/pypy/pypy/changeset/8e348173655b/
Log: document where api is still not compatable (help will be
appreciated)
diff --git a/pypy/module/cpyext/ndarrayobject.py b/pypy/module/cpyext/ndarrayobject.py
--- a/pypy/module/cpyext/ndarrayobject.py
+++ b/pypy/module/cpyext/ndarrayobject.py
@@ -283,9 +283,6 @@
try:
self.func(rffi.cast(rffi.CArrayPtr(rffi.CCHARP), dataps),
rffi.cast(npy_intpp, dims), rffi.cast(npy_intpp, steps), user_data)
- except:
- import traceback; traceback.print_exc()
- raise
finally:
free_raw_storage(dataps, track_allocation=False)
free_raw_storage(dims, track_allocation=False)
@@ -298,6 +295,8 @@
GenericUfunc = lltype.FuncType([rffi.CArrayPtr(rffi.CCHARP), npy_intpp, npy_intpp,
rffi.VOIDP], lltype.Void)
gufunctype = lltype.Ptr(GenericUfunc)
+# XXX the signature is wrong, it should be an array of gufunctype, but
+# XXX rffi.CArrayPtr(gufunctype) does not seem to work ???
@cpython_api([gufunctype, rffi.VOIDP, rffi.CCHARP, Py_ssize_t, Py_ssize_t,
Py_ssize_t, Py_ssize_t, rffi.CCHARP, rffi.CCHARP, Py_ssize_t,
rffi.CCHARP], PyObject)
@@ -306,6 +305,7 @@
funcs_w = [None] * ntypes
dtypes_w = [None] * ntypes * (nin + nout)
for i in range(ntypes):
+ # XXX this should be 'funcs[i]' not 'funcs'
funcs_w[i] = W_GenericUFuncCaller(funcs)
for i in range(ntypes*(nin+nout)):
dtypes_w[i] = get_dtype_cache(space).dtypes_by_num[ord(types[i])]
diff --git a/pypy/module/cpyext/test/test_ndarrayobject.py b/pypy/module/cpyext/test/test_ndarrayobject.py
--- a/pypy/module/cpyext/test/test_ndarrayobject.py
+++ b/pypy/module/cpyext/test/test_ndarrayobject.py
@@ -322,7 +322,8 @@
char types[] = { NPY_DOUBLE,NPY_DOUBLE, NPY_INT, NPY_INT };
void *array_data[] = {NULL, NULL};
PyObject * retval;
- /* XXX should be 'funcs', not 'funcs[1]' but how to define an array of function pointers? */
+ /* XXX should be 'funcs', not 'funcs[1]' but how to define an array of
+ function pointers in ndarrayobject.py? */
retval = _PyUFunc_FromFuncAndDataAndSignature(funcs[1],
array_data, types, 2, 1, 1, PyUFunc_None,
"times2", "times2_docstring", 0, "()->()");
More information about the pypy-commit
mailing list