Expand description
NumPy array protocol (__array__ and __array_interface__) support.
The NumPy array protocol enables Python objects to be converted to NumPy arrays via two mechanisms:
__array__(dtype=None)— a method that returns anumpy.ndarray.__array_interface__— a property returning a Python dict describing the underlying buffer (shape, dtype string, raw pointer, etc.).
The array interface dictionary format follows: https://numpy.org/doc/stable/reference/arrays.interface.html
Structs§
- Array
Interface Dict - Data for the
__array_interface__protocol dictionary. - NdArray
Wrapper - A concrete array type implementing the NumPy
__array__and__array_interface__protocols.
Enums§
- Array
Protocol Error - Errors produced by the array-protocol layer.
Traits§
- Array
Protocol - Mixin trait for types that support the NumPy array interface protocol.
Functions§
- parse_
typestr - Parse a NumPy type-string into
(kind_char, byte_count). - register_
array_ protocol_ module - Register array-protocol classes into a PyO3 module.