Re: [Cython] memoryview slice transpose

2014-04-07 Thread Syam Gadde
mport numpy cimport numpy def testfunc(): a = numpy.arange(12).reshape([3,4]) cdef numpy.int_t[:,:] a_view = a cdef numpy.int_t[:,:] b = a_view[:,:].T raise Exception() # comment this out and you still get a refcount error at a different line testfunc() On 04/06/2014 06:12 A

[Cython] memoryview slice transpose

2014-03-27 Thread Syam Gadde
I wanted to re-offer for discussion a fix for a bug I reported a while back. The code that breaks is this: import numpy cimport numpy def testfunc(): a = numpy.arange(12).reshape([3,4]) cdef numpy.int_t[:,:] a_view = a cdef numpy.int_t[:,:] b = a_view[:,:].T One problem is that whe

Re: [Cython] line tracing/profiling code objects

2014-03-27 Thread Syam Gadde
s don't accept arbitrary decorators, which is the typical way to use kernprof/line_profiler. But I'm pretty happy to be able to use kernprof/line_profiler on compiled pure-Python functions for now. Thanks for your help! -syam On 02/27/2014 04:06 PM, Stefan Behnel wrote: > Hi! > > Sy

[Cython] line tracing/profiling code objects

2014-02-27 Thread Syam Gadde
Hi all, I tried using line tracing in conjunction with line_profiler/kernprof to attempt to see if line-based profiling works in Cython. I think it's pretty close. But I think the problem is that line_profiler is getting a different PyCodeObject when it wraps the function and when it actually

Re: [Cython] memoryview refcount error

2014-01-31 Thread Syam Gadde
code.put_xdecref_memoryviewslice( self.result(), have_gil=True) +code.putln("%s.memview = NULL;" % self.result()) +code.putln("%s.data = NULL;" % self.result()) else: ExprNode.generate_disposal_code(self, code) On 01/

[Cython] memoryview refcount error

2014-01-28 Thread Syam Gadde
Hi again, I'm exploring the typed memoryview feature with numpy and encountered a refcount error. It seems to happen when I create a slice of a memoryview, and transpose it. If I don't do both, I don't get the refcount error. It happens in the error cleanup code. I suspect that any error

Re: [Cython] segfault due to using DECREF instead of XDECREF

2014-01-23 Thread Syam Gadde
PyFFTW. It turns out I will likely not be using it, but thought it was an interesting edge case, and was what looked like valid Python, though it plays hard and fast with Python's runtime binding... -syam On 01/23/2014 01:04 PM, Stefan Behnel wrote: Syam Gadde, 21.01.2014 23:00: It seems

[Cython] segfault due to using DECREF instead of XDECREF

2014-01-21 Thread Syam Gadde
(apologies to the moderator for multiple postings -- I'm trying to figure out which of my email addresses is actually being exported to the public!) Hi, It seems that cython's static code analysis is failing on the following code. It thinks that a particular variable (myobject2) must not be NU