Dag Sverre Seljebotn | 1 Apr 2008 20:33
Picon
Picon

[Cython] Robin

Just saw this:

http://robin.python-hosting.com/

Seems like a good tool taking it on face value, but I didn't try it or 
look at the source (there is a numpy directory in the source tree 
though...). Perhaps there is something we can lift from it...

I saw it on the Python gsoc list when somebody was looking for mentors 
for it, full email:

Hello all,

I am an M.Sc. student at Tel-Aviv University, Israel, and an open
source developer of the project "Robin" (see
http://corwin.amber.googlepages.com/, http://robin.python-hosting.com
for a taste) which is somewhat of a SWIG alternative for automatically
creating Python bindings for C++ libraries. It provides several
features missing from existing tools, and is also cleaner,
maintainable, and extendable. I would like to push Robin forward as
part of Google's "Summer of Code", which means:

1. Create a good reference manual and tutorial (with demos)
2. Compile packages for popular OS distros
3. Stabilize Robin such that it would be capable of seamlessly
generate bindings for some well-known open-source C++ libraries such as
     a. webkit (http://webkit.org)
     b. libtorrent (http://libtorrent.rakshasa.no/)

And if anyone has any other libraries to "challange" Robin I would be
(Continue reading)

Dag Sverre Seljebotn | 1 Apr 2008 23:34
Picon
Picon

[Cython] Generic

Another draft from me that is an attempt to see if my drafts and 
Fabrizio's drafts have common traits that can be developed together.

http://wiki.cython.org/enhancements/treevisitors

Stefan, we already talked about some of this...

--

-- 
Dag Sverre

Dag Sverre Seljebotn | 1 Apr 2008 23:36
Picon
Picon

[Cython] Generic tree visitors

...should have been the title.

--

-- 
Dag Sverre

Dag Sverre Seljebotn | 2 Apr 2008 20:37
Picon
Picon

[Cython] Wiki cleanup / CEP numbering scheme

I'd like to spend an hour or so cleaning up the enhancements page if 
this (I guess it is not a necessity, but if it should be done anyway 
then this is a good time). If I get thumbs up for the following I'll get 
at it.

I propose the following scheme:

Number each document with a CEP number. Numbering scheme:

CEP1xx: "Frontend". User experience CEPs and meta-CEPs; high-level goals 
that drive development process ("better C++ support", "better numpy 
support") as well as build system, command-line interface, usage as 
library etc.

CEP2xx: Better support for compiling non-extended Python code

CEP3xx: New features for the Cython language that doesn't overlap with 
Python (templates, code in pxd files)

CEP4xx: Optimizations -- things that doesn't change the Cython language 
but which changes C output. For instance for-in => for-from transform.

CEP9xx: Cython implementation things (transformation pipelines, 
development of new parser, etc.)

The important thing isn't that we cover every case now, but that 
documents that's numbered now doesn't have to be renumbered.

Each document has the following fields (guidelines only):

(Continue reading)

Robert Bradshaw | 3 Apr 2008 07:13
Favicon

Re: [Cython] cimport inside a package

I think the problem is that it's getting confused between the names  
"foo" and "zap.foo." I'm not sure, however, what the correct solution  
to this is, other than giving the names via setup.py, but perhaps  
someone more familiar with distutils and/or compiling extensions by  
hand would have a better idea what's going on.

- Robert

On Mar 27, 2008, at 1:28 PM, Simon Burton wrote:
>
>
> I have a Makefile ( the -I. doesn't seem to help):
>
>
> bar.so: bar.o
>         gcc $(CFLAGS) -shared bar.o -o bar.so
>
> bar.o: bar.c
>         gcc $(CFLAGS) -c bar.c -I/usr/include/python2.5
>
> bar.c: bar.pyx
>         cython -I. bar.pyx
>
>
>
> foo.so: foo.o
>         gcc $(CFLAGS) -shared foo.o -o foo.so
>
> foo.o: foo.c
>         gcc $(CFLAGS) -c foo.c -I/usr/include/python2.5
(Continue reading)

Robert Bradshaw | 3 Apr 2008 08:19
Favicon

Re: [Cython] --cplus option to the "cython" command line script

Done.

On Mar 17, 2008, at 3:04 PM, Martin C. Martin wrote:
> Hi,
>
> the --cplus option doesn't appear in the usage, and the comments in  
> the
> code say its only supported on MacOS X.  But that isn't true, it's  
> used
> by the distutils when you specify langauge="c++".
>
> Can it be added to the usage in Cython/Compiler/CmdLine.py ?
>
> Best,
> Martin
> _______________________________________________
> Cython-dev mailing list
> Cython-dev@...
> http://codespeak.net/mailman/listinfo/cython-dev

Fabrizio Milo aka misto | 3 Apr 2008 08:44
Picon
Gravatar

Re: [Cython] Wiki cleanup / CEP numbering scheme

Great, I had this idea in mind too.

Thumbs up!

Fabrizio
Robert Bradshaw | 4 Apr 2008 01:26
Favicon

Re: [Cython] [Pyrex] C++ forward declaration

On Apr 3, 2008, at 4:20 PM, Ravi Lanka wrote:
> Pyrex gurus,
>
>    I am trying to wrap two C++ classes in a Namespace called
> "MyNameSpace".  I was breezing through using some of the ideas  
> shared by
> Lenard and others.  I got stuck with a case of forward declaration as
> below.  The two classes I have, A and B, have methods that require the
> objects corresponding to B and A.  If I try to declare, say class B,
> without all the methods before class A and then try to create the
> complete code for class B, it complains that class B is re-declared.
> How do I get around this problem ?
>
> cdef extern from "A.h":
>     ctypedef struct A "MyNameSpace::A":
>         void (*foo)( B data )
>
> cdef extern from "B.h":
>     ctypedef struct B "MyNameSpace::B":
>         void (*bar)( A data )
>
> thanks
> Ravi

I believe you have to do a forward declaration. The following works  
for me:

cdef extern from "B.h":
     ctypedef struct B

(Continue reading)

Gabriel Gellner | 4 Apr 2008 05:19
Picon
Favicon

[Cython] access to enclosing scope in a cdef

Sorry for the simple question, but I couldn't figure out how to do this
myself...

I am wrapping a C-code ode solver that uses a callback after each time step.
So to save the output I need to append these values to a global array.

Roughly I want to have a calling function that creates a numpy array that the
callback will write to. The problem is I don't know how to make this kind of
global variable in cython.

The skeleton that I would like to be able to do (given that I have removed all
the real logic):

# This is the solution callback (not the model definition for those who use
# ode solvers) that is the ode solver is returning the *y values after each
# step.
cdef void solout(int nr, double *x, double *y):
    # I will have a loop in the future, but as long as I can
    # save a single value to the array I can solve this myself.
    output.data[0][0] = y[0] 

# This the python driver
def ode(t):
    dim = 4 # hard set to make the code short . . .

    # Allocate my array
    output = numpy.zeros((4, len(t)))

    # set solver values
    y0 = <some kind of array, not important>
(Continue reading)

Robert Bradshaw | 4 Apr 2008 09:22
Favicon

[Cython] Cython 0.9.6.13rc1 is up.

This has the new repository hierarchy, so you won't be able to pull  
from the online -devel ones. If no one reports any bugs in then I  
will release tomorrow.

http://sage.math.washington.edu/home/robertwb/cython/

- Robert


Gmane