Skip to content

ArrayRef instead of ArrayBase in function interfaces #563

Description

@Muthsera

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions