Skip to content

Type for an array of dynamic scalar type? #985

Closed
@drewm1980

Description

@drewm1980

I am working on code that deserializes data that originated from numpy (but is in a nonstandard serialized format), and could have any of the supported scalar types from numpy (but in practice I'll only support rust native numeric types).

Every type I've found in the API is (compile-time) generic over the contained scalar type (f32,f64,...), but I need a type where the scalar type is dynamic for the return value of my deserializer.

Is this already supported by the ndarray crate? An option is to roll my own enum around ndarray's concrete types.

For example, the image library has this as the return type of their deserializer: https://docs.rs/image/0.23.14/image/enum.DynamicImage.html

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