@@ -3,7 +3,12 @@ from collections.abc import Generator
3
3
import contextlib
4
4
from pathlib import Path
5
5
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
+ )
7
12
from matplotlib .artist import Artist
8
13
from matplotlib .backend_bases import TimerBase
9
14
from matplotlib .figure import Figure
@@ -16,7 +21,9 @@ def adjusted_figsize(w: float, h: float, dpi: float, n: int) -> tuple[float, flo
16
21
17
22
class MovieWriterRegistry :
18
23
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 ]]: ...
20
27
def is_available (self , name : str ) -> bool : ...
21
28
def __iter__ (self ) -> Generator [str , None , None ]: ...
22
29
def list (self ) -> list [str ]: ...
@@ -29,7 +36,13 @@ class AbstractMovieWriter(abc.ABC, metaclass=abc.ABCMeta):
29
36
metadata : dict [str , str ]
30
37
codec : str
31
38
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 : ...
33
46
outfile : str | Path
34
47
fig : Figure
35
48
dpi : float
@@ -42,15 +55,23 @@ class AbstractMovieWriter(abc.ABC, metaclass=abc.ABCMeta):
42
55
def grab_frame (self , ** savefig_kwargs ) -> None : ...
43
56
@abc .abstractmethod
44
57
def finish (self ) -> None : ...
45
-
46
58
@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 ]: ...
48
62
49
63
class MovieWriter (AbstractMovieWriter ):
50
64
supported_formats : list [str ]
51
65
frame_format : str
52
66
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 : ...
54
75
def setup (self , fig : Figure , outfile : str | Path , dpi : float | None = ...): ...
55
76
def grab_frame (self , ** savefig_kwargs ) -> None : ...
56
77
def finish (self ) -> None : ...
@@ -65,7 +86,13 @@ class FileMovieWriter(MovieWriter):
65
86
dpi : float
66
87
temp_prefix : str
67
88
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 : ...
69
96
def __del__ (self ) -> None : ...
70
97
@property
71
98
def frame_format (self ) -> str : ...
@@ -75,7 +102,9 @@ class FileMovieWriter(MovieWriter):
75
102
class PillowWriter (AbstractMovieWriter ):
76
103
@classmethod
77
104
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 : ...
79
108
def grab_frame (self , ** savefig_kwargs ) -> None : ...
80
109
def finish (self ) -> None : ...
81
110
@@ -109,31 +138,88 @@ class HTMLWriter(FileMovieWriter):
109
138
def isAvailable (cls ) -> bool : ...
110
139
embed_frames : bool
111
140
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 : ...
114
159
def grab_frame (self , ** savefig_kwargs ): ...
115
160
def finish (self ) -> None : ...
116
161
117
162
class Animation :
118
163
frame_seq : Iterable [Artist ]
119
164
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 : ...
121
168
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 : ...
123
184
def new_frame_seq (self ) -> Iterable [Artist ]: ...
124
185
def new_saved_frame_seq (self ) -> Iterable [Artist ]: ...
125
186
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 : ...
127
193
def pause (self ) -> None : ...
128
194
def resume (self ) -> None : ...
129
195
130
196
class TimedAnimation (Animation ):
131
197
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 : ...
133
208
134
209
class ArtistAnimation (TimedAnimation ):
135
210
def __init__ (self , fig : Figure , artists : list [Artist ], * args , ** kwargs ) -> None : ...
136
211
137
212
class FuncAnimation (TimedAnimation ):
138
213
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