Re: [Numpy-discussion] Where is the code for PyArray_UpdateFlags?

2012-09-18 Thread Frédéric Bastien
Hi I had done a checkout of a old version of numpy where this file didn't existed. It is there in the trunk. thanks Fred On Tue, Sep 18, 2012 at 9:43 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 7:32 PM, Frédéric Bastien wrote: >> >> Hi, >> >> I would like to reuse the code of th

Re: [Numpy-discussion] Where is the code for PyArray_UpdateFlags?

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 7:32 PM, Frédéric Bastien wrote: > Hi, > > I would like to reuse the code of this function: PyArray_UpdateFlags > > I don't find its definition in the numpy source code. In the build > directory, it get defined in the file > build/src.linux-x86_64-2.7/numpy/core/include/nu

[Numpy-discussion] Where is the code for PyArray_UpdateFlags?

2012-09-18 Thread Frédéric Bastien
Hi, I would like to reuse the code of this function: PyArray_UpdateFlags I don't find its definition in the numpy source code. In the build directory, it get defined in the file build/src.linux-x86_64-2.7/numpy/core/include/numpy/__multiarray_api.h like this: #define PyArray_UpdateFlags \

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 6:08 PM, Charles R Harris wrote: > > > The relevant setting is in numpy/core/include/numpy/ndarraytypes.h > > #define NPY_DEFAULT_ASSIGN_CASTING NPY_SAME_KIND_CASTING > > I think that if we want to raise a warning we could define a new rule, > > NPY_WARN_SAME_KIND_CASTING

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
The relevant setting is in numpy/core/include/numpy/ndarraytypes.h #define NPY_DEFAULT_ASSIGN_CASTING NPY_SAME_KIND_CASTING I think that if we want to raise a warning we could define a new rule, NPY_WARN_SAME_KIND_CASTING Which would do the same as unsafe, only raise a warning on the way. Ch

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 5:02 PM, Travis Oliphant wrote: > >> >> >>> That is sort of the point of all this. We are using 16 bit integers >>> because we wanted to be as efficient as possible and didn't need anything >>> larger. Note, that is what we changed the code to, I am just wondering if >>>

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Travis Oliphant
> >> >> That is sort of the point of all this. We are using 16 bit integers because >> we wanted to be as efficient as possible and didn't need anything larger. >> Note, that is what we changed the code to, I am just wondering if we are >> being too cautious. The casting kwarg looks to be

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 2:52 PM, Benjamin Root wrote: > > > On Tue, Sep 18, 2012 at 4:42 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Tue, Sep 18, 2012 at 2:33 PM, Travis Oliphant wrote: >> >>> >>> On Sep 18, 2012, at 2:44 PM, Charles R Harris wrote: >>> >>> >>> >>> On

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Ralf Gommers
On Tue, Sep 18, 2012 at 10:52 PM, Benjamin Root wrote: > > > On Tue, Sep 18, 2012 at 4:42 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Tue, Sep 18, 2012 at 2:33 PM, Travis Oliphant wrote: >> >>> >>> On Sep 18, 2012, at 2:44 PM, Charles R Harris wrote: >>> >>> >>> >>> O

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 4:42 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 2:33 PM, Travis Oliphant wrote: > >> >> On Sep 18, 2012, at 2:44 PM, Charles R Harris wrote: >> >> >> >> On Tue, Sep 18, 2012 at 1:35 PM, Benjamin Root wrote: >> >>> >>> >>> On Tue, Sep 18, 2012 at 3:25 PM, Ch

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 2:33 PM, Travis Oliphant wrote: > > On Sep 18, 2012, at 2:44 PM, Charles R Harris wrote: > > > > On Tue, Sep 18, 2012 at 1:35 PM, Benjamin Root wrote: > >> >> >> On Tue, Sep 18, 2012 at 3:25 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Tue,

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Travis Oliphant
On Sep 18, 2012, at 2:44 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 1:35 PM, Benjamin Root wrote: > > > On Tue, Sep 18, 2012 at 3:25 PM, Charles R Harris > wrote: > > > On Tue, Sep 18, 2012 at 1:13 PM, Benjamin Root wrote: > > > On Tue, Sep 18, 2012 at 2:47 PM, Charles

Re: [Numpy-discussion] numpy.ma.MaskedArray.min() makes a copy?

