Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-25 Thread Chris Barker - NOAA Federal
> On Jan 25, 2018, at 4:06 PM, Allan Haldane wrote: >> 1) This is a known change with good reason? > . The > change occurred because the old assignment behavior was dangerous, and > was not doing what you thought. OK, that’s a good reason! >> A) improve the error

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-25 Thread Allan Haldane
On 01/25/2018 06:06 PM, Chris Barker wrote: > Hi all, > > I'm pretty sure this is the same thing as recently discussed on this > list about 1.14, but to confirm: > > I had failures in my code with an upgrade for 1.14 -- turns out it was a > single line in a single test fixture, so no big deal,

[Numpy-discussion] Setting custom dtypes and 1.14

2018-01-25 Thread Chris Barker
Hi all, I'm pretty sure this is the same thing as recently discussed on this list about 1.14, but to confirm: I had failures in my code with an upgrade for 1.14 -- turns out it was a single line in a single test fixture, so no big deal, but a regression just the same, with no deprecation

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-25 Thread josef . pktd
On Thu, Jan 25, 2018 at 1:49 PM, Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > On Thu, Jan 25, 2018 at 1:16 PM, Stefan van der Walt > wrote: > > On Mon, 22 Jan 2018 10:11:08 -0500, Marten van Kerkwijk wrote: > >> > >> I think on the consistency argument is

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-25 Thread Marten van Kerkwijk
On Thu, Jan 25, 2018 at 1:16 PM, Stefan van der Walt wrote: > On Mon, 22 Jan 2018 10:11:08 -0500, Marten van Kerkwijk wrote: >> >> I think on the consistency argument is perhaps the most important: >> views are very powerful and in many ways one *counts* on them >>

Re: [Numpy-discussion] Multiple-field indexing: view vs copy in 1.14+

2018-01-25 Thread Stefan van der Walt
On Mon, 22 Jan 2018 10:11:08 -0500, Marten van Kerkwijk wrote: I think on the consistency argument is perhaps the most important: views are very powerful and in many ways one *counts* on them happening, especially in working with large arrays. I had the same gut feeling, but the fancy indexing

Re: [Numpy-discussion] Using np.frombuffer and cffi.buffer on array of C structs (problem with struct member padding)

2018-01-25 Thread Allan Haldane
There is a new section discussing alignment in the numpy 1.14 structured array docs, which has some hints about interfacing with C structs. These new 1.14 docs are not online yet on scipy.org, but in the meantime you can view them here:

Re: [Numpy-discussion] Using np.frombuffer and cffi.buffer on array of C structs (problem with struct member padding)

2018-01-25 Thread Chris Barker - NOAA Federal
The numpy dtype constructor takes an “align” keyword that will pad it for you. https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.dtype.html -CHB ___ NumPy-Discussion mailing list NumPy-Discussion@python.org

Re: [Numpy-discussion] Using np.frombuffer and cffi.buffer on array of C structs (problem with struct member padding)

2018-01-25 Thread Chris Barker - NOAA Federal
Sent from my iPhone > On Jan 25, 2018, at 6:51 AM, Joe wrote: > > Hello, > > how I could dynamically handle the dtype of a structured array when reading > an array of C structs with np.frombuffer (regarding the member padding in the > struct). > > So far I manually adjusted