[Numpy-discussion] help with PyArrayInterface

2021-12-21 Thread bloring
I would like to make a C++ data structure that internally has a contiguous 
buffer look like a Numpy array via the numpy ArrayInterface. I already have 
this structure wrapped and usable in Python and things seem fairly straight 
forward except I am not sure about the typekind field of the PyArrayInterface 
structure. In the documentation (here 
https://numpy.org/doc/stable/reference/c-api/types-and-structures.html#c.PyArrayInterface)
 I see that typekind is a char and that there are values for some but not all 
of the various C++ POD numeric types.. What typekind value should I use for 
single precision floating point,  8 bit ineteger, 16 bit integer, etc etc?  
Those types are all supported by Numpy, but I don't know what the typekind 
value should be. Can you point to a list of vlaues?
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: help with PyArrayInterface

2021-12-21 Thread Matti Picus

On 21/12/21 11:27 pm, blor...@lbl.gov wrote:


... but I don't know what the typekind value should be. Can you point to a list 
of vlaues?
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: matti.pi...@gmail.com



>>> pprint.pprint([(k,v) for k,v in np.sctypeDict.items() if 
isinstance(k, str) and len(k) == 1])

[('?', ),
 ('b', ),
 ('B', ),
 ('h', ),
 ('H', ),
 ('i', ),
 ('I', ),
 ('p', ),
 ('P', ),
 ('l', ),
 ('L', ),
 ('q', ),
 ('Q', ),
 ('e', ),
 ('f', ),
 ('d', ),
 ('g', ),
 ('F', ),
 ('D', ),
 ('G', ),
 ('O', ),
 ('S', ),
 ('U', ),
 ('V', ),
 ('M', ),
 ('m', ),
 ('a', )]


Matti

___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] NumPy Community Meeting Wednesday

2021-12-21 Thread Sebastian Berg
Hi all,

It is almost holiday for many, so happy holidays everyone!  For those
still around and busy tomorrow:

There will be a NumPy Community meeting Wednesday December 22nd at
19:00 UTC. Everyone is invited and encouraged to join in and edit the
work-in-progress meeting topics and notes at:

https://hackmd.io/76o-IxCjQX2mOXO_wwkcpg?both

Best wishes

Sebastian



signature.asc
Description: This is a digitally signed message part
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com