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

Commit76002fb

Browse files
committed
Test that boilerplate.py is correctly run.
(and update the outdated pyplot.py).
1 parent1652ed1 commit76002fb

File tree

2 files changed

+67
-18
lines changed

2 files changed

+67
-18
lines changed

‎lib/matplotlib/pyplot.py

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,8 +2269,12 @@ def axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs):
22692269

22702270
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
22712271
@docstring.copy_dedent(Axes.bar)
2272-
defbar(*args,data=None,**kwargs):
2273-
returngca().bar(*args,data=data,**kwargs)
2272+
defbar(
2273+
x,height,width=0.8,bottom=None,*,align='center',
2274+
data=None,**kwargs):
2275+
returngca().bar(
2276+
x=x,height=height,width=width,bottom=bottom,align=align,
2277+
data=data,**kwargs)
22742278

22752279
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
22762280
@docstring.copy_dedent(Axes.barbs)
@@ -2279,8 +2283,10 @@ def barbs(*args, data=None, **kw):
22792283

22802284
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
22812285
@docstring.copy_dedent(Axes.barh)
2282-
defbarh(*args,**kwargs):
2283-
returngca().barh(*args,**kwargs)
2286+
defbarh(y,width,height=0.8,left=None,*,align='center',**kwargs):
2287+
returngca().barh(
2288+
y=y,width=width,height=height,left=left,align=align,
2289+
**kwargs)
22842290

22852291
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
22862292
@docstring.copy_dedent(Axes.boxplot)
@@ -2506,8 +2512,8 @@ def magnitude_spectrum(
25062512

25072513
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
25082514
@docstring.copy_dedent(Axes.margins)
2509-
defmargins(*args,**kw):
2510-
returngca().margins(*args,**kw)
2515+
defmargins(*margins,x=None,y=None,tight=True):
2516+
returngca().margins(*margins,x=x,y=y,tight=tight)
25112517

25122518
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
25132519
@docstring.copy_dedent(Axes.minorticks_off)
@@ -2521,15 +2527,25 @@ def minorticks_on():
25212527

25222528
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
25232529
@_autogen_docstring(Axes.pcolor)
2524-
defpcolor(*args,data=None,**kwargs):
2525-
__ret=gca().pcolor(*args,data=data,**kwargs)
2530+
defpcolor(
2531+
*args,alpha=None,norm=None,cmap=None,vmin=None,
2532+
vmax=None,data=None,**kwargs):
2533+
__ret=gca().pcolor(
2534+
*args,alpha=alpha,norm=norm,cmap=cmap,vmin=vmin,
2535+
vmax=vmax,data=data,**kwargs)
25262536
sci(__ret)
25272537
return__ret
25282538

25292539
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
25302540
@_autogen_docstring(Axes.pcolormesh)
2531-
defpcolormesh(*args,data=None,**kwargs):
2532-
__ret=gca().pcolormesh(*args,data=data,**kwargs)
2541+
defpcolormesh(
2542+
*args,alpha=None,norm=None,cmap=None,vmin=None,
2543+
vmax=None,shading='flat',antialiased=False,data=None,
2544+
**kwargs):
2545+
__ret=gca().pcolormesh(
2546+
*args,alpha=alpha,norm=norm,cmap=cmap,vmin=vmin,
2547+
vmax=vmax,shading=shading,antialiased=antialiased,
2548+
data=data,**kwargs)
25332549
sci(__ret)
25342550
return__ret
25352551

@@ -2560,8 +2576,9 @@ def pie(
25602576

25612577
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
25622578
@docstring.copy_dedent(Axes.plot)
2563-
defplot(*args,data=None,**kwargs):
2564-
returngca().plot(*args,data=data,**kwargs)
2579+
defplot(*args,scalex=True,scaley=True,data=None,**kwargs):
2580+
returngca().plot(
2581+
*args,scalex=scalex,scaley=scaley,data=data,**kwargs)
25652582

25662583
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
25672584
@docstring.copy_dedent(Axes.plot_date)
@@ -2652,13 +2669,19 @@ def stackplot(x, *args, data=None, **kwargs):
26522669

26532670
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
26542671
@docstring.copy_dedent(Axes.stem)
2655-
defstem(*args,data=None,**kwargs):
2656-
returngca().stem(*args,data=data,**kwargs)
2672+
defstem(
2673+
*args,linefmt=None,markerfmt=None,basefmt=None,bottom=0,
2674+
label=None,data=None):
2675+
returngca().stem(
2676+
*args,linefmt=linefmt,markerfmt=markerfmt,basefmt=basefmt,
2677+
bottom=bottom,label=label,data=data)
26572678

26582679
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
26592680
@docstring.copy_dedent(Axes.step)
2660-
defstep(x,y,*args,data=None,**kwargs):
2661-
returngca().step(x=x,y=y,*args,data=data,**kwargs)
2681+
defstep(x,y,*args,where='pre',linestyle='',data=None,**kwargs):
2682+
returngca().step(
2683+
x=x,y=y,*args,where=where,linestyle=linestyle,data=data,
2684+
**kwargs)
26622685

26632686
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
26642687
@_autogen_docstring(Axes.streamplot)
@@ -2695,8 +2718,13 @@ def tick_params(axis='both', **kwargs):
26952718

26962719
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
26972720
@docstring.copy_dedent(Axes.ticklabel_format)
2698-
defticklabel_format(**kwargs):
2699-
returngca().ticklabel_format(**kwargs)
2721+
defticklabel_format(
2722+
*,axis='both',style='',scilimits=None,useOffset=None,
2723+
useLocale=None,useMathText=None):
2724+
returngca().ticklabel_format(
2725+
axis=axis,style=style,scilimits=scilimits,
2726+
useOffset=useOffset,useLocale=useLocale,
2727+
useMathText=useMathText)
27002728

27012729
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
27022730
@_autogen_docstring(Axes.tricontour)

‎lib/matplotlib/tests/test_pyplot.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
importsubprocess
2+
importsys
3+
frompathlibimportPath
4+
5+
importpytest
6+
7+
importmatplotlibasmpl
8+
frommatplotlibimportpyplotasplt
9+
10+
11+
deftest_pyplot_up_to_date():
12+
gen_script=Path(mpl.__file__).parents[2]/"tools/boilerplate.py"
13+
ifnotgen_script.exists():
14+
pytest.skip("boilerplate.py not found")
15+
orig_contents=Path(plt.__file__).read_text()
16+
try:
17+
subprocess.run([sys.executable,gen_script],check=True)
18+
new_contents=Path(plt.__file__).read_text()
19+
assertorig_contents==new_contents
20+
finally:
21+
Path(plt.__file__).write_text(orig_contents)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp