Skip to content

Test that boilerplate.py is correctly run. #11204

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
64 changes: 46 additions & 18 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2269,8 +2269,12 @@ def axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs):

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.bar)
def bar(*args, data=None, **kwargs):
return gca().bar(*args, data=data, **kwargs)
def bar(
x, height, width=0.8, bottom=None, *, align='center',
data=None, **kwargs):
return gca().bar(
x=x, height=height, width=width, bottom=bottom, align=align,
data=data, **kwargs)

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

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.barh)
def barh(*args, **kwargs):
return gca().barh(*args, **kwargs)
def barh(y, width, height=0.8, left=None, *, align='center', **kwargs):
return gca().barh(
y=y, width=width, height=height, left=left, align=align,
**kwargs)

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

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.margins)
def margins(*args, **kw):
return gca().margins(*args, **kw)
def margins(*margins, x=None, y=None, tight=True):
return gca().margins(*margins, x=x, y=y, tight=tight)

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

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@_autogen_docstring(Axes.pcolor)
def pcolor(*args, data=None, **kwargs):
__ret = gca().pcolor(*args, data=data, **kwargs)
def pcolor(
*args, alpha=None, norm=None, cmap=None, vmin=None,
vmax=None, data=None, **kwargs):
__ret = gca().pcolor(
*args, alpha=alpha, norm=norm, cmap=cmap, vmin=vmin,
vmax=vmax, data=data, **kwargs)
sci(__ret)
return __ret

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@_autogen_docstring(Axes.pcolormesh)
def pcolormesh(*args, data=None, **kwargs):
__ret = gca().pcolormesh(*args, data=data, **kwargs)
def pcolormesh(
*args, alpha=None, norm=None, cmap=None, vmin=None,
vmax=None, shading='flat', antialiased=False, data=None,
**kwargs):
__ret = gca().pcolormesh(
*args, alpha=alpha, norm=norm, cmap=cmap, vmin=vmin,
vmax=vmax, shading=shading, antialiased=antialiased,
data=data, **kwargs)
sci(__ret)
return __ret

Expand Down Expand Up @@ -2560,8 +2576,9 @@ def pie(

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.plot)
def plot(*args, data=None, **kwargs):
return gca().plot(*args, data=data, **kwargs)
def plot(*args, scalex=True, scaley=True, data=None, **kwargs):
return gca().plot(
*args, scalex=scalex, scaley=scaley, data=data, **kwargs)

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

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.stem)
def stem(*args, data=None, **kwargs):
return gca().stem(*args, data=data, **kwargs)
def stem(
*args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
label=None, data=None):
return gca().stem(
*args, linefmt=linefmt, markerfmt=markerfmt, basefmt=basefmt,
bottom=bottom, label=label, data=data)

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.step)
def step(x, y, *args, data=None, **kwargs):
return gca().step(x=x, y=y, *args, data=data, **kwargs)
def step(x, y, *args, where='pre', linestyle='', data=None, **kwargs):
return gca().step(
x=x, y=y, *args, where=where, linestyle=linestyle, data=data,
**kwargs)

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

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@docstring.copy_dedent(Axes.ticklabel_format)
def ticklabel_format(**kwargs):
return gca().ticklabel_format(**kwargs)
def ticklabel_format(
*, axis='both', style='', scilimits=None, useOffset=None,
useLocale=None, useMathText=None):
return gca().ticklabel_format(
axis=axis, style=style, scilimits=scilimits,
useOffset=useOffset, useLocale=useLocale,
useMathText=useMathText)

# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@_autogen_docstring(Axes.tricontour)
Expand Down
21 changes: 21 additions & 0 deletions lib/matplotlib/tests/test_pyplot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import subprocess
import sys
from pathlib import Path

import pytest

import matplotlib as mpl
from matplotlib import pyplot as plt


def test_pyplot_up_to_date():
gen_script = Path(mpl.__file__).parents[2] / "tools/boilerplate.py"
if not gen_script.exists():
pytest.skip("boilerplate.py not found")
orig_contents = Path(plt.__file__).read_text()
try:
subprocess.run([sys.executable, str(gen_script)], check=True)
new_contents = Path(plt.__file__).read_text()
assert orig_contents == new_contents
finally:
Path(plt.__file__).write_text(orig_contents)