Re: [Numpy-discussion] better error message possible?

2012-06-05 Thread Thouis Jones
On Mon, Jun 4, 2012 at 11:49 PM, Nathaniel Smith n...@pobox.com wrote: On Mon, Jun 4, 2012 at 10:00 PM, Thouis (Ray) Jones tho...@gmail.com wrote: On Mon, Jun 4, 2012 at 4:27 PM, Thouis (Ray) Jones tho...@gmail.com wrote: I could look into this.  There are only ~10 places the code generates

[Numpy-discussion] nditer_buffer_flag branch (was: Add data memory allocation tracing facilities. (#284))

2012-06-05 Thread Nathaniel Smith
On Tue, Jun 5, 2012 at 11:06 AM, Thouis (Ray) Jones wrote: All of the failing tests seem to have been caused by the buffer copy bug, fixed in  https://github.com/mwiebe/numpy/tree/nditer_buffer_flag (but not yet pulled into numpy). I also have a version that implements tracing, with pure C

[Numpy-discussion] lazy evaluation

2012-06-05 Thread mark florisson
Hey, Another discussion on lazy evaluation, given the recent activity here: https://github.com/ContinuumIO/numba/pull/6#issuecomment-6117091 A somewhat recent previous thread can be found here: http://mail.scipy.org/pipermail/numpy-discussion/2012-February/060862.html , and a NEP here:

Re: [Numpy-discussion] better error message possible?

2012-06-05 Thread Thouis Jones
On Tue, Jun 5, 2012 at 12:15 PM, Thouis Jones thouis.jo...@curie.fr wrote: On Mon, Jun 4, 2012 at 11:49 PM, Nathaniel Smith n...@pobox.com wrote: On Mon, Jun 4, 2012 at 10:00 PM, Thouis (Ray) Jones tho...@gmail.com wrote: On Mon, Jun 4, 2012 at 4:27 PM, Thouis (Ray) Jones tho...@gmail.com

[Numpy-discussion] varargs for logical_or, etc

2012-06-05 Thread Neal Becker
I think it's unfortunate that functions like logical_or are limited to binary. As a workaround, I've been using this: def apply_binary (func, *args): if len (args) == 1: return args[0] elif len (args) == 2: return func (*args) else: return func (

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread Nathaniel Smith
On Tue, Jun 5, 2012 at 12:55 PM, mark florisson markflorisso...@gmail.com wrote: It would be great if we implement the NEP listed above, but with a few extensions. I think Numpy should handle the lazy evaluation part, and determine when expressions should be evaluated, etc. However, for each

Re: [Numpy-discussion] 1D array sorting ascending and descending by fields

2012-06-05 Thread Patrick Redmond
On Mon, Jun 4, 2012 at 6:08 PM, Chris Barker chris.bar...@noaa.gov wrote: could you multiply the numeric field by -1, sort, then put it back Yeah, that works great for my situation. Thanks Chris! On Mon, Jun 4, 2012 at 8:17 PM, Benjamin Root ben.r...@ou.edu wrote: While that may work for this

Re: [Numpy-discussion] varargs for logical_or, etc

2012-06-05 Thread Robert Kern
On Tue, Jun 5, 2012 at 2:54 PM, Neal Becker ndbeck...@gmail.com wrote: I think it's unfortunate that functions like logical_or are limited to binary. As a workaround, I've been using this: def apply_binary (func, *args):    if len (args) == 1:        return args[0]    elif len (args) == 2:

Re: [Numpy-discussion] nditer_buffer_flag branch (was: Add data memory allocation tracing facilities. (#284))

2012-06-05 Thread Mark Wiebe
On Tue, Jun 5, 2012 at 5:40 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 11:06 AM, Thouis (Ray) Jones wrote: All of the failing tests seem to have been caused by the buffer copy bug, fixed in https://github.com/mwiebe/numpy/tree/nditer_buffer_flag(but not yet pulled

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread mark florisson
On 5 June 2012 14:58, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 12:55 PM, mark florisson markflorisso...@gmail.com wrote: It would be great if we implement the NEP listed above, but with a few extensions. I think Numpy should handle the lazy evaluation part, and determine

Re: [Numpy-discussion] commit rights for Nathaniel

2012-06-05 Thread Charles R Harris
On Sun, Jun 3, 2012 at 12:04 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote: On Sun, Jun 3, 2012 at 6:43 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, Numpy is approaching a time of transition. Ralf will be concentrating his efforts on Scipy I'll write a separate

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Nathaniel Smith
On Mon, Jun 4, 2012 at 10:12 PM, Dag Sverre Seljebotn d.s.seljeb...@astro.uio.no wrote: On 06/04/2012 09:06 PM, Mike Hansen wrote: On Mon, May 28, 2012 at 3:15 AM, Mike Hansenmhan...@gmail.com  wrote: In trying to upgrade NumPy within Sage, we notices some differences in behavior between 1.5

Re: [Numpy-discussion] commit rights for Nathaniel

2012-06-05 Thread Nathaniel Smith
On Tue, Jun 5, 2012 at 4:19 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Jun 3, 2012 at 12:04 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sun, Jun 3, 2012 at 6:43 PM, Charles R Harris charlesr.har...@gmail.com wrote: Hi All, Numpy is approaching a time of

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread Nathaniel Smith
On Tue, Jun 5, 2012 at 4:12 PM, mark florisson markflorisso...@gmail.com wrote: On 5 June 2012 14:58, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 12:55 PM, mark florisson markflorisso...@gmail.com wrote: It would be great if we implement the NEP listed above, but with a few

Re: [Numpy-discussion] 1D array sorting ascending and descending by fields

2012-06-05 Thread Benjamin Root
On Tue, Jun 5, 2012 at 10:49 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 1:17 AM, Benjamin Root ben.r...@ou.edu wrote: On Monday, June 4, 2012, Chris Barker wrote: On Mon, Jun 4, 2012 at 11:10 AM, Patrick Redmond plredm...@gmail.com wrote: Here's how I sorted

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread Neal Becker
Would lazy eval be able to eliminate temps in doing operations such as: np.sum (u != 23)? That is, now ops involving selecting elements of matrixes are often performed by first constructing temp matrixes, and the operating on them. ___

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Mike Hansen
On Tue, Jun 5, 2012 at 8:34 AM, Nathaniel Smith n...@pobox.com wrote: I don't think that would work, because looking more closely, I don't think they're actually doing anything like what __array_interface__/PEP3118 are designed for. They just have some custom class

Re: [Numpy-discussion] commit rights for Nathaniel

2012-06-05 Thread Charles R Harris
On Tue, Jun 5, 2012 at 10:25 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 4:19 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Jun 3, 2012 at 12:04 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sun, Jun 3, 2012 at 6:43 PM, Charles R

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread mark florisson
On 5 June 2012 18:21, Neal Becker ndbeck...@gmail.com wrote: Would lazy eval be able to eliminate temps in doing operations such as: np.sum (u != 23)? That is, now ops involving selecting elements of matrixes are often performed by first constructing temp matrixes, and the operating on

Re: [Numpy-discussion] commit rights for Nathaniel

2012-06-05 Thread Charles R Harris
On Tue, Jun 5, 2012 at 11:52 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Tue, Jun 5, 2012 at 10:25 AM, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 4:19 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, Jun 3, 2012 at 12:04 PM, Ralf Gommers

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread mark florisson
On 5 June 2012 17:38, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 4:12 PM, mark florisson markflorisso...@gmail.com wrote: On 5 June 2012 14:58, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 12:55 PM, mark florisson markflorisso...@gmail.com wrote: It would be

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Charles R Harris
On Tue, Jun 5, 2012 at 11:51 AM, Zachary Pincus zachary.pin...@yale.eduwrote: It isn't just the array() calls which end up getting problems. For example, in 1.5.x sage: f = 10; type(f) type 'sage.rings.integer.Integer' sage: numpy.arange(f) array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Zachary Pincus
There is a fine line here. We do need to make people clean up lax code in order to improve numpy, but hopefully we can keep the cleanups reasonable. Oh agreed. Somehow, though, I was surprised by this, even though I keep tabs on the numpy lists -- at no point did it become clear that big

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Ralf Gommers
On Tue, Jun 5, 2012 at 8:41 PM, Zachary Pincus zachary.pin...@yale.eduwrote: There is a fine line here. We do need to make people clean up lax code in order to improve numpy, but hopefully we can keep the cleanups reasonable. Oh agreed. Somehow, though, I was surprised by this, even though

Re: [Numpy-discussion] varargs for logical_or, etc

2012-06-05 Thread Ralf Gommers
On Tue, Jun 5, 2012 at 6:59 PM, Benjamin Root ben.r...@ou.edu wrote: On Tue, Jun 5, 2012 at 10:37 AM, Robert Kern robert.k...@gmail.comwrote: On Tue, Jun 5, 2012 at 2:54 PM, Neal Becker ndbeck...@gmail.com wrote: I think it's unfortunate that functions like logical_or are limited to

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Nathaniel Smith
On Tue, Jun 5, 2012 at 7:47 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Tue, Jun 5, 2012 at 8:41 PM, Zachary Pincus zachary.pin...@yale.edu wrote: There is a fine line here. We do need to make people clean up lax code in order to improve numpy, but hopefully we can keep the

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Zachary Pincus
On Tue, Jun 5, 2012 at 8:41 PM, Zachary Pincus zachary.pin...@yale.edu wrote: There is a fine line here. We do need to make people clean up lax code in order to improve numpy, but hopefully we can keep the cleanups reasonable. Oh agreed. Somehow, though, I was surprised by this, even

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread Nathaniel Smith
On Tue, Jun 5, 2012 at 7:08 PM, mark florisson markflorisso...@gmail.com wrote: On 5 June 2012 17:38, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 4:12 PM, mark florisson markflorisso...@gmail.com wrote: On 5 June 2012 14:58, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread mark florisson
On 5 June 2012 20:17, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 7:08 PM, mark florisson markflorisso...@gmail.com wrote: On 5 June 2012 17:38, Nathaniel Smith n...@pobox.com wrote: On Tue, Jun 5, 2012 at 4:12 PM, mark florisson markflorisso...@gmail.com wrote: On 5 June

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread Dag Sverre Seljebotn
On 06/05/2012 10:47 PM, mark florisson wrote: On 5 June 2012 20:17, Nathaniel Smithn...@pobox.com wrote: On Tue, Jun 5, 2012 at 7:08 PM, mark florisson markflorisso...@gmail.com wrote: On 5 June 2012 17:38, Nathaniel Smithn...@pobox.com wrote: On Tue, Jun 5, 2012 at 4:12 PM, mark florisson

Re: [Numpy-discussion] lazy evaluation

2012-06-05 Thread mark florisson
On 5 June 2012 22:36, Dag Sverre Seljebotn d.s.seljeb...@astro.uio.no wrote: On 06/05/2012 10:47 PM, mark florisson wrote: On 5 June 2012 20:17, Nathaniel Smithn...@pobox.com  wrote: On Tue, Jun 5, 2012 at 7:08 PM, mark florisson markflorisso...@gmail.com  wrote: On 5 June 2012 17:38,

Re: [Numpy-discussion] commit rights for Nathaniel

2012-06-05 Thread Charles R Harris
On Tue, Jun 5, 2012 at 4:59 PM, Fernando Perez fperez@gmail.com wrote: A couple of notes from the IPython workflow in case it's of use to you guys: On Tue, Jun 5, 2012 at 10:52 AM, Charles R Harris charlesr.har...@gmail.com wrote: For the commits themselves, the github button doesn't

Re: [Numpy-discussion] commit rights for Nathaniel

2012-06-05 Thread Fernando Perez
On Tue, Jun 5, 2012 at 4:15 PM, Charles R Harris charlesr.har...@gmail.com wrote: There are other advantages to pulling down the patch. Fixups can be merged together, commit comments enhanced, whitespace removed, style cleanups can be added, tests can be run, and the PR is automatically

[Numpy-discussion] numpy.clip behavior at max and min of dtypes

2012-06-05 Thread Edward C. Jones
Can the following function be written using numpy.clip? In some other way? Does numpy.clip satisfy condition 4 below? Does numpy.clip satisfy some closely related condition? Define a function clipcast: output = clipcast(arr, dtype=None, out=None) 1. All arrays have int or float dtypes.

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Travis Oliphant
During the original discussion, Gael pointed out that the changes would probably break some code (which might need to be cleaned up but still). I think it was underestimated how quickly people would upgrade and see the changes and therefore be able to report problems. We are talking about

Re: [Numpy-discussion] Changes in PyArray_FromAny between 1.5.x and 1.6.x

2012-06-05 Thread Travis Oliphant
I don't think that would work, because looking more closely, I don't think they're actually doing anything like what __array_interface__/PEP3118 are designed for. They just have some custom class (sage.rings.real_mpfr.RealLiteral, I guess an arbitrary precision floating point of some