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

Commit65ba01b

Browse files
committed
Enable linting of .pyi files
1 parenta30354e commit65ba01b

32 files changed

+305
-122
lines changed

‎lib/matplotlib/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ __all__ = [
2626
"interactive",
2727
"is_interactive",
2828
"colormaps",
29+
"multivar_colormaps",
30+
"bivar_colormaps",
2931
"color_sequences",
3032
]
3133

‎lib/matplotlib/_enums.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
fromtypingimportcast
21
fromenumimportEnum
32

43

‎lib/matplotlib/_path.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ import numpy as np
55
from .transformsimportBboxBase
66

77
defaffine_transform(points:np.ndarray,trans:np.ndarray)->np.ndarray: ...
8-
defcount_bboxes_overlapping_bbox(bbox:BboxBase,bboxes:Sequence[BboxBase])->int: ...
8+
defcount_bboxes_overlapping_bbox(
9+
bbox:BboxBase,bboxes:Sequence[BboxBase]
10+
)->int: ...

‎lib/matplotlib/_tri.pyi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import numpy.typing as npt
77
@final
88
classTrapezoidMapTriFinder:
99
def__init__(self,triangulation:Triangulation): ...
10-
deffind_many(self,x:npt.NDArray[np.float64],y:npt.NDArray[np.float64])->npt.NDArray[np.int_]: ...
10+
deffind_many(
11+
self,x:npt.NDArray[np.float64],y:npt.NDArray[np.float64]
12+
)->npt.NDArray[np.int_]: ...
1113
defget_tree_stats(self)->list[int|float]: ...
1214
definitialize(self)->None: ...
1315
defprint_tree(self)->None: ...
@@ -16,7 +18,9 @@ class TrapezoidMapTriFinder:
1618
classTriContourGenerator:
1719
def__init__(self,triangulation:Triangulation,z:npt.NDArray[np.float64]): ...
1820
defcreate_contour(self,level:float)->tuple[list[float],list[int]]: ...
19-
defcreate_filled_contour(self,lower_level:float,upper_level:float)->tuple[list[float],list[int]]: ...
21+
defcreate_filled_contour(
22+
self,lower_level:float,upper_level:float
23+
)->tuple[list[float],list[int]]: ...
2024

2125
@final
2226
classTriangulation:
@@ -30,7 +34,9 @@ class Triangulation:
3034
neighbors:npt.NDArray[np.int_]|tuple[()],
3135
correct_triangle_orientation:bool,
3236
): ...
33-
defcalculate_plane_coefficients(self,z:npt.ArrayLike)->npt.NDArray[np.float64]: ...
37+
defcalculate_plane_coefficients(
38+
self,z:npt.ArrayLike
39+
)->npt.NDArray[np.float64]: ...
3440
defget_edges(self)->npt.NDArray[np.int_]: ...
3541
defget_neighbors(self)->npt.NDArray[np.int_]: ...
3642
defset_mask(self,mask:npt.NDArray[np.bool_]|tuple[()])->None: ...

‎lib/matplotlib/animation.pyi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ class AbstractMovieWriter(abc.ABC, metaclass=abc.ABCMeta):
4141
dpi:float
4242

4343
@abc.abstractmethod
44-
defsetup(self,fig:Figure,outfile:str|Path,dpi:float|None= ...)->None: ...
44+
defsetup(
45+
self,fig:Figure,outfile:str|Path,dpi:float|None= ...
46+
)->None: ...
4547
@property
4648
defframe_size(self)->tuple[int,int]: ...
4749
@abc.abstractmethod
@@ -65,7 +67,9 @@ class MovieWriter(AbstractMovieWriter):
6567
extra_args:list[str]|None= ...,
6668
metadata:dict[str,str]|None= ...,
6769
)->None: ...
68-
defsetup(self,fig:Figure,outfile:str|Path,dpi:float|None= ...)->None: ...
70+
defsetup(
71+
self,fig:Figure,outfile:str|Path,dpi:float|None= ...
72+
)->None: ...
6973
defgrab_frame(self,**savefig_kwargs)->None: ...
7074
deffinish(self)->None: ...
7175
@classmethod
@@ -200,7 +204,9 @@ class TimedAnimation(Animation):
200204
)->None: ...
201205

