Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[MNT] Typing: Use Literal for set_loglevel#30301

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

nrnavaneet
Copy link
Contributor

@nrnavaneetnrnavaneet commentedJul 12, 2025
edited
Loading

This PR addresses part of#30257 by improving type safety and IDE support for set_loglevel.

Changes in this PR:

  • Introduced LogLevel as a TypeAlias in matplotlib.typing, using Literal to restrict accepted values.
  • Updated set_loglevel() ininit.py to use LogLevel.

This improves discoverability and static type checking for valid logging levels like "info", "debug", "error", etc.

Related work not included here
MarkerType updates were implemented by@ZPyrolink in#30261
Event type literals for connect methods were contributed by@ZPyrolink in#30275

`Added type hints for LogLevel, RcGroupType, and RcParamKeyType in matplotlib/typing.py``Updated type hints for set_loglevel, rc, and rcParams in matplotlib
nrnavaneetand others added2 commitsJuly 13, 2025 04:03
…amKeyType``Remove tools/update_rcparam_typing.py script``Update matplotlib rc function to accept string group instead of RcGroupType``Remove unused imports and docstrings`
@nrnavaneetnrnavaneet changed the title[MNT] Add Literal type hints for rc, set_loglevel, and RcParams keys[MNT] Typing: Use Literal for set_loglevelJul 12, 2025
@nrnavaneet
Copy link
ContributorAuthor

Hi@timhoffm
I’m still learning and fairly new to contributing. I initially tried addressing all three parts of the issue but ran into a few problems. So I’ve decided to focus on fixing one part at a time to keep things clean and manageable.
Please let me know if anything needs adjusting. I really appreciate the guidance

@nrnavaneetnrnavaneetforce-pushed thefix/use-literal-typing-v2 branch fromd6b7a49 to92b69f7CompareJuly 12, 2025 22:55
@nrnavaneet
Copy link
ContributorAuthor

Hi, I wanted to clarify an issue I’m currently facing.

As part of the initial changes, I had created a temporary script tools/update_rcparam_typing.py to help with regenerating the RcParamKeyType block. I’ve since removed the file from the project, but it still appears in the PR history as both added and deleted, causing the CI check to fail.

I’ve tried resolving it, but I haven’t been able to fix it successfully. I’d really appreciate any guidance on how to clean this up properly, should I rebase and drop that commit, or is there a preferred approach for this situation?

Thanks so much for your patience and support!

@nrnavaneetnrnavaneet deleted the fix/use-literal-typing-v2 branchJuly 12, 2025 23:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@nrnavaneet

[8]ページ先頭

©2009-2025 Movatter.jp