2012-09-18 Thread Nathaniel Smith
On 18 Sep 2012 18:40, "Benjamin Root" wrote: > > > > On Fri, Sep 7, 2012 at 12:05 PM, Nathaniel Smith wrote: >> >> On 7 Sep 2012 14:38, "Benjamin Root" wrote: >> > >> > An issue just reported on the matplotlib-users list involved a user who ran out of memory while attempting to do an imshow() on

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Eric Firing
On 2012/09/18 9:25 AM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 1:13 PM, Benjamin Root > wrote: > > > > On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris > mailto:charlesr.har...@gmail.com>> wrote: > > > > On Tue, Sep 18, 2012 at 11:39 AM, Benja

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 1:35 PM, Benjamin Root wrote: > > > On Tue, Sep 18, 2012 at 3:25 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Tue, Sep 18, 2012 at 1:13 PM, Benjamin Root wrote: >> >>> >>> >>> On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris < >>> charlesr.har

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 3:25 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 1:13 PM, Benjamin Root wrote: > >> >> >> On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: >>>

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 1:13 PM, Benjamin Root wrote: > > > On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: >> >>> >>> >>> On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris < >>> charlesr.ha

Re: [Numpy-discussion] numpy.ma.MaskedArray.min() makes a copy?

2012-09-18 Thread Sebastian Berg
On Tue, 2012-09-18 at 08:42 -1000, Eric Firing wrote: > On 2012/09/18 7:40 AM, Benjamin Root wrote: > > > > > > On Fri, Sep 7, 2012 at 12:05 PM, Nathaniel Smith > > wrote: > > > > On 7 Sep 2012 14:38, "Benjamin Root" > > wrote: > > > > >

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 3:19 PM, Ralf Gommers wrote: > > > On Tue, Sep 18, 2012 at 9:13 PM, Benjamin Root wrote: > >> >> >> On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: >>>

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Ralf Gommers
On Tue, Sep 18, 2012 at 9:13 PM, Benjamin Root wrote: > > > On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: >> >>> >>> >>> On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris < >>> charlesr.ha

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Tue, Sep 18, 2012 at 2:47 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: > >> >> >> On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Mon, Sep 17, 2012 at 3:40 PM, Travis Oliphant wrote: >>> >>>

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 1:08 PM, Travis Oliphant wrote: > > On Sep 18, 2012, at 1:47 PM, Charles R Harris wrote: > > > > On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: > >> >> >> On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Mon

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Travis Oliphant
On Sep 18, 2012, at 1:47 PM, Charles R Harris wrote: > > > On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: > > > On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris > wrote: > > > On Mon, Sep 17, 2012 at 3:40 PM, Travis Oliphant wrote: > > On Sep 17, 2012, at 8:42 AM, Benjamin Roo

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Charles R Harris
On Tue, Sep 18, 2012 at 11:39 AM, Benjamin Root wrote: > > > On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Mon, Sep 17, 2012 at 3:40 PM, Travis Oliphant wrote: >> >>> >>> On Sep 17, 2012, at 8:42 AM, Benjamin Root wrote: >>> >>> > Consider t

Re: [Numpy-discussion] numpy.ma.MaskedArray.min() makes a copy?

2012-09-18 Thread Eric Firing
On 2012/09/18 7:40 AM, Benjamin Root wrote: > > > On Fri, Sep 7, 2012 at 12:05 PM, Nathaniel Smith > wrote: > > On 7 Sep 2012 14:38, "Benjamin Root" > wrote: > > > > An issue just reported on the matplotlib-users list involved a >

Re: [Numpy-discussion] numpy.ma.MaskedArray.min() makes a copy?

2012-09-18 Thread Benjamin Root
On Fri, Sep 7, 2012 at 12:05 PM, Nathaniel Smith wrote: > On 7 Sep 2012 14:38, "Benjamin Root" wrote: > > > > An issue just reported on the matplotlib-users list involved a user who > ran out of memory while attempting to do an imshow() on a large array. > While this wouldn't be totally unexpect

Re: [Numpy-discussion] Regression: in-place operations (possibly intentional)

2012-09-18 Thread Benjamin Root
On Mon, Sep 17, 2012 at 9:33 PM, Charles R Harris wrote: > > > On Mon, Sep 17, 2012 at 3:40 PM, Travis Oliphant wrote: > >> >> On Sep 17, 2012, at 8:42 AM, Benjamin Root wrote: >> >> > Consider the following code: >> > >> > import numpy as np >> > a = np.array([1, 2, 3, 4, 5], dtype=np.int16) >>