Hi,
I frequently find myself wanting a read-only array in Python backed by a Rust-owned buffer (usually to print it in an interactive session).
For this I use PyArray::borrow_from_array which takes a &ArrayBase as parameter.
I would like this function to take a &ArrayRef instead to be able to use it with a greater variety of arguments.
While this is a breaking change, I reckon the necessary code changes at call sites would be small, since ArrayBase already implements Deref<Target=ArrayRef>.
In my quick search I only found a couple of places, where this proposed change could be applied
Another consequence would be to bump the minimum version of the ndarray dependency to 0.17.1.
Kind regards!
Hi,
I frequently find myself wanting a read-only array in Python backed by a Rust-owned buffer (usually to print it in an interactive session).
For this I use
PyArray::borrow_from_arraywhich takes a&ArrayBaseas parameter.I would like this function to take a
&ArrayRefinstead to be able to use it with a greater variety of arguments.While this is a breaking change, I reckon the necessary code changes at call sites would be small, since
ArrayBasealready implementsDeref<Target=ArrayRef>.In my quick search I only found a couple of places, where this proposed change could be applied
PyArray::borrow_from_array,PyArray::from_array,impl ToPyArray for ArrayRef(? not sure about this one).Another consequence would be to bump the minimum version of the ndarray dependency to 0.17.1.
Kind regards!