GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Standardize xtensor_type_caster_base signature · Issue #234 · xtensor-stack/xtensor-python

Standardize xtensor_type_caster_base signature #234

New issue
Copy link
New issue
Copy link
Open
Open
Standardize xtensor_type_caster_base signature#234
Copy link

Description

@AntoinePrv
AntoinePrv
opened on Mar 6, 2020
Issue body actions

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

xtensor-python/include/xtensor-python/xtensor_type_caster_base.hpp

Line 161 in 719b9d1

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

instead of using numpy.ndarray[...]

xtensor-python/include/xtensor-python/pyarray.hpp

Line 72 in 719b9d1

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

  1. JohanMabille commented on Mar 12, 2020

    @JohanMabille
    JohanMabille
    on Mar 12, 2020
    Member
    More actions

    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

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

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.