202206
classArtistAnimation(TimedAnimation):
203-
def__init__(self,fig:Figure,artists:Sequence[Collection[Artist]],*args,**kwargs)->None: ...
207+
def__init__(
208+
self,fig:Figure,artists:Sequence[Collection[Artist]],*args,**kwargs
209+
)->None: ...
204210

205211
classFuncAnimation(TimedAnimation):
206212
def__init__(

‎lib/matplotlib/artist.pyi

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,14 @@ class Artist:
114114
defset_clip_on(self,b:bool)->None: ...
115115
defget_rasterized(self)->bool: ...
116116
defset_rasterized(self,rasterized:bool)->None: ...
117-
defget_agg_filter(self)->Callable[[ArrayLike,float],tuple[np.ndarray,float,float]]|None: ...
117+
defget_agg_filter(self)->Callable[
118+
[ArrayLike,float],tuple[np.ndarray,float,float]
119+
]|None: ...
118120
defset_agg_filter(
119-
self,filter_func:Callable[[ArrayLike,float],tuple[np.ndarray,float,float]]|None
121+
self,
122+
filter_func:Callable[
123+
[ArrayLike,float],tuple[np.ndarray,float,float]
124+
]|None
120125
)->None: ...
121126
defdraw(self,renderer:RendererBase)->None: ...
122127
defset_alpha(self,alpha:float|None)->None: ...
@@ -193,5 +198,7 @@ def getp(obj: Artist, property: str | None = ...) -> Any: ...
193198

194199
get=getp
195200

196-
defsetp(obj:Artist,*args,file:TextIO|None= ...,**kwargs)->list[Any]|None: ...
201+
defsetp(
202+
obj:Artist,*args,file:TextIO|None= ...,**kwargs
203+
)->list[Any]|None: ...
197204
defkwdoc(artist:Artist|type[Artist]|Iterable[Artist|type[Artist]])->str: ...

‎lib/matplotlib/axes/_axes.pyi

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ from matplotlib.axes._base import _AxesBase
22
frommatplotlib.axes._secondary_axesimportSecondaryAxis
33

44
frommatplotlib.artistimportArtist
5-
frommatplotlib.backend_basesimportRendererBase
65
frommatplotlib.collectionsimport (
76
Collection,
87
FillBetweenPolyCollection,
@@ -32,7 +31,6 @@ import matplotlib.table as mtable
3231
importmatplotlib.stackplotasmstack
3332
importmatplotlib.streamplotasmstream
3433

35-
importdatetime
3634
importPIL.Image
3735
fromcollections.abcimportCallable,Iterable,Sequence
3836
fromtypingimportAny,Literal,overload
@@ -60,9 +58,16 @@ class Axes(_AxesBase):
6058
@overload
6159
deflegend(self)->Legend: ...
6260
@overload
63-
deflegend(self,handles:Iterable[Artist|tuple[Artist, ...]],labels:Iterable[str],**kwargs)->Legend: ...
61+
deflegend(
62+
self,
63+
handles:Iterable[Artist|tuple[Artist, ...]],
64+
labels:Iterable[str],
65+
**kwargs
66+
)->Legend: ...
6467
@overload
65-
deflegend(self,*,handles:Iterable[Artist|tuple[Artist, ...]],**kwargs)->Legend: ...
68+
deflegend(
69+
self,*,handles:Iterable[Artist|tuple[Artist, ...]],**kwargs
70+
)->Legend: ...
6671
@overload
6772
deflegend(self,labels:Iterable[str],**kwargs)->Legend: ...
6873
@overload
@@ -401,7 +406,8 @@ class Axes(_AxesBase):
401406
vmax:float|None= ...,
402407
alpha:float|None= ...,
403408
linewidths:float|Sequence[float]|None= ...,
404-
edgecolors:Literal["face","none"]|ColorType|Sequence[ColorType]|None= ...,
409+
edgecolors:Literal["face","none"]|ColorType|Sequence[ColorType]|None=
410+
...,
405411
colorizer:Colorizer|None= ...,
406412
plotnonfinite:bool= ...,
407413
data=...,

‎lib/matplotlib/axes/_base.pyi

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,9 @@ class _AxesBase(martist.Artist):
367367
defget_navigate(self)->bool: ...
368368
defset_navigate(self,b:bool)->None: ...
369369
defget_forward_navigation_events(self)->bool|Literal["auto"]: ...
370-
defset_forward_navigation_events(self,forward:bool|Literal["auto"])->None: ...
370+
defset_forward_navigation_events(
371+
self,forward:bool|Literal["auto"]
372+
)->None: ...
371373
defget_navigate_mode(self)->Literal["PAN","ZOOM"]|None: ...
372374
defset_navigate_mode(self,b:Literal["PAN","ZOOM"]|None)->None: ...
373375
defstart_pan(self,x:float,y:float,button:MouseButton)->None: ...
@@ -393,9 +395,10 @@ class _AxesBase(martist.Artist):
393395
deflabel_outer(self,remove_inner_ticks:bool= ...)->None: ...
394396

395397
# The methods underneath this line are added via the `_axis_method_wrapper` class
396-
# Initially they are set to an object, but that object uses `__set_name__` to override
397-
# itself with a method modified from the Axis methods for the x or y Axis.
398-
# As such, they are typed according to the resultant method rather than as that object.
398+
# Initially they are set to an object, but that object uses `__set_name__` to
399+
# override itself with a method modified from the Axis methods for the x or y Axis.
400+
# As such, they are typed according to the resultant method rather than as
401+
# that object.
399402

400403
defget_xgridlines(self)->list[Line2D]: ...
401404
defget_xticklines(self,minor:bool= ...)->list[Line2D]: ...

‎lib/matplotlib/axes/_secondary_axes.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ class SecondaryAxis(_AxesBase):
3939
)->list[Tick]: ...
4040
defset_functions(
4141
self,
42-
functions:tuple[Callable[[ArrayLike],ArrayLike],Callable[[ArrayLike],ArrayLike]]|Transform,
42+
functions:tuple[
43+
Callable[[ArrayLike],ArrayLike],Callable[[ArrayLike],ArrayLike]
44+
]|Transform,
4345
)->None: ...
4446
defset_aspect(self,*args,**kwargs)->None: ...
4547
defset_color(self,color:ColorType)->None: ...

‎lib/matplotlib/backend_bases.pyi

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class RendererBase:
106106
prop:FontProperties,
107107
angle:float,
108108
*,
109-
mtext:Text|None= ...
109+
mtext:Text|None= ...,
110110
)->None: ...
111111
defdraw_text(
112112
self,
@@ -275,7 +275,7 @@ class PickEvent(Event):
275275
mouseevent:MouseEvent,
276276
artist:Artist,
277277
guiEvent:Any|None= ...,
278-
**kwargs
278+
**kwargs,
279279
)->None: ...
280280

281281
classKeyEvent(LocationEvent):
@@ -344,7 +344,7 @@ class FigureCanvasBase:
344344
pad_inches:float|None= ...,
345345
bbox_extra_artists:list[Artist]|None= ...,
346346
backend:str|None= ...,
347-
**kwargs
347+
**kwargs,
348348
)->Any: ...
349349
@classmethod
350350
defget_default_filetype(cls)->str: ...
@@ -366,23 +366,24 @@ class FigureCanvasBase:
366366
],
367367
func:Callable[[MouseEvent],Any],
368368
)->int: ...
369-
370369
@overload
371370
defmpl_connect(
372371
self,
373372
s:Literal["key_press_event","key_release_event"],
374373
func:Callable[[KeyEvent],Any],
375374
)->int: ...
376-
377375
@overload
378-
defmpl_connect(self,s:Literal["pick_event"],func:Callable[[PickEvent],Any])->int: ...
379-
376+
defmpl_connect(
377+
self,s:Literal["pick_event"],func:Callable[[PickEvent],Any]
378+
)->int: ...
380379
@overload
381-
defmpl_connect(self,s:Literal["resize_event"],func:Callable[[ResizeEvent],Any])->int: ...
382-
380+
defmpl_connect(
381+
self,s:Literal["resize_event"],func:Callable[[ResizeEvent],Any]
382+
)->int: ...
383383
@overload
384-
defmpl_connect(self,s:Literal["close_event"],func:Callable[[CloseEvent],Any])->int: ...
385-
384+
defmpl_connect(
385+
self,s:Literal["close_event"],func:Callable[[CloseEvent],Any]
386+
)->int: ...
386387
@overload
387388
defmpl_connect(self,s:str,func:Callable[[Event],Any])->int: ...
388389
defmpl_disconnect(self,cid:int)->None: ...
@@ -459,6 +460,7 @@ class NavigationToolbar2:
459460
button:MouseButton
460461
axes:list[Axes]
461462
cid:int
463+
462464
defpress_pan(self,event:Event)->None: ...
463465
defdrag_pan(self,event:Event)->None: ...
464466
defrelease_pan(self,event:Event)->None: ...
@@ -470,6 +472,7 @@ class NavigationToolbar2:
470472
axes:list[Axes]
471473
cid:int
472474
cbar:Colorbar
475+
473476
defpress_zoom(self,event:Event)->None: ...
474477
defdrag_zoom(self,event:Event)->None: ...
475478
defrelease_zoom(self,event:Event)->None: ...
@@ -504,9 +507,13 @@ class _Backend:
504507
FigureManager:type[FigureManagerBase]
505508
mainloop:None|Callable[[],Any]
506509
@classmethod
507-
defnew_figure_manager(cls,num:int|str,*args,**kwargs)->FigureManagerBase: ...
510+
defnew_figure_manager(
511+
cls,num:int|str,*args,**kwargs
512+
)->FigureManagerBase: ...
508513
@classmethod
509-
defnew_figure_manager_given_figure(cls,num:int|str,figure:Figure)->FigureManagerBase: ...
514+
defnew_figure_manager_given_figure(
515+
cls,num:int|str,figure:Figure
516+
)->FigureManagerBase: ...
510517
@classmethod
511518
defdraw_if_interactive(cls)->None: ...
512519
@classmethod

‎lib/matplotlib/backend_tools.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,6 @@ default_toolbar_tools: list[list[str | list[str]]]
118118
defadd_tools_to_manager(
119119
toolmanager:ToolManager,tools:dict[str,type[ToolBase]]= ...
120120
)->None: ...
121-
defadd_tools_to_container(container:ToolContainerBase,tools:list[Any]= ...)->None: ...
121+
defadd_tools_to_container(
122+
container:ToolContainerBase,tools:list[Any]= ...
123+
)->None: ...

‎lib/matplotlib/backends/registry.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
fromenumimportEnum
22
fromtypesimportModuleType
33

4-
54
classBackendFilter(Enum):
65
INTERACTIVE=0
76
NON_INTERACTIVE=1
87

9-
108
classBackendRegistry:
119
_BUILTIN_BACKEND_TO_GUI_FRAMEWORK:dict[str,str]
1210
_GUI_FRAMEWORK_TO_BACKEND:dict[str,str]
@@ -20,16 +18,18 @@ class BackendRegistry:
2018
def_ensure_entry_points_loaded(self)->None: ...
2119
def_get_gui_framework_by_loading(self,backend:str)->str: ...
2220
def_read_entry_points(self)->list[tuple[str,str]]: ...
23-
def_validate_and_store_entry_points(self,entries:list[tuple[str,str]])->None: ...
24-
21+
def_validate_and_store_entry_points(
22+
self,entries:list[tuple[str,str]]
23+
)->None: ...
2524
defbackend_for_gui_framework(self,framework:str)->str|None: ...
2625
defis_valid_backend(self,backend:str)->bool: ...
2726
deflist_all(self)->list[str]: ...
2827
deflist_builtin(self,filter_:BackendFilter|None)->list[str]: ...
2928
deflist_gui_frameworks(self)->list[str]: ...
3029
defload_backend_module(self,backend:str)->ModuleType: ...
3130
defresolve_backend(self,backend:str|None)->tuple[str,str|None]: ...
32-
defresolve_gui_or_backend(self,gui_or_backend:str|None)->tuple[str,str|None]: ...
33-
31+
defresolve_gui_or_backend(
32+
self,gui_or_backend:str|None
33+
)->tuple[str,str|None]: ...
3434

3535
backend_registry:BackendRegistry

‎lib/matplotlib/cbook.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ class GrouperView(Generic[_T]):
118118

119119
defsimple_linear_interpolation(a:ArrayLike,steps:int)->np.ndarray: ...
120120
defdelete_masked_points(*args): ...
121-
def_broadcast_with_masks(*args:ArrayLike,compress:bool= ...)->list[ArrayLike]: ...
121+
def_broadcast_with_masks(
122+
*args:ArrayLike,compress:bool= ...
123+
)->list[ArrayLike]: ...
122124
defboxplot_stats(
123125
X:ArrayLike,
124126
whis:float|tuple[float,float]= ...,
@@ -154,7 +156,9 @@ def _str_equal(obj: Any, s: str) -> bool: ...
154156
def_str_lower_equal(obj:Any,s:str)->bool: ...
155157
def_array_perimeter(arr:np.ndarray)->np.ndarray: ...
156158
def_unfold(arr:np.ndarray,axis:int,size:int,step:int)->np.ndarray: ...
157-
def_array_patch_perimeters(x:np.ndarray,rstride:int,cstride:int)->np.ndarray: ...
159+
def_array_patch_perimeters(
160+
x:np.ndarray,rstride:int,cstride:int
161+
)->np.ndarray: ...
158162
def_setattr_cm(obj:Any,**kwargs)->contextlib.AbstractContextManager[None]: ...
159163

160164
class_OrderedSet(collections.abc.MutableSet):

‎lib/matplotlib/cm.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ _colormaps: ColormapRegistry = ...
1919
_multivar_colormaps:ColormapRegistry= ...
2020
_bivar_colormaps:ColormapRegistry= ...
2121

22-
defget_cmap(name:str|colors.Colormap|None= ...,lut:int|None= ...)->colors.Colormap: ...
22+
defget_cmap(
23+
name:str|colors.Colormap|None= ...,lut:int|None= ...
24+
)->colors.Colormap: ...
2325

2426
ScalarMappable=_ScalarMappable

‎lib/matplotlib/collections.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ class LineCollection(Collection):
157157
defget_segments(self)->list[np.ndarray]: ...
158158
defset_color(self,c:ColorType|Sequence[ColorType])->None: ...
159159
defset_colors(self,c:ColorType|Sequence[ColorType])->None: ...
160-
defset_gapcolor(self,gapcolor:ColorType|Sequence[ColorType]|None)->None: ...
160+
defset_gapcolor(
161+
self,gapcolor:ColorType|Sequence[ColorType]|None
162+
)->None: ...
161163
defget_color(self)->ColorType|Sequence[ColorType]: ...
162164
defget_colors(self)->ColorType|Sequence[ColorType]: ...
163165
defget_gapcolor(self)->ColorType|Sequence[ColorType]|None: ...

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp