Re: [Cython] Automatic conversion with fixed-size C arrays

2014-10-25 Thread Stefan Behnel
Kurt Smith schrieb am 16.07.2014 um 19:01: > Being able to convert between simple C structs and Python dictionaries is > great, but it doesn't work if there is a fixed-size array field in the > struct. It seems like the following struct should be convertible safely: > > cdef struct state_t: >

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-08-16 Thread Kurt Smith
Apologies for the radio silence: the original project that motivated this work has a deadline, so I've had to set this aside for now. I fully intend to return to this once that's done. On Thu, Jul 31, 2014 at 11:34 PM, Robert Bradshaw wrote: > We can move to the PR, makes it easier to do line c

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-31 Thread Robert Bradshaw
We can move to the PR, makes it easier to do line commenting. On Tue, Jul 29, 2014 at 9:54 PM, Kurt Smith wrote: > On Mon, Jul 28, 2014 at 11:29 PM, Kurt Smith wrote: >> >> On Mon, Jul 28, 2014 at 11:02 AM, Robert Bradshaw >> wrote: >>> >>> On Sun, Jul 27, 2014 at 9:34 PM, Kurt Smith wrote: >>

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-29 Thread Kurt Smith
On Mon, Jul 28, 2014 at 11:29 PM, Kurt Smith wrote: > On Mon, Jul 28, 2014 at 11:02 AM, Robert Bradshaw > wrote: > >> On Sun, Jul 27, 2014 at 9:34 PM, Kurt Smith wrote: >> >> > I have sorted out all the code >> > generation pieces and nearly have a minimal example working, and will >> have >> >

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-28 Thread Kurt Smith
On Mon, Jul 28, 2014 at 11:02 AM, Robert Bradshaw wrote: > On Sun, Jul 27, 2014 at 9:34 PM, Kurt Smith wrote: > > > I have sorted out all the code > > generation pieces and nearly have a minimal example working, and will > have > > something for you to review soon. From what I can tell, Cython

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-28 Thread Robert Bradshaw
On Sun, Jul 27, 2014 at 9:34 PM, Kurt Smith wrote: > On Thu, Jul 24, 2014 at 9:13 PM, Kurt Smith wrote: >> >> >> I'm working on getting the `to_py_function` and `from_py_function` >> infrastructure to take arguments by reference; right now I'm getting >> something hacked into place, and I'd appre

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-27 Thread Kurt Smith
On Thu, Jul 24, 2014 at 9:13 PM, Kurt Smith wrote: > > I'm working on getting the `to_py_function` and `from_py_function` > infrastructure to take arguments by reference; right now I'm getting > something hacked into place, and I'd appreciate your review to point out > the right way (or at least

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-25 Thread Robert Bradshaw
On Fri, Jul 25, 2014 at 1:30 PM, Kurt Smith wrote: > > > On Fri, Jul 25, 2014 at 1:16 PM, Robert Bradshaw > wrote: >> >> On Fri, Jul 25, 2014 at 8:24 AM, Kurt Smith wrote: >>> >>> >>> On Thu, Jul 24, 2014 at 11:16 PM, Robert Bradshaw >>> wrote: On Thu, Jul 24, 2014 at 7:13 PM, Kurt Sm

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-25 Thread Kurt Smith
On Fri, Jul 25, 2014 at 1:16 PM, Robert Bradshaw < rober...@math.washington.edu> wrote: > On Fri, Jul 25, 2014 at 8:24 AM, Kurt Smith wrote: > >> >> On Thu, Jul 24, 2014 at 11:16 PM, Robert Bradshaw >> wrote: >> >>> On Thu, Jul 24, 2014 at 7:13 PM, Kurt Smith wrote: >>> > >>> > On Thu, Jul 24,

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-25 Thread Robert Bradshaw
On Fri, Jul 25, 2014 at 8:24 AM, Kurt Smith wrote: > > On Thu, Jul 24, 2014 at 11:16 PM, Robert Bradshaw > wrote: > >> On Thu, Jul 24, 2014 at 7:13 PM, Kurt Smith wrote: >> > >> > On Thu, Jul 24, 2014 at 2:07 PM, Robert Bradshaw >> wrote: >> >> >> >> On Fri, Jul 18, 2014 at 12:44 PM, Robert Br

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-25 Thread Kurt Smith
On Thu, Jul 24, 2014 at 11:16 PM, Robert Bradshaw wrote: > On Thu, Jul 24, 2014 at 7:13 PM, Kurt Smith wrote: > > > > On Thu, Jul 24, 2014 at 2:07 PM, Robert Bradshaw > wrote: > >> > >> On Fri, Jul 18, 2014 at 12:44 PM, Robert Bradshaw > >> wrote: > >> > On Fri, Jul 18, 2014 at 12:08 PM, Kurt

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-24 Thread Robert Bradshaw
On Thu, Jul 24, 2014 at 7:13 PM, Kurt Smith wrote: > > On Thu, Jul 24, 2014 at 2:07 PM, Robert Bradshaw wrote: >> >> On Fri, Jul 18, 2014 at 12:44 PM, Robert Bradshaw >> wrote: >> > On Fri, Jul 18, 2014 at 12:08 PM, Kurt Smith wrote: >> >> On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw >> >>

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-24 Thread Kurt Smith
On Thu, Jul 24, 2014 at 2:07 PM, Robert Bradshaw wrote: > On Fri, Jul 18, 2014 at 12:44 PM, Robert Bradshaw > wrote: > > On Fri, Jul 18, 2014 at 12:08 PM, Kurt Smith wrote: > >> On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw > wrote: > >>> > >>> > >>> Yes, this'd be nice to have. One difficu

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-24 Thread Robert Bradshaw
On Fri, Jul 18, 2014 at 12:44 PM, Robert Bradshaw wrote: > On Fri, Jul 18, 2014 at 12:08 PM, Kurt Smith wrote: >> On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw wrote: >>> >>> >>> Yes, this'd be nice to have. One difficulty with arrays is that they >>> can't be returned by value, and so the or

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-18 Thread Robert Bradshaw
On Fri, Jul 18, 2014 at 12:08 PM, Kurt Smith wrote: > On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw wrote: >> >> >> Yes, this'd be nice to have. One difficulty with arrays is that they >> can't be returned by value, and so the ordinary from_py_function >> mechanism (which gets called recursive

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-18 Thread Kurt Smith
On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw wrote: > > > Yes, this'd be nice to have. One difficulty with arrays is that they > can't be returned by value, and so the ordinary from_py_function > mechanism (which gets called recursively) would need to be adapted. > (Allowing to_py_function to

Re: [Cython] Automatic conversion with fixed-size C arrays

2014-07-16 Thread Robert Bradshaw
On Wed, Jul 16, 2014 at 10:01 AM, Kurt Smith wrote: > Hi devs, > > Being able to convert between simple C structs and Python dictionaries is > great, but it doesn't work if there is a fixed-size array field in the > struct. It seems like the following struct should be convertible safely: > > cdef

[Cython] Automatic conversion with fixed-size C arrays

2014-07-16 Thread Kurt Smith
Hi devs, Being able to convert between simple C structs and Python dictionaries is great, but it doesn't work if there is a fixed-size array field in the struct. It seems like the following struct should be convertible safely: cdef struct state_t: int i, j, k float x[3] float v[3] A