Closed
Description
For all objects that expose the __array_interface__
, we should add a helper member function called .to_numpy()
that does nothing but create a view:
np.array(self, copy=False, order='F')
cupy.array(self, copy=False, order='F')
Similar to:
- https://github.com/openPMD/openPMD-api/blob/b05171d371fe9568149ef58ae60ee113f4d0c4b4/examples/11_particle_dataframe.py#L34
- https://github.com/openPMD/openPMD-api/blob/b05171d371fe9568149ef58ae60ee113f4d0c4b4/examples/11_particle_dataframe.py#L49
- https://github.com/openPMD/openPMD-api/blob/b05171d371fe9568149ef58ae60ee113f4d0c4b4/examples/11_particle_dataframe.py#L87
Equivalently, we want to add .to_copy()
et al. functions for #30 and later DLPack interfaces.