+1 for both of these. Should we add them to `CONTRIBUTING.txt`? One gotcha I ran into with memoryviews that might be relevant to others: I got over-exuberant and memoryviewed everything, including the output array, which created problems. Unless I missed something, to return NumPy arrays we still need the `cnp.ndarray(...)` syntax for output(s). On Wednesday, May 29, 2013 5:37:01 AM UTC-5, Stefan van der Walt wrote:
Hi everyone
Two Cython related suggestions:
1) We should raise the dependency to 0.16 and start using memoryviews (they are much faster) 2) When documenting Cython functions, remember to include default values in the docstring--one cannot introspect these function signatures from IPython!
Stéfan
On May 30, 2013 1:26 AM, "Josh Warner" <silvertrumpet999@gmail.com> wrote:
+1 for both of these. Should we add them to `CONTRIBUTING.txt`?
Sure, go ahead please.
I got over-exuberant and memoryviewed everything, including the output array, which created problems. Unless I missed something, to return NumPy arrays we still need the `cnp.ndarray(...)` syntax for output(s).
Yes, you need to wrap the output in an np.asarray statement to convert a memoryview to an ndarray. Stéfan
participants (2)
-
Josh Warner
-
Stéfan van der Walt