Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cleanup converter docs and StrCategoryConverter behavior #29059

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

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

ksunden
Copy link
Member

@ksunden ksunden commented Oct 31, 2024

  • Use getter in docs
  • Use a single instance of StrCategoryConverter for all types
    • avoids warning since some methods convert to np.str_ and others are
      just str, which previously got separate instances
    • added test

PR summary

PR checklist

- Use getter in docs
- Use a single instance of StrCategoryConverter for all types
  - avoids warning since some methods convert to `np.str_` and others are
    just `str`, which previously got separate instances
  - added test
@github-actions github-actions bot added topic: categorical Documentation: user guide files in galleries/users_explain or doc/users labels Oct 31, 2024
@ksunden ksunden added this to the v3.10.0 milestone Oct 31, 2024
@story645
Copy link
Member

story645 commented Nov 1, 2024

What happens if folks try to plot strings of three different types on the same axis? (Or is that equivalent to the methods converting internally to different string types?)

@ksunden
Copy link
Member Author

ksunden commented Nov 1, 2024

It is equivalent, we just had different instances for no real reason, as the converter instance is portable between types. we do a single instance for the various date types which work similarly.

@story645
Copy link
Member

story645 commented Nov 1, 2024

, we just had different instances for no real reason,

cause I copy pasted from how dates did it 😅

ax.plot(['a', 'b', 'd'], ['f', 'a', 'b'])
ax.bar(['b', 'c', 'd'], ['g', 'e', 'd'])
axis_test(ax.xaxis, ['a', 'b', 'd', 'c'])
axis_test(ax.yaxis, ['e', 'g', 'f', 'a', 'b', 'd'])
Copy link
Member

Choose a reason for hiding this comment

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

b doesn't end up on the yaxis so I don't think this test should pass?

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, just saw the b 🤦

@ksunden
Copy link
Member Author

ksunden commented Nov 1, 2024

doc failure is #29058

@ksunden
Copy link
Member Author

ksunden commented Nov 1, 2024

Failures are unrelated, merging so I can get 3.10 out since we have two approvals

Appveyor was the stochastic test_determinism timeout error

@ksunden ksunden merged commit 8f3b029 into matplotlib:main Nov 1, 2024
39 of 42 checks passed
@ksunden ksunden deleted the converter_cleanup branch November 1, 2024 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: user guide files in galleries/users_explain or doc/users topic: categorical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants