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

Skip to content

Include data kwarg in pyi stubs #25632

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 2 commits into from
May 1, 2023
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
38 changes: 0 additions & 38 deletions ci/mypy-stubtest-allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,6 @@ matplotlib.*\.set$
matplotlib.pyplot.*
matplotlib.typing.*

# _preprocess_data arg decorator
matplotlib.axes.*Axes.acorr
matplotlib.axes.*Axes.angle_spectrum
matplotlib.axes.*Axes.bar
matplotlib.axes.*Axes.barbs
matplotlib.axes.*Axes.boxplot
matplotlib.axes.*Axes.broken_barh
matplotlib.axes.*Axes.cohere
matplotlib.axes.*Axes.contour
matplotlib.axes.*Axes.contourf
matplotlib.axes.*Axes.csd
matplotlib.axes.*Axes.ecdf
matplotlib.axes.*Axes.errorbar
matplotlib.axes.*Axes.eventplot
matplotlib.axes.*Axes.fill_between
matplotlib.axes.*Axes.fill_betweenx
matplotlib.axes.*Axes.hexbin
matplotlib.axes.*Axes.hist
matplotlib.axes.*Axes.hist2d
matplotlib.axes.*Axes.hlines
matplotlib.axes.*Axes.imshow
matplotlib.axes.*Axes.magnitude_spectrum
matplotlib.axes.*Axes.pcolor
matplotlib.axes.*Axes.pcolorfast
matplotlib.axes.*Axes.pcolormesh
matplotlib.axes.*Axes.phase_spectrum
matplotlib.axes.*Axes.pie
matplotlib.axes.*Axes.plot_date
matplotlib.axes.*Axes.psd
matplotlib.axes.*Axes.quiver
matplotlib.axes.*Axes.scatter
matplotlib.axes.*Axes.specgram
matplotlib.axes.*Axes.stairs
matplotlib.axes.*Axes.stem
matplotlib.axes.*Axes.violinplot
matplotlib.axes.*Axes.vlines
matplotlib.axes.*Axes.xcorr

# Other decorator modifying signature (maybe investigate)
matplotlib.axis.Axis.draw
matplotlib.offsetbox.*Offset[Bb]ox.get_offset
Expand Down
74 changes: 63 additions & 11 deletions lib/matplotlib/axes/_axes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ class Axes(_AxesBase):
colors: Sequence[ColorType] | None = ...,
linestyles: LineStyleType = ...,
label: str = ...,
*,
data=...,
**kwargs
) -> LineCollection: ...
def vlines(
Expand All @@ -176,6 +178,8 @@ class Axes(_AxesBase):
colors: Sequence[ColorType] | None = ...,
linestyles: LineStyleType = ...,
label: str = ...,
*,
data=...,
**kwargs
) -> LineCollection: ...
def eventplot(
Expand All @@ -188,14 +192,16 @@ class Axes(_AxesBase):
colors: ColorType | Sequence[ColorType] | None = ...,
alpha: float | Sequence[float] | None = ...,
linestyles: LineStyleType | Sequence[LineStyleType] = ...,
*,
data=...,
**kwargs
) -> EventCollection: ...
def plot(
self,
*args: float | ArrayLike | str,
scalex: bool = ...,
scaley: bool = ...,
data: Any | None = ...,
data = ...,
**kwargs
) -> list[Line2D]: ...
def plot_date(
Expand All @@ -206,13 +212,15 @@ class Axes(_AxesBase):
tz: str | datetime.tzinfo | None = ...,
xdate: bool = ...,
ydate: bool = ...,
*,
data=...,
**kwargs
) -> list[Line2D]: ...
def loglog(self, *args, **kwargs) -> list[Line2D]: ...
def semilogx(self, *args, **kwargs) -> list[Line2D]: ...
def semilogy(self, *args, **kwargs) -> list[Line2D]: ...
def acorr(
self, x: ArrayLike, **kwargs
self, x: ArrayLike, *, data=..., **kwargs
) -> tuple[np.ndarray, np.ndarray, LineCollection | Line2D, Line2D | None]: ...
def xcorr(
self,
Expand All @@ -222,6 +230,8 @@ class Axes(_AxesBase):
detrend: Callable[[ArrayLike], ArrayLike] = ...,
usevlines: bool = ...,
maxlags: int = ...,
*,
data = ...,
**kwargs
) -> tuple[np.ndarray, np.ndarray, LineCollection | Line2D, Line2D | None]: ...
def step(
Expand All @@ -230,7 +240,7 @@ class Axes(_AxesBase):
y: ArrayLike,
*args,
where: Literal["pre", "post", "mid"] = ...,
data: Any | None = ...,
data = ...,
**kwargs
) -> list[Line2D]: ...
def bar(
Expand All @@ -241,6 +251,7 @@ class Axes(_AxesBase):
bottom: float | ArrayLike | None = ...,
*,
align: Literal["center", "edge"] = ...,
data = ...,
**kwargs
) -> BarContainer: ...
def barh(
Expand All @@ -251,7 +262,7 @@ class Axes(_AxesBase):
left: float | ArrayLike | None = ...,
*,
align: Literal["center", "edge"] = ...,
data: Any | None = ...,
data = ...,
**kwargs
) -> BarContainer: ...
def bar_label(
Expand All @@ -268,6 +279,8 @@ class Axes(_AxesBase):
self,
xranges: Sequence[tuple[float, float]],
yrange: tuple[float, float],
*,
data=...,
**kwargs
) -> BrokenBarHCollection: ...
def stem(
Expand All @@ -278,7 +291,8 @@ class Axes(_AxesBase):
basefmt: str | None = ...,
bottom: float = ...,
label: str | None = ...,
orientation: Literal["vertical", "horizontal"] = ...
orientation: Literal["vertical", "horizontal"] = ...,
data=...,
) -> StemContainer: ...

