Re: [Numpy-discussion] import numpy is slow

2008-07-01 Thread Hanni Ali
Would it not be possible to import just the necessary module of numpy to meet the necessary functionality of your application. i.e. import numpy.core or whatever you're using you could even do: import numpy.core as numpy I think, to simplify your code, I'm no expert though. Hanni 2008/7/1

Re: [Numpy-discussion] import numpy is slow

2008-07-01 Thread Matthieu Brucher
Hi, IIRC, il you do import numpy.core as numpy, it starts by importing numpy, so it will be even slower. Matthieu 2008/7/1 Hanni Ali [EMAIL PROTECTED]: Would it not be possible to import just the necessary module of numpy to meet the necessary functionality of your application. i.e.

Re: [Numpy-discussion] import numpy is slow

2008-07-01 Thread Hanni Ali
You are correct, it appears to take slightly longer to import numpy.core and longer again to import numpy.core as numpy I should obviously check first in future. Hanni 2008/7/1 Matthieu Brucher [EMAIL PROTECTED]: Hi, IIRC, il you do import numpy.core as numpy, it starts by importing numpy,

Re: [Numpy-discussion] import numpy is slow

2008-07-01 Thread Andrew Dalke
2008/7/1 Hanni Ali [EMAIL PROTECTED]: Would it not be possible to import just the necessary module of numpy to meet the necessary functionality of your application. Matthieu Brucher responded: IIRC, il you do import numpy.core as numpy, it starts by importing numpy, so it will be even

[Numpy-discussion] ANN: SfePy 00.46.02

2008-07-01 Thread Robert Cimrman
I am pleased announce the release of SfePy 00.46.02. SfePy is a finite element analysis software in Python, based primarily on Numpy and SciPy. Mailing lists, issue tracking, mercurial repository: http://sfepy.org Home page: http://sfepy.kme.zcu.cz Major improvements: - alternative short syntax

Re: [Numpy-discussion] More pending test framework changes (please give feedback)

2008-07-01 Thread Alan McIntyre
On Mon, Jun 30, 2008 at 1:54 PM, Alan McIntyre [EMAIL PROTECTED] wrote: 1. All doctests in NumPy will have the numpy module available in their execution context as np. 2. Turn on the normalized whitespace option for all doctests. Having a doctest fail just because there's a space after your

Re: [Numpy-discussion] More pending test framework changes (please give feedback)

2008-07-01 Thread Jarrod Millman
On Tue, Jul 1, 2008 at 8:26 AM, Alan McIntyre [EMAIL PROTECTED] wrote: Since I didn't see any objections, these changes are now committed. I'll be updating some doctests to take advantage of them later today. Excellent. Thanks, -- Jarrod Millman Computational Infrastructure for Research Labs

[Numpy-discussion] Doctest items

2008-07-01 Thread Alan McIntyre
Just a few questions/comments about doctests: 1. Should all doctests be written such that you could start Python, do an import numpy as np, and then type in the examples verbatim? There are a number that currently wouldn't work that way (they depend on the function under test being in the local

[Numpy-discussion] Coverage improvement requests

2008-07-01 Thread Alan McIntyre
Hi all, This week I'm going to start working on new tests to improve Python code coverage in NumPy (C code coverage will come later in the summer, or maybe even after GSoC). Does anyone have recommendations for particularly important bits of code that need coverage? If not, I'm just going to

Re: [Numpy-discussion] More pending test framework changes (please give feedback)

2008-07-01 Thread Charles R Harris
On Tue, Jul 1, 2008 at 9:26 AM, Alan McIntyre [EMAIL PROTECTED] wrote: On Mon, Jun 30, 2008 at 1:54 PM, Alan McIntyre [EMAIL PROTECTED] wrote: 1. All doctests in NumPy will have the numpy module available in their execution context as np. 2. Turn on the normalized whitespace option for

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Charles R Harris
On Tue, Jul 1, 2008 at 11:56 AM, Alan McIntyre [EMAIL PROTECTED] wrote: Just a few questions/comments about doctests: 1. Should all doctests be written such that you could start Python, do an import numpy as np, and then type in the examples verbatim? There are a number that currently

Re: [Numpy-discussion] Coverage improvement requests

2008-07-01 Thread Robert Kern
On Tue, Jul 1, 2008 at 13:13, Alan McIntyre [EMAIL PROTECTED] wrote: Hi all, This week I'm going to start working on new tests to improve Python code coverage in NumPy (C code coverage will come later in the summer, or maybe even after GSoC). Does anyone have recommendations for

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Robert Kern
On Tue, Jul 1, 2008 at 12:56, Alan McIntyre [EMAIL PROTECTED] wrote: Just a few questions/comments about doctests: 1. Should all doctests be written such that you could start Python, do an import numpy as np, and then type in the examples verbatim? There are a number that currently wouldn't

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Alan McIntyre
On Tue, Jul 1, 2008 at 2:45 PM, Robert Kern [EMAIL PROTECTED] wrote: If the auto-ignore capability is still needed after that, I'll work on it. It seems to me that the ellipsis mechanism just allows the output to differ. However, matplotlib would still be required because plt.plot() would

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Robert Kern
On Tue, Jul 1, 2008 at 14:14, Alan McIntyre [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 2:45 PM, Robert Kern [EMAIL PROTECTED] wrote: If the auto-ignore capability is still needed after that, I'll work on it. It seems to me that the ellipsis mechanism just allows the output to differ.

Re: [Numpy-discussion] More pending test framework changes (please give feedback)

2008-07-01 Thread Alan McIntyre
On Tue, Jul 1, 2008 at 2:37 PM, Charles R Harris [EMAIL PROTECTED] wrote: I note that a lot of unit test files import tons of specific functions, numpy.core, etc., etc. Is there any reason not to fix things up to import numpy as np from numpy.testing import * I fixed one file this way, but

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Alan McIntyre
On Tue, Jul 1, 2008 at 3:20 PM, Robert Kern [EMAIL PROTECTED] wrote: Can it work on an entire section? If not, can we do something that works on a whole section? Everything after Plot the window and its frequency response: is not required for testing. It's on a per-line basis at the moment, so

Re: [Numpy-discussion] More pending test framework changes (please give feedback)

2008-07-01 Thread Charles R Harris
On Tue, Jul 1, 2008 at 1:21 PM, Alan McIntyre [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 2:37 PM, Charles R Harris [EMAIL PROTECTED] wrote: I note that a lot of unit test files import tons of specific functions, numpy.core, etc., etc. Is there any reason not to fix things up to

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Charles R Harris
On Tue, Jul 1, 2008 at 1:30 PM, Alan McIntyre [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 3:20 PM, Robert Kern [EMAIL PROTECTED] wrote: Can it work on an entire section? If not, can we do something that works on a whole section? Everything after Plot the window and its frequency

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Alan McIntyre
On Tue, Jul 1, 2008 at 3:39 PM, Charles R Harris [EMAIL PROTECTED] wrote: We could always just make the plotting section one of those it's just an example not a doctest things and remove the (since it doesn't appear to provide any useful test coverage or anything). Would it serve to overload

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Alan McIntyre
On Tue, Jul 1, 2008 at 3:33 PM, Robert Kern [EMAIL PROTECTED] wrote: That's not a bad idea. Coordinate with Stéfan about the details (if any are left to be decided). Ok, will do. I'll also update all the test documentation I can find so that documenters have a chance of being aware of the

Re: [Numpy-discussion] More pending test framework changes (please give feedback)

2008-07-01 Thread Alan McIntyre
On Tue, Jul 1, 2008 at 3:37 PM, Charles R Harris [EMAIL PROTECTED] wrote: A lot of the imports seem to have just grown over the years, some even contain duplicates. So I think cleaning up would be a good idea if no one objects. Ok. As a pre-emptive clarification, I'll only be tweaking imports

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Robert Kern
On Tue, Jul 1, 2008 at 14:39, Charles R Harris [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 1:30 PM, Alan McIntyre [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 3:20 PM, Robert Kern [EMAIL PROTECTED] wrote: Can it work on an entire section? If not, can we do something that works on a

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Pauli Virtanen
Tue, 01 Jul 2008 15:30:47 -0400, Alan McIntyre wrote: On Tue, Jul 1, 2008 at 3:20 PM, Robert Kern [EMAIL PROTECTED] wrote: Can it work on an entire section? If not, can we do something that works on a whole section? Everything after Plot the window and its frequency response: is not required

[Numpy-discussion] Change of behavior in flatten between 1.0.4 and 1.1

2008-07-01 Thread Stuart Brorson
Hi -- I have noticed a change in the behavior of numpy.flatten(True) between NumPy 1.0.4 and NumPy 1.1. The change affects 3D arrays. I am wondering if this is a bug or a feature. Here's the change. Note that the output from flatten(True) is different between 1.0.4 and 1.1. === First

Re: [Numpy-discussion] Change of behavior in flatten between 1.0.4 and 1.1

2008-07-01 Thread Pauli Virtanen
Tue, 01 Jul 2008 17:18:55 -0400, Stuart Brorson wrote: Hi -- I have noticed a change in the behavior of numpy.flatten(True) between NumPy 1.0.4 and NumPy 1.1. The change affects 3D arrays. I am wondering if this is a bug or a feature. Here's the change. Note that the output from

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Fernando Perez
On Tue, Jul 1, 2008 at 1:41 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: But it's a custom tweak to doctest, so it might break at some point in the future, and I don't love the monkeypatching here... Welcome to the joys of extending doctest/unittest. They hardcoded so much stuff in there that

Re: [Numpy-discussion] problem with NumPy test harness in 1.1.0?

2008-07-01 Thread Robert Kern
On Tue, Jul 1, 2008 at 17:53, David Brown [EMAIL PROTECTED] wrote: Hi, Our code depends on NumPy and we have been taking advantage of the NumPy test harness to create test scripts for new features as we develop them. As recently as version 1.1.0.dev5064 we had no problem running our tests

Re: [Numpy-discussion] problem with NumPy test harness in 1.1.0?

2008-07-01 Thread Fernando Perez
On Tue, Jul 1, 2008 at 4:43 PM, Robert Kern [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 18:39, David Brown [EMAIL PROTECTED] wrote: OK, thanks for the info Robert. Any recommendations for another test harness? numpy and scipy are moving to nose as of numpy 1.2 and scipy 0.7.

Re: [Numpy-discussion] problem with NumPy test harness in 1.1.0?

2008-07-01 Thread David Brown
Thanks for the input Fernando. -dave On Jul 1, 2008, at 5:48 PM, Fernando Perez wrote: On Tue, Jul 1, 2008 at 4:43 PM, Robert Kern [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 18:39, David Brown [EMAIL PROTECTED] wrote: OK, thanks for the info Robert. Any recommendations for another

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Ryan May
Robert Kern wrote: On Tue, Jul 1, 2008 at 17:50, Fernando Perez [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 1:41 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: But it's a custom tweak to doctest, so it might break at some point in the future, and I don't love the monkeypatching here...

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Alan McIntyre
On Tue, Jul 1, 2008 at 4:41 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: All in all, I'd estimate this to be ~100 lines, put in a suitable location. If possible, I'd like other possibilities be considered first before jumping this route. I think it would be nice to retain the ability to run

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Robert Kern
On Tue, Jul 1, 2008 at 19:19, Ryan May [EMAIL PROTECTED] wrote: Robert Kern wrote: On Tue, Jul 1, 2008 at 17:50, Fernando Perez [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 1:41 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: But it's a custom tweak to doctest, so it might break at some point

Re: [Numpy-discussion] Doctest items

2008-07-01 Thread Ryan May
Robert Kern wrote: On Tue, Jul 1, 2008 at 19:19, Ryan May [EMAIL PROTECTED] wrote: Robert Kern wrote: On Tue, Jul 1, 2008 at 17:50, Fernando Perez [EMAIL PROTECTED] wrote: On Tue, Jul 1, 2008 at 1:41 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: But it's a custom tweak to doctest, so it might