Skip to content

Conversation

@has2k1
Copy link
Contributor

@has2k1 has2k1 commented Dec 11, 2025

PR summary

Do not fail when marker values are numpy integers e.g. np.int64(4).

The rationale is, matplotlib exists in an ecosystem where pandas and numpy container types are prevalent. When the containers (pd.Series, np.array) contain only integer values, they do not preserve the original int type when the values come out. i.e. ints go in np.int64s come out. With this PR an int type marker that goes into these containers will still recognised as a marker when it comes out.

closes #30836

PR checklist

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained in #30836, I think this is the wrong approach. If we go down this road, next somebody will come along and requests support for pytorch.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are a library that supports Numpy. I don't think this is overly scope-creep to accept numpy integers here.

This is a better expression of intent for a change introduced in commit
#2e5f5ff.
@timhoffm timhoffm dismissed their stale review December 23, 2025 22:51

Seems justifiable, so I won’t block. Nevertheless I think the numeric markers a a design flaw, and we should work on replacements and discourage their use rather than trying to make them work better for edge cases.

Copy link
Contributor

@scottshambaugh scottshambaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line with the robustness principle, I think the more liberal Hashable check is appropriate. I don't see an a-priori reason to restrict the types here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Markers can be integers, but numpy integers fail

5 participants