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

Skip to content

Commit 5a3ff4b

Browse files
committed
STY: run black over pyi stub files
STY: whitespace in comment
1 parent ad75461 commit 5a3ff4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4951
-869
lines changed

lib/matplotlib/__init__.pyi

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,30 @@ __all__ = [
44
"set_loglevel",
55
"ExecutableNotFoundError",
66
"get_configdir",
7-
"get_cachedir",
8-
"get_data_path",
7+
"get_cachedir",
8+
"get_data_path",
99
"matplotlib_fname",
10-
"RcParams",
10+
"RcParams",
1111
"rc_params",
1212
"rc_params_from_file",
1313
"rcParamsDefault",
14-
"rcParams",
15-
"rcParamsOrig",
14+
"rcParams",
15+
"rcParamsOrig",
1616
"defaultParams",
1717
"rc",
1818
"rcdefaults",
1919
"rc_file_defaults",
20-
"rc_file",
20+
"rc_file",
2121
"rc_context",
2222
"use",
2323
"get_backend",
24-
"interactive",
24+
"interactive",
2525
"is_interactive",
2626
"default_test_modules",
2727
"colormaps",
2828
"color_sequences",
2929
]
3030

31-
3231
import os
3332
from pathlib import Path
3433

@@ -64,7 +63,6 @@ class _ExecInfo(NamedTuple):
6463
class ExecutableNotFoundError(FileNotFoundError): ...
6564

6665
def _get_executable_info(name: str) -> _ExecInfo: ...
67-
6866
def get_configdir() -> str: ...
6967
def get_cachedir() -> str: ...
7068
def get_data_path() -> str: ...
@@ -81,7 +79,11 @@ class RcParams(dict[str, Any]):
8179
def copy(self) -> RcParams: ...
8280

8381
def rc_params(fail_on_error: bool = ...) -> RcParams: ...
84-
def rc_params_from_file(fname: str | Path | os.PathLike, fail_on_error: bool = ..., use_default_template: bool = ...) -> RcParams: ...
82+
def rc_params_from_file(
83+
fname: str | Path | os.PathLike,
84+
fail_on_error: bool = ...,
85+
use_default_template: bool = ...,
86+
) -> RcParams: ...
8587

8688
rcParamsDefault: RcParams
8789
rcParams: RcParams
@@ -91,20 +93,26 @@ defaultParams: dict[str, Any]
9193
def rc(group: str, **kwargs) -> None: ...
9294
def rcdefaults() -> None: ...
9395
def rc_file_defaults() -> None: ...
94-
def rc_file(fname: str | Path | os.PathLike, *, use_default_template: bool = ...) -> None: ...
95-
96+
def rc_file(
97+
fname: str | Path | os.PathLike, *, use_default_template: bool = ...
98+
) -> None: ...
9699
@contextlib.contextmanager
97-
def rc_context(rc: dict[str, Any] | None = ..., fname: str | Path | os.PathLike | None = ...): ...
98-
100+
def rc_context(
101+
rc: dict[str, Any] | None = ..., fname: str | Path | os.PathLike | None = ...
102+
): ...
99103
def use(backend: str, *, force: bool = ...) -> None: ...
100104
def get_backend() -> str: ...
101105
def interactive(b: bool) -> None: ...
102106
def is_interactive() -> bool: ...
103107

104108
default_test_modules: list[str]
105109

106-
def _preprocess_data(func: Callable | None = ..., *, replace_names: list[str] | None = ..., label_namer: str | None = ...) -> Callable: ...
110+
def _preprocess_data(
111+
func: Callable | None = ...,
112+
*,
113+
replace_names: list[str] | None = ...,
114+
label_namer: str | None = ...
115+
) -> Callable: ...
107116

108117
from matplotlib.cm import _colormaps as colormaps
109118
from matplotlib.colors import _color_sequences as color_sequences
110-

lib/matplotlib/_path.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ from typing import Sequence
22
import numpy as np
33
from .transforms import BboxBase
44

5-
65
def affine_transform(points: np.ndarray, matrix: np.ndarray) -> np.ndarray: ...
76
def count_bboxes_overlapping_bbox(a: BboxBase, bboxes: Sequence[BboxBase]) -> int: ...
87
def update_path_extents(*args, **kwargs): ...

lib/matplotlib/animation.pyi

Lines changed: 101 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ from collections.abc import Generator
33
import contextlib
44
from pathlib import Path
55
from matplotlib import cbook
6-
from matplotlib._animation_data import DISPLAY_TEMPLATE, INCLUDED_FRAMES, JS_INCLUDE, STYLE_INCLUDE
6+
from matplotlib._animation_data import (
7+
DISPLAY_TEMPLATE,
8+
INCLUDED_FRAMES,
9+
JS_INCLUDE,
10+
STYLE_INCLUDE,
11+
)
712
from matplotlib.artist import Artist
813
from matplotlib.backend_bases import TimerBase
914
from matplotlib.figure import Figure
@@ -16,7 +21,9 @@ def adjusted_figsize(w: float, h: float, dpi: float, n: int) -> tuple[float, flo
1621

1722
class MovieWriterRegistry:
1823
def __init__(self) -> None: ...
19-
def register(self, name: str) -> Callable[[Type[AbstractMovieWriter]], Type[AbstractMovieWriter]]: ...
24+
def register(
25+
self, name: str
26+
) -> Callable[[Type[AbstractMovieWriter]], Type[AbstractMovieWriter]]: ...
2027
def is_available(self, name: str) -> bool: ...
2128
def __iter__(self) -> Generator[str, None, None]: ...
2229
def list(self) -> list[str]: ...
@@ -29,7 +36,13 @@ class AbstractMovieWriter(abc.ABC, metaclass=abc.ABCMeta):
2936
metadata: dict[str, str]
3037
codec: str
3138
bitrate: int
32-
def __init__(self, fps: int = ..., metadata: dict[str, str] | None = ..., codec: str | None = ..., bitrate: int | None = ...) -> None: ...
39+
def __init__(
40+
self,
41+
fps: int = ...,
42+
metadata: dict[str, str] | None = ...,
43+
codec: str | None = ...,
44+
bitrate: int | None = ...,
45+
) -> None: ...
3346
outfile: str | Path
3447
fig: Figure
3548
dpi: float
@@ -42,15 +55,23 @@ class AbstractMovieWriter(abc.ABC, metaclass=abc.ABCMeta):
4255
def grab_frame(self, **savefig_kwargs) -> None: ...
4356
@abc.abstractmethod
4457
def finish(self) -> None: ...
45-
4658
@contextlib.contextmanager
47-
def saving(self, fig: Figure, outfile: str | Path, dpi: float | None, *args, **kwargs) -> Generator[AbstractMovieWriter, None, None]: ...
59+
def saving(
60+
self, fig: Figure, outfile: str | Path, dpi: float | None, *args, **kwargs
61+
) -> Generator[AbstractMovieWriter, None, None]: ...
4862

4963
class MovieWriter(AbstractMovieWriter):
5064
supported_formats: list[str]
5165
frame_format: str
5266
extra_args: list[str] | None
53-
def __init__(self, fps: int = ..., codec: str | None = ..., bitrate: int | None = ..., extra_args: list[str] | None = ..., metadata: dict[str, str] | None = ...) -> None: ...
67+
def __init__(
68+
self,
69+
fps: int = ...,
70+
codec: str | None = ...,
71+
bitrate: int | None = ...,
72+
extra_args: list[str] | None = ...,
73+
metadata: dict[str, str] | None = ...,
74+
) -> None: ...
5475
def setup(self, fig: Figure, outfile: str | Path, dpi: float | None = ...): ...
5576
def grab_frame(self, **savefig_kwargs) -> None: ...
5677
def finish(self) -> None: ...
@@ -65,7 +86,13 @@ class FileMovieWriter(MovieWriter):
6586
dpi: float
6687
temp_prefix: str
6788
fname_format_str: str
68-
def setup(self, fig: Figure, outfile: str | Path, dpi: float | None = ..., frame_prefix: str | Path | None = ...) -> None: ...
89+
def setup(
90+
self,
91+
fig: Figure,
92+
outfile: str | Path,
93+
dpi: float | None = ...,
94+
frame_prefix: str | Path | None = ...,
95+
) -> None: ...
6996
def __del__(self) -> None: ...
7097
@property
7198
def frame_format(self) -> str: ...
@@ -75,7 +102,9 @@ class FileMovieWriter(MovieWriter):
75102
class PillowWriter(AbstractMovieWriter):
76103
@classmethod
77104
def isAvailable(cls) -> bool: ...
78-
def setup(self, fig: Figure, outfile: str | Path, dpi: float | None = ...) -> None: ...
105+
def setup(
106+
self, fig: Figure, outfile: str | Path, dpi: float | None = ...
107+
) -> None: ...
79108
def grab_frame(self, **savefig_kwargs) -> None: ...
80109
def finish(self) -> None: ...
81110

@@ -109,31 +138,88 @@ class HTMLWriter(FileMovieWriter):
109138
def isAvailable(cls) -> bool: ...
110139
embed_frames: bool
111140
default_mode: str
112-
def __init__(self, fps: int = ..., codec: str | None = ..., bitrate: int | None = ..., extra_args: list[str] | None = ..., metadata: dict[str, str] | None = ..., embed_frames: bool = ..., default_mode: str = ..., embed_limit: float | None = ...) -> None: ...
113-
def setup(self, fig: Figure, outfile: str | Path, dpi: float | None = ..., frame_dir: str | Path | None = ...) -> None: ...
141+
def __init__(
142+
self,
143+
fps: int = ...,
144+
codec: str | None = ...,
145+
bitrate: int | None = ...,
146+
extra_args: list[str] | None = ...,
147+
metadata: dict[str, str] | None = ...,
148+
embed_frames: bool = ...,
149+
default_mode: str = ...,
150+
embed_limit: float | None = ...,
151+
) -> None: ...
152+
def setup(
153+
self,
154+
fig: Figure,
155+
outfile: str | Path,
156+
dpi: float | None = ...,
157+
frame_dir: str | Path | None = ...,
158+
) -> None: ...
114159
def grab_frame(self, **savefig_kwargs): ...
115160
def finish(self) -> None: ...
116161

117162
class Animation:
118163
frame_seq: Iterable[Artist]
119164
event_source: Any
120-
def __init__(self, fig: Figure, event_source: Any | None = ..., blit: bool = ...) -> None: ...
165+
def __init__(
166+
self, fig: Figure, event_source: Any | None = ..., blit: bool = ...
167+
) -> None: ...
121168
def __del__(self) -> None: ...
122-
def save(self, filename: str | Path, writer: MovieWriter | str | None = ..., fps: int | None = ..., dpi: float | None = ..., codec: str | None = ..., bitrate: int | None = ..., extra_args: list[str] | None = ..., metadata: dict[str, str] | None = ..., extra_anim: list[Animation] | None = ..., savefig_kwargs: dict[str, Any] | None = ..., *, progress_callback: Callable[[int, int], Any] | None = ...) -> None: ...
169+
def save(
170+
self,
171+
filename: str | Path,
172+
writer: MovieWriter | str | None = ...,
173+
fps: int | None = ...,
174+
dpi: float | None = ...,
175+
codec: str | None = ...,
176+
bitrate: int | None = ...,
177+
extra_args: list[str] | None = ...,
178+
metadata: dict[str, str] | None = ...,
179+
extra_anim: list[Animation] | None = ...,
180+
savefig_kwargs: dict[str, Any] | None = ...,
181+
*,
182+
progress_callback: Callable[[int, int], Any] | None = ...
183+
) -> None: ...
123184
def new_frame_seq(self) -> Iterable[Artist]: ...
124185
def new_saved_frame_seq(self) -> Iterable[Artist]: ...
125186
def to_html5_video(self, embed_limit: float | None = ...) -> str: ...
126-
def to_jshtml(self, fps: int | None = ..., embed_frames: bool = ..., default_mode: str | None = ...) -> str: ...
187+
def to_jshtml(
188+
self,
189+
fps: int | None = ...,
190+
embed_frames: bool = ...,
191+
default_mode: str | None = ...,
192+
) -> str: ...
127193
def pause(self) -> None: ...
128194
def resume(self) -> None: ...
129195

130196
class TimedAnimation(Animation):
131197
repeat: bool
132-
def __init__(self, fig: Figure, interval: int = ..., repeat_delay: int = ..., repeat: bool = ..., event_source: TimerBase | None = ..., *args, **kwargs) -> None: ...
198+
def __init__(
199+
self,
200+
fig: Figure,
201+
interval: int = ...,
202+
repeat_delay: int = ...,
203+
repeat: bool = ...,
204+
event_source: TimerBase | None = ...,
205+
*args,
206+
**kwargs
207+
) -> None: ...
133208

134209
class ArtistAnimation(TimedAnimation):
135210
def __init__(self, fig: Figure, artists: list[Artist], *args, **kwargs) -> None: ...
136211

137212
class FuncAnimation(TimedAnimation):
138213
save_count: int
139-
def __init__(self, fig: Figure, func: Callable[..., Iterable[Artist]], frames: Iterable[Artist] | int | Generator[Artist, None, None] | None = ..., init_func: Callable[[], Iterable[Artist]] | None = ..., fargs: tuple[Any, ...] | None = ..., save_count: int | None = ..., *, cache_frame_data: bool = ..., **kwargs) -> None: ...
214+
def __init__(
215+
self,
216+
fig: Figure,
217+
func: Callable[..., Iterable[Artist]],
218+
frames: Iterable[Artist] | int | Generator[Artist, None, None] | None = ...,
219+
init_func: Callable[[], Iterable[Artist]] | None = ...,
220+
fargs: tuple[Any, ...] | None = ...,
221+
save_count: int | None = ...,
222+
*,
223+
cache_frame_data: bool = ...,
224+
**kwargs
225+
) -> None: ...

0 commit comments

Comments
 (0)