FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[ENH]: A data-type check is missed in cm.ScalarMappable.set_array() · Issue #21095 · matplotlib/matplotlib · GitHub

Repository navigation

[ENH]: A data-type check is missed in cm.ScalarMappable.set_array() #21095

Description

Problem

If a list is introduced to cm.ScalarMappable.set_array() method, no error is raised and, nevertheless, probably an error will be raised.

At least, it's raised when using collections:

AttributeError: 'list' object has no attribute 'ndim'

Proposed solution

I think it could be great to add a data type check when data is introduced to this method Although the own name of the method means that the enter data-type must be a numpy array, I think it could be less messy if an exception (or something similar) would be added within this method.

Additional context and prior art

No response

Activity

  1. jklymak commented on Sep 16, 2021

    Member

    Thanks for reporting this. Can you provide a runnable example?

  2. added
    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …
    and removed on Sep 16, 2021
  3. anntzer commented on Sep 16, 2021

    Contributor

    This is almost certainly fixed by #18870 in matplotlib 3.5. Feel free to reopen if not.

  4. added this to the v3.5.0 milestone on Sep 16, 2021
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

    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL