Skip to content

Standardize xtensor_type_caster_base signature #234

Description

@AntoinePrv

Hello,
I wonder if there is a reason why the xtensor_type_caster_base uses xt::xtensor for the signature

static constexpr auto name = _("xt::xtensor");

instead of using numpy.ndarray[...]

PYBIND11_TYPE_CASTER(type, _("numpy.ndarray[") + npy_format_descriptor<T>::name + _("]"));

In my opinion, using the Numpy name is more descriptive to a Python user, and actually matches the type.

I made a quick test using

_("numpy.ndarray[") + npy_format_descriptor<typename Type::value_type>::name + _("]");

which seems to work.

I could send a PR if you are interested.

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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