Skip to content
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

Fix some bugs found by typing #26444

Merged
merged 4 commits into from Aug 3, 2023
Merged

Fix some bugs found by typing #26444

merged 4 commits into from Aug 3, 2023

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 3, 2023

PR summary

There are 3 changes here:

  • When iterables were added to Table.auto_set_column_width in bug fix related #5479 #6047, the test added a string. Typing correctly points out that that is not accepted, and in fact it does not do anything (as shown in the test image) because column keys are ints, not strings, so the automatic width calculation is applied to nothing. So deprecate accepting random types here.
  • Fonts.used_characters was removed in Cleanup _mathtext internal API #22204, but Fonts.get_used_characters (which just returns that attribute) was not. This is private and can be removed directly, AFAICT.
  • The find_tex_file monkey patch in the test returned the wrong type, which doesn't technically break anything, but was confusing when comparing with the type stubs.

PR checklist

@QuLogic QuLogic added this to the v3.8.0 milestone Aug 3, 2023
When iterables were added in matplotlib#6047, the test added a string. Typing
correctly points out that that is not accepted, and in fact it does not
do anything (as shown in the test image) because column keys are ints,
not strings.
This is never called, is on an internal class, and the attribute it
accesses doesn't exist as it was removed in matplotlib#22204.
The normal function returns a `str`, so this patch returning bytes is
confusing.
`LogFormatterSciNotation.sublabel` is not an attribute that exists.
There is the private `LogFormatterSciNotation._sublabels`, but this
obviously doesn't need to be set as the test is already passing.
@QuLogic
Copy link
Member Author

QuLogic commented Aug 3, 2023

Found one more thing: LogFormatterSciNotation.sublabel does not exist, so it did not have any effect in the test that set it. I've removed the line.

@tacaswell tacaswell merged commit aa3e00d into matplotlib:main Aug 3, 2023
39 checks passed
@QuLogic QuLogic deleted the type-bugs branch August 3, 2023 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants