Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Robert Elsner
Thanks for the hint. I thought about Cython myself but I was unable to get even the slightest speed gain out of it. Here is the equivalent Cython code with the timing and setup.py. I typed (I think). Am I missing something obvious? Cheers Robert On 25.07.2011 01:38, Joon Ro wrote: For those

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Robert Elsner
Yes I did. Slicing and Cython do not mix too well. Using an explicit loop fixes the problem. In case anybody is interested the code is attached. Thanks for your help Robert On 25.07.2011 12:30, Robert Elsner wrote: Thanks for the hint. I thought about Cython myself but I was unable to get even

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Pauli Virtanen
Mon, 25 Jul 2011 12:30:34 +0200, Robert Elsner wrote: Thanks for the hint. I thought about Cython myself but I was unable to get even the slightest speed gain out of it. Here is the equivalent Cython code with the timing and setup.py. I typed (I think). Am I missing something obvious? Cython

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Charles R Harris
On Sun, Jul 24, 2011 at 5:10 PM, Robert Elsner ml...@re-factory.de wrote: Boiled it down a bit more to only include code that actually takes time. First time around I found the other variant more instructive because it shows the discrepancy between the DCT and the loop but might be confusing.

Re: [Numpy-discussion] Optimizing recursive loop - updated example

2011-07-25 Thread Robert Elsner
I didn't look into that but it definitely sounds interesting. Especially as the coefficient manipulation is mildly unstable for higher derivatives. Need to work out the math first though ;). Thanks for the hint. On 25.07.2011 15:59, Charles R Harris wrote: On Sun, Jul 24, 2011 at 5:10 PM,

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Stéfan van der Walt
Hey all, On Tue, Jun 14, 2011 at 4:34 PM, Mark Wiebe mwwi...@gmail.com wrote: These functions are now fully implemented and documented. As always, code reviews are welcome here: https://github.com/numpy/numpy/pull/87 I haven't been keeping up with the datetime developments, but I noticed the

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Mark Wiebe
2011/7/25 Stéfan van der Walt ste...@sun.ac.za Hey all, On Tue, Jun 14, 2011 at 4:34 PM, Mark Wiebe mwwi...@gmail.com wrote: These functions are now fully implemented and documented. As always, code reviews are welcome here: https://github.com/numpy/numpy/pull/87 I haven't been keeping

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Stéfan van der Walt
On Mon, Jul 25, 2011 at 12:35 PM, Mark Wiebe mwwi...@gmail.com wrote: I'm trying to make things fit into the existing system as naturally as possible. The discussion you're talking about ideally should have resulted in some guideline documentation about namespaces, but I don't recall seeing

[Numpy-discussion] Problems with numpy binary for Python2.7 + OS X 10.6

2011-07-25 Thread Ian Stokes-Rees
As best I can tell, I have Python 2.7.2 for my system Python: [ijstokes@moose ~]$ python -V Python 2.7.2 [ijstokes@moose ~]$ which python /Library/Frameworks/Python.framework/Versions/2.7/bin/python however when I attempt to install the recent numpy binary python-2.7.2-macosx10.6.dmg I get

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Mark Wiebe
2011/7/25 Stéfan van der Walt ste...@sun.ac.za On Mon, Jul 25, 2011 at 12:35 PM, Mark Wiebe mwwi...@gmail.com wrote: I'm trying to make things fit into the existing system as naturally as possible. The discussion you're talking about ideally should have resulted in some guideline

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Charles R Harris
2011/7/25 Stéfan van der Walt ste...@sun.ac.za Hey all, On Tue, Jun 14, 2011 at 4:34 PM, Mark Wiebe mwwi...@gmail.com wrote: These functions are now fully implemented and documented. As always, code reviews are welcome here: https://github.com/numpy/numpy/pull/87 I haven't been keeping

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Stéfan van der Walt
On Mon, Jul 25, 2011 at 1:02 PM, Mark Wiebe mwwi...@gmail.com wrote: Probably should have!  Either way, it's something to consider: if we introduce those functions now, people will start to use them where they are (np.xyz), introducing another change in usage comes 2.0 (or 3.0 or whichever).

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Mark Wiebe
2011/7/25 Stéfan van der Walt ste...@sun.ac.za On Mon, Jul 25, 2011 at 1:02 PM, Mark Wiebe mwwi...@gmail.com wrote: Probably should have! Either way, it's something to consider: if we introduce those functions now, people will start to use them where they are (np.xyz), introducing another

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Gael Varoquaux
On Mon, Jul 25, 2011 at 03:52:48PM -0500, Mark Wiebe wrote: Can't use numpy.datetime, since that conflicts with Python's datetime library, especially in pylab. I don't understand that: isn't the point of namespaces to avoid those naming conflicts. To me that's just like saying that

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Charles R Harris
On Mon, Jul 25, 2011 at 3:00 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Mon, Jul 25, 2011 at 03:52:48PM -0500, Mark Wiebe wrote: Can't use numpy.datetime, since that conflicts with Python's datetime library, especially in pylab. I don't understand that: isn't the

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Stéfan van der Walt
On Mon, Jul 25, 2011 at 2:11 PM, Charles R Harris charlesr.har...@gmail.com wrote: It's just asking for import problems and general confusion to shadow a Python module, that's why we renamed io to npyio. Why? Users can simply do import numpy.io as npyio ? Stéfan

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Stéfan van der Walt
On Mon, Jul 25, 2011 at 1:52 PM, Mark Wiebe mwwi...@gmail.com wrote: Can't use numpy.datetime, since that conflicts with Python's datetime library, especially in pylab. We're allowed to name the modules under numpy whatever we like--people know that doing from numpy import * can (and already

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Benjamin Root
On Monday, July 25, 2011, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Mon, Jul 25, 2011 at 03:52:48PM -0500, Mark Wiebe wrote: Can't use numpy.datetime, since that conflicts with Python's datetime library, especially in pylab. I don't understand that: isn't the point of

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Skipper Seabold
2011/7/25 Stéfan van der Walt ste...@sun.ac.za: On Mon, Jul 25, 2011 at 2:11 PM, Charles R Harris charlesr.har...@gmail.com wrote: It's just asking for import problems and general confusion to shadow a Python module, that's why we renamed io to npyio. Why?  Users can simply do import

Re: [Numpy-discussion] Problems with numpy binary for Python2.7 + OS X 10.6

2011-07-25 Thread Russell E. Owen
In article 4e2dcb72.3070...@hkl.hms.harvard.edu, Ian Stokes-Rees ijsto...@hkl.hms.harvard.edu wrote: As best I can tell, I have Python 2.7.2 for my system Python: [ijstokes@moose ~]$ python -V Python 2.7.2 [ijstokes@moose ~]$ which python

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-07-25 Thread Charles R Harris
2011/7/25 Stéfan van der Walt ste...@sun.ac.za On Mon, Jul 25, 2011 at 2:11 PM, Charles R Harris charlesr.har...@gmail.com wrote: It's just asking for import problems and general confusion to shadow a Python module, that's why we renamed io to npyio. Why? Users can simply do import

[Numpy-discussion] Get a 1D slice of a 3D data set?

2011-07-25 Thread Nicolas Bigaouette
Hi all, I have a 3D orthogonal and non-uniform grid representing a scalar field. I'm using matplotlib.image.NonUniformImage() to plot it similarly to imshow(). What I'd like to do is plot the values of the scalar field across a specific line (say, from point A to B). Any suggestion? Thanks!