Re: [Numpy-discussion] np.array execution path

2012-09-24 Thread Sebastian Haase
On Mon, Sep 24, 2012 at 7:09 PM, Chris Barker wrote: > On Sat, Sep 22, 2012 at 1:00 PM, Sebastian Haase wrote: >> Oh, >> is this actually documented - I knew that np.array would (by default) >> only create copies as need ... but I never knew it would - if all fits >> - even just return the origin

Re: [Numpy-discussion] np.array execution path

2012-09-24 Thread Chris Barker
On Sat, Sep 22, 2012 at 1:00 PM, Sebastian Haase wrote: > Oh, > is this actually documented - I knew that np.array would (by default) > only create copies as need ... but I never knew it would - if all fits > - even just return the original Python-object... was that a typo? is is "asarray" that r

Re: [Numpy-discussion] np.array execution path

2012-09-23 Thread Sebastian Berg
On Sun, 2012-09-23 at 18:54 +0100, Nathaniel Smith wrote: > On Sat, Sep 22, 2012 at 10:24 PM, Sebastian Berg > wrote: > > In case you are interested, the second (real odditiy), is caused by > > ISFORTRAN and IS_F_CONTIGUOUS mixup, I have found three occurances where > > I think ISFORTRAN should be

Re: [Numpy-discussion] np.array execution path

2012-09-23 Thread Nathaniel Smith
On Sat, Sep 22, 2012 at 10:24 PM, Sebastian Berg wrote: > In case you are interested, the second (real odditiy), is caused by > ISFORTRAN and IS_F_CONTIGUOUS mixup, I have found three occurances where > I think ISFORTRAN should be replaced by the latter. Check also: > > https://github.com/seberg/n

Re: [Numpy-discussion] np.array execution path

2012-09-23 Thread Sebastian Berg
In case you are interested, the second (real odditiy), is caused by ISFORTRAN and IS_F_CONTIGUOUS mixup, I have found three occurances where I think ISFORTRAN should be replaced by the latter. Check also: https://github.com/seberg/numpy/commit/4d2713ce8f2107d225fe291f5da6c6a75436647e Sebastian

Re: [Numpy-discussion] np.array execution path

2012-09-22 Thread Sebastian Haase
Oh, is this actually documented - I knew that np.array would (by default) only create copies as need ... but I never knew it would - if all fits - even just return the original Python-object... Thanks, Sebastian Haase On Sat, Sep 22, 2012 at 8:12 PM, Travis Oliphant wrote: > Check to see if this

Re: [Numpy-discussion] np.array execution path

2012-09-22 Thread Sebastian Berg
Ooops obviously thanks a lot, stupid me. Thanks was also enough to figure the rest out myself... On Sat, 2012-09-22 at 13:12 -0500, Travis Oliphant wrote: > Check to see if this expression is true > > no is o > > In the first case no and o are the same object > > > Travis > > -- > Travis Oli

Re: [Numpy-discussion] np.array execution path

2012-09-22 Thread Travis Oliphant
Check to see if this expression is true no is o In the first case no and o are the same object Travis -- Travis Oliphant (on a mobile) 512-826-7480 On Sep 22, 2012, at 1:01 PM, Sebastian Berg wrote: > Hi, > > I have a bit of trouble figuring this out. I would have expected > np.asarray(a

[Numpy-discussion] np.array execution path

2012-09-22 Thread Sebastian Berg
Hi, I have a bit of trouble figuring this out. I would have expected np.asarray(array) to go through ctors, PyArray_NewFromArray, but it seems to me it does not, so which execution path is exactly taken here? The reason I am asking is that I want to figure out this behavior/bug, and I really am no