Re: [Cython] Fused type signature resolution failures

2014-06-22 Thread Pauli Virtanen
ime. > > We should take a look at how other implementations do this dispatch. There > are multiple "generic functions" implementations for Python that do similar > things. I agree that there probably is room for improvement, possibly also speed-wise. I'll try to rev

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-22 Thread Pauli Virtanen
22.03.2014 14:48, Pauli Virtanen kirjoitti: [clip] > I can take a look at this today... Here's one attempt: https://github.com/cython/cython/pull/284 In the long run, I'd like to be able to write code like this: https://github.com/pv/scipy-work/blob/csparsetools-nocrud

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-22 Thread Pauli Virtanen
instantiated in several different ways. I can take a look at this today... (Re: Sturla: I *want* a bloatware generator, but a controllable one :) -- Pauli Virtanen ___ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel

[Cython] Fused type signature resolution failures

2014-03-18 Thread Pauli Virtanen
Hi, Here are the fused types + memoryview signature resolution failures I promised earlier (Cython 0.20.1): (A) TypeError: No matching signature - asd.pyx cimport numpy as cnp ctypedef fused value_t: cnp.float32_t cnp.float64_t cpdef foo(value_t x): pa

Re: [Cython] Too many instantiations with fused type memoryviews

2014-03-08 Thread Pauli Virtanen
08.03.2014 22:40, Stefan Behnel kirjoitti: [clip] > Yes, this is a known problem. The work-around is to ctypedef the > memory view type, not just the dtype. > > http://thread.gmane.org/gmane.comp.python.cython.user/10437 Thanks, I missed that. Re: arguments in the previous thread --- I think it

[Cython] Too many instantiations with fused type memoryviews

2014-03-08 Thread Pauli Virtanen
y arguments and more than one fused type. I think this issue is also accompanied by some signature resolution bugs (I'll try to come up with an example case). Cheers, -- Pauli Virtanen ___ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel

Re: [Cython] Memory leak of memoryview attributes in cdef subclasses

2013-09-24 Thread Pauli Virtanen
ccur in topmost > cdef classes. > > Here's an example: (See the module docstring on how to compile and run the > example.) Cannot reproduce the failure on Cython 0.19.1. If you are using an earlier version, please try that instead. One bug with memory leaks in cdef classes wa

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread Pauli Virtanen
W, switching from np.ndarray+templating to fused types+memoryviews increased the stripped size of scipy.interpolate.interpnd [1] from 368k to 633k. [1] https://github.com/scipy/scipy/pull/211 -- Pauli Virtanen ___ cython-devel mailing list cython-deve

Re: [Cython] Refcount error with fused types in classes

2013-03-17 Thread Pauli Virtanen
17.03.2013 19:18, Pauli Virtanen kirjoitti: > Hi, > > 17.03.2013 18:51, mark florisson kirjoitti: > [clip] >> Thanks, I pushed a fix here: https://github.com/markflorisson88/cython >> (fd4853d202b13a92). > > Thanks. You beat me to this, I just arrived at the same fi

Re: [Cython] Refcount error with fused types in classes

2013-03-17 Thread Pauli Virtanen
Hi, 17.03.2013 18:51, mark florisson kirjoitti: [clip] > Thanks, I pushed a fix here: https://github.com/markflorisson88/cython > (fd4853d202b13a92). Thanks. You beat me to this, I just arrived at the same fix :) Cheers, Pauli ___ cython-devel mailin

[Cython] Refcount error with fused types in classes

2013-03-17 Thread Pauli Virtanen
(object) def main(): x = Foo() print "before:", Py_REFCNT(x) x.bar(1.0) # spuriously increments refcount of `x` print "after: ", Py_REFCNT(x) -----8<- -- Pauli Virtanen ___ cython-devel mailing list cytho

Re: [Cython] Failure with asarray(memoryview) on Python 2.4

2012-06-11 Thread Pauli Virtanen
11.06.2012 21:23, Pauli Virtanen kirjoitti: > Hi, > > 11.06.2012 21:16, mark florisson kirjoitti: > [clip] >> Yeah, there was some weird bug with PyIndex_Check() not operating >> properly. Could you retry with the latest master? > > Doesn't seem to work in 5a0

Re: [Cython] Cython 1.6 & compilation failure on MinGW?

2012-06-11 Thread Pauli Virtanen
11.06.2012 21:17, mark florisson kirjoitti: [clip] > Thanks, could you provide a pull request? That makes it easier to > merge and assign credit. Ok, this one seemed to already have been fixed in Cython master. Pauli ___ cython-devel mailing li

Re: [Cython] Cython 1.6 & compilation failure on MinGW?

2012-06-11 Thread Pauli Virtanen
11.06.2012 21:17, mark florisson kirjoitti: [clip] > Thanks, could you provide a pull request? That makes it easier to > merge and assign credit. Ok, I'll try to not only just complain :) BRB, Pauli ___ cython-devel mailing list cython-devel@p

Re: [Cython] Failure with asarray(memoryview) on Python 2.4

2012-06-11 Thread Pauli Virtanen
Hi, 11.06.2012 21:16, mark florisson kirjoitti: [clip] > Yeah, there was some weird bug with PyIndex_Check() not operating > properly. Could you retry with the latest master? Doesn't seem to work in 5a0effd0 :( Traceback (most recent call last): File "", line 1, in ? File "fail.pyx", line 1

[Cython] Cython 1.6 & compilation failure on MinGW?

2012-06-11 Thread Pauli Virtanen
581,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, 0, 0, -__Pyx_PyCFunction_Call, +__Pyx_PyCFunction_Call_wrap, 0, 0, 0, ... It's a bit surprising to me that you cannot use the function from the Python headers as a static initializer on that pl

[Cython] Failure with asarray(memoryview) on Python 2.4

2012-06-11 Thread Pauli Virtanen
Hi, This doesn't work on Python 2.4 (works on >= 2.5): cimport numpy as np import numpy as np def _foo(): cdef double[:] a a = np.array([1.0]) return np.asarray(a) def foo(): print _foo() Spotted when using Cython 1.6 in Scipy. Results to: Python 2.4.

[Cython] N-d arrays, without a Python object

2012-05-20 Thread Pauli Virtanen
language, but such a feature would find immediate practical use. -- Pauli Virtanen ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel

Re: [Cython] hg-git shows 25 heads?

2011-07-07 Thread Pauli Virtanen
On Thu, 07 Jul 2011 20:10:30 +0200, Dag Sverre Seljebotn wrote: [clip] > 5 minutes of Googling didn't turn up anything... Do you think it would > be a bad idea to simply delete these branches, something like > > git push origin :refs/* That drops *all* branches -- not recommended :) As far as I

Re: [Cython] hg-git shows 25 heads?

2011-07-07 Thread Pauli Virtanen
On Thu, 07 Jul 2011 15:28:36 +0200, Stefan Behnel wrote: > there's something broken with the repo recently. Even in a fresh > checkout, I see 25 heads, most of which were supposed to be merges into > the master branch (mainly button merges). The github web site doesn't > show these, it only has thr

Re: [Cython] Fused Types

2011-04-29 Thread Pauli Virtanen
Fri, 29 Apr 2011 16:59:22 +0200, mark florisson wrote: [clip] > Hmm, indeed, it's pretty weird. I'm fine with the pairing also, although > I'm still not sure how common this case is, and if we really want to > support it. Wouldn't good old C promotion work for this? e.g. if the > type is either flo

Re: [Cython] Fused Types

2011-04-29 Thread Pauli Virtanen
me way as "long int" is, and writing "real_t complex" feels a bit like writing "int_t long". But of course, if this feature is really only needed for declaring complex variants of real types, then how it is done doesn't matter so much. But, IMH

Re: [Cython] Fused Types

2011-04-29 Thread Pauli Virtanen
Fri, 29 Apr 2011 11:30:19 +0200, mark florisson wrote: > On 29 April 2011 11:03, Pauli Virtanen wrote: [clip] >> Are you planning to special-case the "real_t complex" syntax? Shooting >> from the sidelines, one more generic solution might be, e.g., > > I'm sor

Re: [Cython] Fused Types

2011-04-29 Thread Pauli Virtanen
B) struct_t ctypedef cython.fused_type(float, double, paired=struct_t) real_t ctypedef cython.fused_type(int_t, string_t, paired=struct_t) var_t and just restrict the specialization to cases that make sense. -- Pauli Virtanen _

Re: [Cython] CEP: prange for parallel loops

2011-04-05 Thread Pauli Virtanen
Tue, 05 Apr 2011 12:55:36 +, Pauli Virtanen wrote: [clip] > # Assignment to non-private variables causes a compile-time > # error; this avoids common mistakes, such as forgetting to > # declare the reduction variable. >

Re: [Cython] CEP: prange for parallel loops

2011-04-05 Thread Pauli Virtanen
dding the variable declarations. -- Pauli Virtanen ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel

Re: [Cython] 'with gil:' statement

2011-03-16 Thread Pauli Virtanen
? Does the Cython compiler keep track if GIL is acquired or not? -- Pauli Virtanen ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel