[Numpy-discussion] nanmin(masked array) fails with 'TypeError: cannot reduce a scalar'. Numpy 1.6.0 regression?

2011-07-27 Thread Mark Dickinson
In NumPy 1.6.0, I get the following behaviour: Python 2.7.2 |EPD 7.1-1 (32-bit)| (default, Jul 3 2011, 15:40:35) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type packages, demo or enthought for more information. import numpy numpy.nanmin(numpy.ma.masked_array([1,2,3,4])) Traceback (most

Re: [Numpy-discussion] nanmin(masked array) fails with 'TypeError: cannot reduce a scalar'. Numpy 1.6.0 regression?

2011-07-27 Thread Charles R Harris
On Wed, Jul 27, 2011 at 2:49 AM, Mark Dickinson mdickin...@enthought.comwrote: In NumPy 1.6.0, I get the following behaviour: Python 2.7.2 |EPD 7.1-1 (32-bit)| (default, Jul 3 2011, 15:40:35) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type packages, demo or enthought for more

[Numpy-discussion] Numpy master breaking matplotlib build

2011-07-27 Thread Michael Droettboom
The return type of PyArray_BYTES in the old API compatibility code seems to have changed recently to (void *) which breaks matplotlib builds. This pull request changes it back. Is this correct? https://github.com/numpy/numpy/pull/121 Mike ___

Re: [Numpy-discussion] Numpy master breaking matplotlib build

2011-07-27 Thread Mark Wiebe
Looks good. It might be good to change it back to (void *) for the PyArray_DATA inline function as well, I changed that during lots of tweaking to get things to build properly. -Mark On Wed, Jul 27, 2011 at 11:46 AM, Michael Droettboom md...@stsci.eduwrote: The return type of PyArray_BYTES in

[Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

2011-07-27 Thread Ilan Schnell
MacOS Lion: numpy.sqrt([complex(numpy.nan, numpy.inf)]) array([ nan+infj]) Other all system: array([ inf+infj]) This causes a few numpy tests to fail on Lion. The numpy was not compiled using the new LLVM based gcc, it is the same numpy binary I used on other MacOS systems, which was compiled

[Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, I see that (current trunk): In [9]: np.ones((1,), dtype=bool) Out[9]: array([ True], dtype='bool') - whereas (1.5.1): In [2]: np.ones((1,), dtype=bool) Out[2]: array([ True], dtype=bool) That is breaking quite a few doctests. What is the reason for the change? Something to do with more

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
This was the most consistent way to deal with the parameterized dtype in the repr, making it more future-proof at the same time. It was producing reprs like array(['2011-01-01'], dtype=datetime64[D]), which is clearly wrong, and putting quotes around it makes it work in general for all possible

Re: [Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

2011-07-27 Thread Ralf Gommers
On Wed, Jul 27, 2011 at 7:17 PM, Ilan Schnell ischn...@enthought.comwrote: MacOS Lion: numpy.sqrt([complex(numpy.nan, numpy.inf)]) array([ nan+infj]) Other all system: array([ inf+infj]) This causes a few numpy tests to fail on Lion. The numpy was not compiled using the new LLVM based

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe mwwi...@gmail.com wrote: This was the most consistent way to deal with the parameterized dtype in the repr, making it more future-proof at the same time. It was producing reprs like array(['2011-01-01'], dtype=datetime64[D]), which is clearly

Re: [Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

2011-07-27 Thread Ilan Schnell
Thanks for you quick response Ralf. Regarding binaries, we are trying to avoid to different EPD binaries for different versions of OSX, as maintaining/distributing/testing more binaries is quite expensive. - Ilan On Wed, Jul 27, 2011 at 12:58 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote:

Re: [Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

2011-07-27 Thread Ralf Gommers
On Wed, Jul 27, 2011 at 8:18 PM, Ilan Schnell ischn...@enthought.comwrote: Thanks for you quick response Ralf. Regarding binaries, we are trying to avoid to different EPD binaries for different versions of OSX, as maintaining/distributing/testing more binaries is quite expensive. Agreed, it

Re: [Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

2011-07-27 Thread Russell E. Owen
In article cabl7cqj4i6stf_qjndvch66fsfc5bjq9etpx3ukczaxyyuw...@mail.gmail.com, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Wed, Jul 27, 2011 at 7:17 PM, Ilan Schnell ischn...@enthought.comwrote: MacOS Lion: numpy.sqrt([complex(numpy.nan, numpy.inf)]) array([ nan+infj])

Re: [Numpy-discussion] nanmin(masked array) fails with 'TypeError: cannot reduce a scalar'. Numpy 1.6.0 regression?

2011-07-27 Thread Charles R Harris
On Wed, Jul 27, 2011 at 6:58 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:49 AM, Mark Dickinson mdickin...@enthought.comwrote: In NumPy 1.6.0, I get the following behaviour: Python 2.7.2 |EPD 7.1-1 (32-bit)| (default, Jul 3 2011, 15:40:35) [GCC

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 1:01 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe mwwi...@gmail.com wrote: This was the most consistent way to deal with the parameterized dtype in the repr, making it more future-proof at the same time. It was

Re: [Numpy-discussion] nanmin(masked array) fails with 'TypeError: cannot reduce a scalar'. Numpy 1.6.0 regression?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 2:20 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Jul 27, 2011 at 6:58 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:49 AM, Mark Dickinson mdickin...@enthought.com wrote: In NumPy 1.6.0, I get the following

Re: [Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

2011-07-27 Thread Ralf Gommers
On Wed, Jul 27, 2011 at 9:00 PM, Russell E. Owen ro...@uw.edu wrote: In article cabl7cqj4i6stf_qjndvch66fsfc5bjq9etpx3ukczaxyyuw...@mail.gmail.com, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Wed, Jul 27, 2011 at 7:17 PM, Ilan Schnell ischn...@enthought.com wrote: MacOS Lion:

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 1:01 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe mwwi...@gmail.com wrote: This was the most consistent way to deal with the parameterized

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 1:01 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe

Re: [Numpy-discussion] numpy.sqrt behaving differently on MacOS Lion

2011-07-27 Thread Ilan Schnell
Please don't distribute a different numpy binary for each version of MacOS X. +1 Maybe I should mention that I just finished testing all Python packages in EPD under 10.7, and everything (execpt numpy.sqr for weird complex values such as inf/nan) works fine! In particular building C and

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 1:12 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.com

[Numpy-discussion] inconsistent semantics for double-slicing

2011-07-27 Thread Alex Flint
When applying two different slicing operations in succession (e.g. select a sub-range, then select using a binary mask) it seems that numpy arrays can be inconsistent with respect to assignment: For example, in this case an array is modified: In [6]: *A = np.arange(5)* In [8]: *A[:][A2] = 0* In

[Numpy-discussion] C-API: multidimensional array indexing?

2011-07-27 Thread Johann Bauer
Dear experts, is there a C-API function for numpy which implements Python's multidimensional indexing? Say, I have a 2d-array PyArrayObject * M; and an index int i; how do I extract the i-th row or column M[i,:] respectively M[:,i]? I am looking for a function which gives again a

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Christopher Jordan-Squire
On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe

Re: [Numpy-discussion] inconsistent semantics for double-slicing

2011-07-27 Thread Wes McKinney
On Wed, Jul 27, 2011 at 5:36 PM, Alex Flint alex.fl...@gmail.com wrote: When applying two different slicing operations in succession (e.g. select a sub-range, then select using a binary mask) it seems that numpy arrays can be inconsistent with respect to assignment: For example, in this case

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 4:32 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 1:12 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Gael Varoquaux
On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote: but ultimately NumPy needs the ability to change its repr and other details like it in order to progress as a software project. You have to understand that numpy is the core layer on which people have build pretty huge scientific

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 5:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote: but ultimately NumPy needs the ability to change its repr and other details like it in order to progress as a software project. You have

[Numpy-discussion] Change in behavior of PyArray_BYTES(

2011-07-27 Thread Matthew Brett
Hi, I was trying to compile matplotlib against current trunk, and hit an error with this line: char* row0 = PyArray_BYTES(matrix); https://github.com/matplotlib/matplotlib/blob/master/src/agg_py_transforms.cpp The error is: src/agg_py_transforms.cpp:30:26: error: invalid

Re: [Numpy-discussion] Change in behavior of PyArray_BYTES(

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 5:35 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, I was trying to compile matplotlib against current trunk, and hit an error with this line: char* row0 = PyArray_BYTES(matrix);

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 3:23 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 5:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote:    but ultimately NumPy needs the ability to change its repr and other  

Re: [Numpy-discussion] C-API: multidimensional array indexing?

2011-07-27 Thread Johann Bauer
Thanks, Mark! Problem solved. Johann ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 5:47 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 3:23 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 5:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Charles R Harris
On Wed, Jul 27, 2011 at 4:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote: but ultimately NumPy needs the ability to change its repr and other details like it in order to progress as a software project. You have

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Gael Varoquaux
On Wed, Jul 27, 2011 at 05:25:20PM -0600, Charles R Harris wrote: Well, doc tests are just a losing proposition, no one should be using them for writing tests. It's not like this is a new discovery, doc tests have been known to be unstable for years. Untested documentation is broken

Re: [Numpy-discussion] Regression in choose()

2011-07-27 Thread Ed Schofield
Hi Travis, hi Olivier, Thanks for your replies last month about the choose() issue. I did some further investigation into this. I ran out of time in that project to come up with a patch, but here's what I found, which may be of interest: The compile-time constant NPY_MAXARGS is indeed limiting

Re: [Numpy-discussion] Quaternion dtype for NumPy - initial implementation available

2011-07-27 Thread Robert Love
To use quaternions I find I often need conversion to/from matrices and to/from Euler angles. Will you add that functionality? Will you handle the left versor and right versor versions? I have a set of pure python code I've sketched out for my needs (aerospace) but would be happy to have an