Open AntoinePrv opened 4 years ago
Hello, I wonder if there is a reason why the xtensor_type_caster_base uses xt::xtensor for the signature
xtensor_type_caster_base
xt::xtensor
https://github.com/xtensor-stack/xtensor-python/blob/719b9d13566122c7d63d04ff2394644af35a27ba/include/xtensor-python/xtensor_type_caster_base.hpp#L161
instead of using numpy.ndarray[...]
numpy.ndarray[...]
https://github.com/xtensor-stack/xtensor-python/blob/719b9d13566122c7d63d04ff2394644af35a27ba/include/xtensor-python/pyarray.hpp#L72
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
Good question! Honestly, I don't remember the why of this decision. @SylvainCorlay @wolfv any idea?
Hello, I wonder if there is a reason why the
xtensor_type_caster_base
usesxt::xtensor
for the signaturehttps://github.com/xtensor-stack/xtensor-python/blob/719b9d13566122c7d63d04ff2394644af35a27ba/include/xtensor-python/xtensor_type_caster_base.hpp#L161
instead of using
numpy.ndarray[...]
https://github.com/xtensor-stack/xtensor-python/blob/719b9d13566122c7d63d04ff2394644af35a27ba/include/xtensor-python/pyarray.hpp#L72
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
which seems to work.
I could send a PR if you are interested.
Thank you