Skip to content

Dynamically typed xarray #2104

Open
Open
@davidbrochart

Description

@davidbrochart

In xtensor-stack/xtensor-zarr#1 we will need to "discover" an array from e.g. a file, and the data type will be encoded in the metadata. This means that the array's element type will only be known at run-time. Thus, we won't be able to do something like the following if the array is an xarray:

auto a = get_array(from_file);

because xarray's dtype is a template parameter and must be known at compile-time.
Type erasure techniques involve dealing with pointers, so I guess we don't want to go in that direction because we don't want the user to use array pointers and all the complexity that comes with it.
Instead, it would be interesting to have a dynamically typed version of xarray, maybe xdtyped_array?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions