Skip to content

Array bounds/contains check? #1247

Open
@mcclure

Description

@mcclure

I find myself very frequently having a coordinate and an ndarray Array2/Array3. I want to check whether the coordinate is within the bounds of the Array2/Array3 (IE, gte than 0,0,0, less than the array size). There doesn't appear to be a way to do this. There is "get" to return a value or None but that is not the same thing. Sometimes I want to know if the value is inbounds without, at that time, accessing the value.

It would be helpful to add a within(), contains() etc function to ArrayBase (I think adding it to Dim would also serve equivalent purposes).

(If this already exists and I just missed it, sorry)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions