★ wanayoo — archive 1999 https://github.com/xtensor-stack/xtensor-python/issues/234Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize xtensor_type_caster_base signature #234

Open
AntoinePrv opened this issue Mar 6, 2020 · 1 comment
Open

Standardize xtensor_type_caster_base signature #234

AntoinePrv opened this issue Mar 6, 2020 · 1 comment

Comments

@AntoinePrv
Copy link

@AntoinePrv AntoinePrv commented Mar 6, 2020

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

@JohanMabille
Copy link
Member

@JohanMabille JohanMabille commented Mar 12, 2020

Good question! Honestly, I don't remember the why of this decision. @SylvainCorlay @wolfv any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.