Re: [Cython] aritmetic with arrays in Cython

2014-08-12 Thread Matěj Laitl
On Tuesday 12 of August 2014 15:18:12 Sturla Molden wrote: > Another thing to observe is that Eigen depends on the C++ compiler to elide > temporary arrays. Either I don't understand you, or you don't understand Eigen. Eigen overloads operator=() to circumvent need for temporary arrays. It is *no

Re: [Cython] aritmetic with arrays in Cython

2014-08-12 Thread Matěj Laitl
On Tuesday 12 of August 2014 15:18:12 Sturla Molden wrote: > But using Eigen will taint the output with Eigen's license, since the Eigen > library is statically linked. There is no such thing as "Eigen library". Eigen is fully implemented in header files. Cython would just generate C++ code that

Re: [Cython] aritmetic with arrays in Cython

2014-08-08 Thread Matěj Laitl
On Friday 08 of August 2014 07:05:08 Stefan Behnel wrote: > Ian Henriksen schrieb am 08.08.2014 um 00:58: > > On Thu, Aug 7, 2014 at 1:58 AM, Matěj Laitl wrote: > >> you may also check out https://github.com/strohel/Ceygen if it would suit > >> your needs. > >

Re: [Cython] aritmetic with arrays in Cython

2014-08-07 Thread Matěj Laitl
On Monday 04 of August 2014 13:11:13 Ian Henriksen wrote: > Hi all, > I noticed that some time ago there was a pull request ( > https://github.com/cython/cython/pull/144) open that was trying to > implement basic arithmetic operations with arrays. This seems to have also > been proposed in CEP 518

[Cython] Likely bug: compilation failure on aliased cimport + subclass interaction

2013-08-22 Thread Matěj Laitl
cimport foo" + "foo.BaseClass" or "from foo cimport BaseClass" + "BaseClass", it works as expected. Cython version 0.20dev add8091340e (git describe: 0.19-324-gadd8091) I'm attaching a more complete testcase which I

Re: [Cython] Likely bug: compilation failure on aliased cimport + subclass interaction

2013-08-22 Thread Matěj Laitl
On 23. 8. 2013 Matěj Laitl wrote: > I'm attaching a more complete testcase which I'll also submit as a review > request for convenience. *cough*, really attaching the second time. Matěj>From fd318ca5dc2418ebdbc704d9d10321390644ccf8 Mon Sep 17 00:00:00 2001 From: =

[Cython] [PATCH] Re: view[0].methodcall() produces invalid C when view is memoryview of extension type

2013-04-15 Thread Matěj Laitl
Hi again, especially Mark, I have some new observations and a patch regarding this problem, see below. On 23. 3. 2013 Matěj Laitl wrote: > following test code produces C code that fails to compile: > > cdef class ExtensionType(object): > > cdef public int dummy > >

Re: [Cython] nogil declaration on C++ classes (ticket 805)

2013-04-14 Thread Matěj Laitl
On 14. 4. 2013 Stefan Behnel wrote: > Hi, > this patch looks ok to me: > > http://trac.cython.org/cython_trac/ticket/805 > Any objections from the C++ users against including it in 0.19? Quite the opposite, certainly an improvement.

Re: [Cython] [PATCH] Refcount error when transposing memoryview attribute of an extension class

2013-04-12 Thread Matěj Laitl
On 8. 4. 2013 Matěj Laitl wrote: > Hi cython-devel and Mark, > I was getting > > > Fatal Python error: Acquisition count is 0 (line XYZ) > > when I was doing > > > cdef class MemViewContainer: > > cdef double[:, :] A > > > > cd

[Cython] [PATCH] Refcount error when transposing memoryview attribute of an extension class

2013-04-08 Thread Matěj Laitl
Hi cython-devel and Mark, I was getting > Fatal Python error: Acquisition count is 0 (line XYZ) when I was doing > cdef class MemViewContainer: > cdef double[:, :] A > > cdef a_method(self): > self.A = np.eye(2) > some_function(self.A.T) > some_function(self.A.T

[Cython] view[0].methodcall() produces invalid C when view is memoryview of extension type

2013-03-23 Thread Matěj Laitl
Hi, following test code produces C code that fails to compile: > cdef class ExtensionType(object): > cdef public int dummy > > def __init__(self, n): > self.dummy = n > > cdef cfoo(self): > print self.dummy > > items = [ExtensionType(1), ExtensionType(2)] > cd

Re: [Cython] `_save` was not declared when cathing C++ exceptions in nogil cdef function

2013-01-26 Thread Matěj Laitl
On 22. 1. 2013 Matěj Laitl wrote: > Hi again, > another minor problem I've stumbled upon - when I call an "except +" > function in a cdef ... nogil function, gcc fails to compile the .cpp file. > Perhaps a missing PyThreadState *_save; declaration in case of nogil >

[Cython] `_save` was not declared when cathing C++ exceptions in nogil cdef function

2013-01-22 Thread Matěj Laitl
Hi again, another minor problem I've stumbled upon - when I call an "except +" function in a cdef ... nogil function, gcc fails to compile the .cpp file. Perhaps a missing PyThreadState *_save; declaration in case of nogil functions? Cython 0.18b1 3e37475ec5098eef2c421. Attached patch trivially

Re: [Cython] releasing 0.18?

2013-01-22 Thread Matěj Laitl
On 13. 1. 2013 mark florisson wrote: > On 13 January 2013 06:49, Stefan Behnel wrote: > > haven't heard from Mark yet, but would anyone object to releasing a beta > > in a couple of days? > > Sorry, I forgot to report back. I pushed the extension type as dtype > fix a while ago in commit 478b939a

Re: [Cython] Compiler crash in AnalyseDeclarationsTransform with binding=True

2013-01-22 Thread Matěj Laitl
On 21. 1. 2013 Stefan Behnel wrote: > > pybayes/filters.pxd:22:29: Compiler crash in AnalyseDeclarationsTransform > > [...] > > AssertionError: Cannot insert list here: body in > > > > I'm puzzled how this comes to be triggered by the "binding" directive. > Anyway, just as a stab in the dark, do

[Cython] Compiler crash in AnalyseDeclarationsTransform with binding=True

2013-01-20 Thread Matěj Laitl
g/src/reference/compilation.html Regards, Matěj Laitl === Full Crash Log === running build_ext cythoning pybayes/filters.py to build/temp.linux- x86_64-2.7/pyrex/pybayes/filters.c Error compiling Cython

[Cython] memoryview of extension types: warnings with gcc, errors with g++

2012-11-29 Thread Matěj Laitl
Hi list and Mark, it seems that C code with questionable casts is generated when using memory views of extension types. I get following warnings from gcc: extension_type_memoryview.c: In function ‘__pyx_pf_25extension_type_memoryview_test_getitem’: extension_type_memoryview.c:1468:15: warning: a

[Cython] Buffer type specification (CEP 514) in @cython.locals() in .pxd

2011-05-11 Thread Matěj Laitl
it has no sense in .py files as type type is not usually subscriptable. On the same note, is there a plan to implement fast buffer access for class variables? ;) (this is obviously not that crucial) Regards and keep up the good work! Matěj Laitl _