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#30302

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

Open
nrnavaneet wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromnrnavaneet:fix/literal-typing-setloglevel
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletionlib/matplotlib/__init__.pyi
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,8 @@ from packaging.version import Version

from matplotlib._api import MatplotlibDeprecationWarning
from typing import Any, Literal, NamedTuple, overload
from matplotlib.typing import LogLevel


class _VersionInfo(NamedTuple):
major: int
Expand All@@ -52,7 +54,7 @@ __bibtex__: str
__version__: str
__version_info__: _VersionInfo

def set_loglevel(level:str) -> None: ...
def set_loglevel(level:LogLevel) -> None: ...

class _ExecInfo(NamedTuple):
executable: str
Expand Down
3 changes: 2 additions & 1 deletionlib/matplotlib/pyplot.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,6 +144,7 @@
MouseEventType,
PickEventType,
ResizeEventType,
LogLevel
)
frommatplotlib.widgetsimportSubplotTool

Expand DownExpand Up@@ -351,7 +352,7 @@ def uninstall_repl_displayhook() -> None:

# Ensure this appears in the pyplot docs.
@_copy_docstring_and_deprecators(matplotlib.set_loglevel)
defset_loglevel(level:str)->None:
defset_loglevel(level:LogLevel)->None:
returnmatplotlib.set_loglevel(level)


Expand Down
3 changes: 3 additions & 0 deletionslib/matplotlib/typing.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,6 +83,9 @@
CapStyleType: TypeAlias = CapStyle | Literal["butt", "projecting", "round"]
"""Line cap styles. See :doc:`/gallery/lines_bars_and_markers/capstyle`."""

LogLevel: TypeAlias = Literal["notset", "debug", "info", "warning", "error", "critical"]
"""Literal type for valid logging levels accepted by `set_loglevel()`."""

CoordsBaseType = Union[
str,
Artist,
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp