[Numpy-discussion] How to copy data from a C array to a numpy array efficiently?

2012-10-07 Thread Jianbao Tao
Hi, I am developing a Python wrapper of the NASA CDF C library in Cython. I have got a working version of it now, but it is slower than the counterpart in IDL. For loading the same file, mine takes about 400 ms, whereas the IDL version takes about 290 ms. The main overhead in my code is caused

Re: [Numpy-discussion] How to copy data from a C array to a numpy array efficiently?

2012-10-07 Thread Dag Sverre Seljebotn
On 10/07/2012 08:41 AM, Jianbao Tao wrote: Hi, I am developing a Python wrapper of the NASA CDF C library in Cython. I have got a working version of it now, but it is slower than the counterpart in IDL. For loading the same file, mine takes about 400 ms, whereas the IDL version takes about

Re: [Numpy-discussion] How to copy data from a C array to a numpy array efficiently?

2012-10-07 Thread Dag Sverre Seljebotn
On 10/07/2012 08:48 AM, Dag Sverre Seljebotn wrote: On 10/07/2012 08:41 AM, Jianbao Tao wrote: Hi, I am developing a Python wrapper of the NASA CDF C library in Cython. I have got a working version of it now, but it is slower than the counterpart in IDL. For loading the same file, mine takes

Re: [Numpy-discussion] How to copy data from a C array to a numpy array efficiently?

2012-10-07 Thread Jonathan T. Niehof
On 10/07/2012 12:41 AM, Jianbao Tao wrote: Hi, I am developing a Python wrapper of the NASA CDF C library in Cython. I have got a working version of it now, but it is slower than the counterpart in IDL. For loading the same file, mine takes about 400 ms, whereas the IDL version takes about

Re: [Numpy-discussion] Issue tracking

2012-10-07 Thread Thouis (Ray) Jones
I plan to import all the Trac issues to github by the end of this week. I want to get an up-to-date snapshot of the Trac DB, and run another test import with it (just to make sure there's nothing in recent bugs that isn't handled). Previous test imports here:

Re: [Numpy-discussion] How to copy data from a C array to a numpy array efficiently?

2012-10-07 Thread Jianbao Tao
Dag, Thanks for your tip. I didn't know that I could use a numpy array directly. I tried that out, and it works like a charm. :-) Jonathan, Glad that you mentioned spacepy. I actually tried spacepy before I decided to write my own wrapper. However, on the one hand, I can't install spacepy on

Re: [Numpy-discussion] set_printoptions precision and single floats

2012-10-07 Thread Dan Goodman
On 06/10/2012 18:17, Ralf Gommers wrote: Do you mean scalars or arrays? For me set_printoptions only affects arrays and not scalars. Both float32 and float64 arrays work as advertised: Yep, I mean scalars (although as Warren noted, it also affects e.g. array(1.23456789)). Dan

Re: [Numpy-discussion] set_printoptions precision and single floats

2012-10-07 Thread josef . pktd
On Sun, Oct 7, 2012 at 6:36 PM, Dan Goodman dg.gm...@thesamovar.net wrote: On 06/10/2012 18:17, Ralf Gommers wrote: Do you mean scalars or arrays? For me set_printoptions only affects arrays and not scalars. Both float32 and float64 arrays work as advertised: Yep, I mean scalars (although as