[Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Geoffrey Irving
Is there a standard way of creating an object array restricted to a particular python type? I want a safe way of sending arrays of objects back and forth between Python and C++, and it'd be great if I could use numpy arrays on the Python side instead of creating a new type. For example, I might

Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Anthony Scopatz
Hi Geoffrey, Not to toot my own horn here too much, but you really should have a look at xdress (http://xdress.org/ and https://github.com/xdress/xdress). XDress will generate a wrapper of the Force class for you and then also create a custom numpy dtype for this class. In this way, you could

Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Geoffrey Irving
On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz scop...@gmail.com wrote: Hi Geoffrey, Not to toot my own horn here too much, but you really should have a look at xdress (http://xdress.org/ and https://github.com/xdress/xdress). XDress will generate a wrapper of the Force class for you and

Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Anthony Scopatz
Hey Geoffrey, Let's definitely take this off (this) list. The discussion could get involved :). Be Well Anthony On Tue, Jul 16, 2013 at 7:15 PM, Geoffrey Irving irv...@naml.us wrote: On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz scop...@gmail.com wrote: Hi Geoffrey, Not to toot my

Re: [Numpy-discussion] restricting object arrays to a single Python type

2013-07-16 Thread Anthony Scopatz
On Tue, Jul 16, 2013 at 7:15 PM, Geoffrey Irving irv...@naml.us wrote: On Tue, Jul 16, 2013 at 4:51 PM, Anthony Scopatz scop...@gmail.com wrote: Hi Geoffrey, Not to toot my own horn here too much, but you really should have a look at xdress (http://xdress.org/ and