# TODO: data kwarg preprocessor?
Expand All @@ -302,7 +316,8 @@ class Axes(_AxesBase):
rotatelabels: bool = ...,
*,
normalize: bool = ...,
hatch: str | Sequence[str] | None = ...
hatch: str | Sequence[str] | None = ...,
data=...,
): ...
def errorbar(
self,
Expand All @@ -321,6 +336,8 @@ class Axes(_AxesBase):
xuplims: bool = ...,
errorevery: int | tuple[int, int] = ...,
capthick: float | None = ...,
*,
data=...,
**kwargs
) -> ErrorbarContainer: ...
def boxplot(
Expand Down Expand Up @@ -352,6 +369,8 @@ class Axes(_AxesBase):
autorange: bool = ...,
zorder: float | None = ...,
capwidths: float | ArrayLike | None = ...,
*,
data=...,
) -> dict[str, Any]: ...
def bxp(
self,
Expand Down Expand Up @@ -392,6 +411,7 @@ class Axes(_AxesBase):
*,
edgecolors: Literal["face", "none"] | ColorType | Sequence[ColorType] | None = ...,
plotnonfinite: bool = ...,
data=...,
**kwargs
) -> PathCollection: ...
def hexbin(
Expand All @@ -414,6 +434,8 @@ class Axes(_AxesBase):
reduce_C_function: Callable[[np.ndarray], float] = ...,
mincnt: int | None = ...,
marginals: bool = ...,
*,
data=...,
**kwargs
) -> PolyCollection: ...
def arrow(
Expand All @@ -422,9 +444,9 @@ class Axes(_AxesBase):
def quiverkey(
self, Q: Quiver, X: float, Y: float, U: float, label: str, **kwargs
) -> QuiverKey: ...
def quiver(self, *args, **kwargs) -> Quiver: ...
def barbs(self, *args, **kwargs) -> Barbs: ...
def fill(self, *args, data: Any | None = ..., **kwargs) -> list[Polygon]: ...
def quiver(self, *args, data=..., **kwargs) -> Quiver: ...
def barbs(self, *args, data=..., **kwargs) -> Barbs: ...
def fill(self, *args, data=..., **kwargs) -> list[Polygon]: ...
def fill_between(
self,
x: ArrayLike,
Expand All @@ -433,6 +455,8 @@ class Axes(_AxesBase):
where: Sequence[bool] | None = ...,
interpolate: bool = ...,
step: Literal["pre", "post", "mid"] | None = ...,
*,
data=...,
**kwargs
) -> PolyCollection: ...
def fill_betweenx(
Expand All @@ -443,6 +467,8 @@ class Axes(_AxesBase):
where: Sequence[bool] | None = ...,
step: Literal["pre", "post", "mid"] | None = ...,
interpolate: bool = ...,
*,
data=...,
**kwargs
) -> PolyCollection: ...
def imshow(
Expand All @@ -463,6 +489,7 @@ class Axes(_AxesBase):
filterrad: float = ...,
resample: bool | None = ...,
url: str | None = ...,
data=...,
**kwargs
) -> AxesImage: ...
def pcolor(
Expand All @@ -474,6 +501,7 @@ class Axes(_AxesBase):
cmap: str | Colormap | None = ...,
vmin: float | None = ...,
vmax: float | None = ...,
data=...,
**kwargs
) -> Collection: ...
def pcolormesh(
Expand All @@ -486,6 +514,7 @@ class Axes(_AxesBase):
vmax: float | None = ...,
shading: Literal["flat", "nearest", "gouraud", "auto"] | None = ...,
antialiased: bool = ...,
data=...,
**kwargs
) -> QuadMesh: ...
def pcolorfast(
Expand All @@ -496,10 +525,11 @@ class Axes(_AxesBase):
cmap: str | Colormap | None = ...,
vmin: float | None = ...,
vmax: float | None = ...,
data=...,
**kwargs
) -> AxesImage | PcolorImage | QuadMesh: ...
def contour(self, *args, **kwargs) -> QuadContourSet: ...
def contourf(self, *args, **kwargs) -> QuadContourSet: ...
def contour(self, *args, data=..., **kwargs) -> QuadContourSet: ...
def contourf(self, *args, data=..., **kwargs) -> QuadContourSet: ...
def clabel(
self, CS: ContourSet, levels: ArrayLike | None = ..., **kwargs
) -> list[Text]: ...
Expand All @@ -520,6 +550,8 @@ class Axes(_AxesBase):
color: ColorType | Sequence[ColorType] | None = ...,
label: str | Sequence[str] | None = ...,
stacked: bool = ...,
*,
data=...,
**kwargs
) -> tuple[
np.ndarray | list[np.ndarray],
Expand All @@ -534,6 +566,7 @@ class Axes(_AxesBase):
orientation: Literal["vertical", "horizontal"] = ...,
baseline: float | ArrayLike = ...,
fill: bool = ...,
data=...,
**kwargs
) -> StepPatch: ...
def hist2d(
Expand All @@ -550,6 +583,8 @@ class Axes(_AxesBase):
weights: ArrayLike | None = ...,
cmin: float | None = ...,
cmax: float | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray, np.ndarray, QuadMesh]: ...
def ecdf(
Expand All @@ -560,6 +595,7 @@ class Axes(_AxesBase):
complementary: bool=...,
orientation: Literal["vertical", "horizonatal"]=...,
compress: bool=...,
data=...,
**kwargs
) -> Line2D: ...
def psd(
Expand All @@ -577,6 +613,8 @@ class Axes(_AxesBase):
sides: Literal["default", "onesided", "twosided"] | None = ...,
scale_by_freq: bool | None = ...,
return_line: bool | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, Line2D]: ...
def csd(
Expand All @@ -595,6 +633,8 @@ class Axes(_AxesBase):
sides: Literal["default", "onesided", "twosided"] | None = ...,
scale_by_freq: bool | None = ...,
return_line: bool | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, Line2D]: ...
def magnitude_spectrum(
Expand All @@ -606,6 +646,8 @@ class Axes(_AxesBase):
pad_to: int | None = ...,
sides: Literal["default", "onesided", "twosided"] | None = ...,
scale: Literal["default", "linear", "dB"] | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray, Line2D]: ...
def angle_spectrum(
Expand All @@ -616,6 +658,8 @@ class Axes(_AxesBase):
window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
pad_to: int | None = ...,
sides: Literal["default", "onesided", "twosided"] | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray, Line2D]: ...
def phase_spectrum(
Expand All @@ -626,6 +670,8 @@ class Axes(_AxesBase):
window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
pad_to: int | None = ...,
sides: Literal["default", "onesided", "twosided"] | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray, Line2D]: ...
def cohere(
Expand All @@ -642,6 +688,8 @@ class Axes(_AxesBase):
pad_to: int | None = ...,
sides: Literal["default", "onesided", "twosided"] = ...,
scale_by_freq: bool | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray]: ...
def specgram(
Expand All @@ -664,6 +712,8 @@ class Axes(_AxesBase):
scale: Literal["default", "linear", "dB"] | None = ...,
vmin: float | None = ...,
vmax: float | None = ...,
*,
data=...,
**kwargs
) -> tuple[np.ndarray, np.ndarray, np.ndarray, AxesImage]: ...
def spy(
Expand Down Expand Up @@ -692,6 +742,8 @@ class Axes(_AxesBase):
| float
| Callable[[GaussianKDE], float]
| None = ...,
*,
data=...,
) -> dict[str, Collection]: ...
def violin(
self,
Expand Down
Loading