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

2018-01-30 Thread Joe
Does someone know of a function or a convenient way to automatically derive a dtype object from a C typedef struct string or a cffi.typeof()? Am 27.01.2018 10:30 schrieb Joe: Thanks for your help on this! This solved my issue. Am 25.01.2018 um 19:01 schrieb Allan Haldane: There is a new sectio

Re: [Numpy-discussion] Extending C with Python

2018-01-30 Thread Jialin Liu
Amazing! It works! Thank you Robert. I've been stuck with this many days. Best, Jialin LBNL/NERSC On Tue, Jan 30, 2018 at 10:52 PM, Robert Kern wrote: > On Wed, Jan 31, 2018 at 3:25 PM, Jialin Liu wrote: > >> Hello, >> I'm extending C with python (which is opposite way of what people usually

Re: [Numpy-discussion] Extending C with Python

2018-01-30 Thread Robert Kern
On Wed, Jan 31, 2018 at 3:25 PM, Jialin Liu wrote: > Hello, > I'm extending C with python (which is opposite way of what people usually > do, extending python with C), I'm currently stuck in passing a C array to > python layer, could anyone plz advise? > > I have a C buffer in my C code and want

[Numpy-discussion] Extending C with Python

2018-01-30 Thread Jialin Liu
Hello, I'm extending C with python (which is opposite way of what people usually do, extending python with C), I'm currently stuck in passing a C array to python layer, could anyone plz advise? I have a C buffer in my C code and want to pass it to a python function. In the C code, I have: npy_int

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

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 7:33 PM, Allan Haldane wrote: > On 01/30/2018 04:54 PM, josef.p...@gmail.com wrote: > > > > > > On Tue, Jan 30, 2018 at 3:21 PM, Allan Haldane > > wrote: > > > > On 01/30/2018 01:33 PM, josef.p...@gmail.com > >

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

2018-01-30 Thread Allan Haldane
On 01/30/2018 04:54 PM, josef.p...@gmail.com wrote: > > > On Tue, Jan 30, 2018 at 3:21 PM, Allan Haldane > wrote: > > On 01/30/2018 01:33 PM, josef.p...@gmail.com > wrote: > > AFAICS, one problem is that the padded view di

[Numpy-discussion] doc? music through mathematical relations between LPCM samples and musical elements/characteristics

2018-01-30 Thread Renato Fabbri
the half-shape suite: archive.org/details/ShapeSuite was completely synthesized using psychophysical relations for each resulting 16bit 44kHz samples: https://arxiv.org/abs/1412.6853 I am thinking about the ways in which to make the documentation at least to: * mass (music and audio in sample sequ

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

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 3:21 PM, Allan Haldane wrote: > On 01/30/2018 01:33 PM, josef.p...@gmail.com wrote: > > AFAICS, one problem is that the padded view didn't come with the > > matching down stream usage support, the pack function as mentioned, an > > alternative way to convert to a standard

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

2018-01-30 Thread Allan Haldane
On 01/30/2018 01:33 PM, josef.p...@gmail.com wrote: > AFAICS, one problem is that the padded view didn't come with the > matching down stream usage support, the pack function as mentioned, an > alternative way to convert to a standard ndarray, copy doesn't get rid > of the padding and so on. > > e

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

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 1:33 PM, wrote: > > > On Tue, Jan 30, 2018 at 12:28 PM, Allan Haldane > wrote: > >> On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: >> >>> >>> >>> On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane >> > wrote: >>> >>> On 01/29/2018 05:5

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

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 2:42 PM, wrote: > > > On Tue, Jan 30, 2018 at 1:33 PM, wrote: > >> >> >> On Tue, Jan 30, 2018 at 12:28 PM, Allan Haldane >> wrote: >> >>> On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: >>> On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane >>>

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

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 12:28 PM, Allan Haldane wrote: > On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: > >> >> >> On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane > > wrote: >> >> On 01/29/2018 05:59 PM, josef.p...@gmail.com >>

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

2018-01-30 Thread Allan Haldane
On 01/29/2018 11:50 PM, josef.p...@gmail.com wrote: On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane > wrote: On 01/29/2018 05:59 PM, josef.p...@gmail.com wrote: On Mon, Jan 29, 2018 at 5:50 PM, mailto:josef.p...@g

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

2018-01-30 Thread Chris Barker
On Mon, Jan 29, 2018 at 7:44 PM, Allan Haldane wrote: > I suggest that if we want to allow either means over fields, or conversion > of a n-D structured array to an n+1-D regular ndarray, we should add a > dedicated function to do so in numpy.lib.recfunctions > which does not depend on the binary

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

2018-01-30 Thread josef . pktd
On Tue, Jan 30, 2018 at 3:24 AM, Eric Wieser wrote: > Because dtypes were low level with clear memory layout and stayed that way > > Dtypes have supported padded and out-of-order-fields since at least 2005 > (v0.8.4) >

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

2018-01-30 Thread Eric Wieser
Because dtypes were low level with clear memory layout and stayed that way Dtypes have supported padded and out-of-order-fields since at least 2005 (v0.8.4) , and I would gue