Skip to main content

Module array_subclass

Module array_subclass 

Source
Expand description

Array subclass support for duck-typed Python objects.

Provides utilities to accept any Python object that looks like an array:

  • NumPy ndarrays (via __array__ protocol)
  • pandas Series (has a .values attribute returning an ndarray)
  • Any list-like object supporting __len__ and __getitem__

Also exposes SubclassArrayWrapper, a #[pyclass] that wraps a flat f64 buffer with shape metadata and looks enough like a NumPy array for downstream code that uses duck-typing.

Structs§

SubclassArrayWrapper
A Python-visible wrapper around a flat f64 data buffer with shape metadata.

Functions§

from_array_like_f32
Extract f32 values from any Python array-like object.
from_array_like_f64
Extract f64 values from any Python array-like object.
register_array_subclass_module
Register array-subclass helpers and SubclassArrayWrapper into a PyO3 module.