Skip to content

Commit

Permalink
Update for changes on main: Axes.ecdf, guiEvent read only, param depr…
Browse files Browse the repository at this point in the history
…ecation
  • Loading branch information
ksunden committed Mar 29, 2023
1 parent bb89b16 commit d33a545
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ci/mypy-stubtest-allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ matplotlib.*\.set$
matplotlib.pyplot.*
matplotlib.typing.*

# data arg "decorator"
# _preprocess_data arg decorator
matplotlib.axes.*Axes.acorr
matplotlib.axes.*Axes.angle_spectrum
matplotlib.axes.*Axes.bar
Expand All @@ -28,6 +28,7 @@ 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
Expand Down Expand Up @@ -58,7 +59,7 @@ matplotlib.axes.*Axes.xcorr
matplotlib.axis.Axis.draw
matplotlib.offsetbox.*Offset[Bb]ox.get_offset

# Inconsistent super/sub class signatures (other than just name)
# Inconsistent super/sub class signatures (other than just arg name)
matplotlib.ticker.MultipleLocator.set_params
matplotlib.text.Annotation.get_window_extent

Expand Down Expand Up @@ -87,7 +88,6 @@ matplotlib.scale.SymmetricalLogTransform.transform_non_affine
matplotlib.table.Cell.set_transform
matplotlib.ticker.LogLocator.nonsingular
matplotlib.ticker.LogitLocator.nonsingular
matplotlib.text.Annotation.contains
matplotlib.transforms.Affine2DBase.transform_affine
matplotlib.transforms.AffineBase.transform_non_affine
matplotlib.transforms.BlendedGenericTransform.transform_non_affine
Expand Down
10 changes: 10 additions & 0 deletions lib/matplotlib/axes/_axes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,16 @@ class Axes(_AxesBase):
cmax: float | None = ...,
**kwargs
) -> tuple[np.ndarray, np.ndarray, np.ndarray, QuadMesh]: ...
def ecdf(
self,
x: ArrayLike,
weights: ArrayLike | None = ...,
*,
complementary: bool=...,
orientation: Literal["vertical", "horizonatal"]=...,
compress: bool=...,
**kwargs
) -> Line2D: ...
def psd(
self,
x: ArrayLike,
Expand Down
4 changes: 3 additions & 1 deletion lib/matplotlib/backend_bases.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,13 @@ class TimerBase:
class Event:
name: str
canvas: FigureCanvasBase
guiEvent: Any
def __init__(
self, name: str, canvas: FigureCanvasBase, guiEvent: Any | None = ...
) -> None: ...

@property
def guiEvent(self) -> Any: ...

class DrawEvent(Event):
renderer: RendererBase
def __init__(
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/legend.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Legend(Artist):
ncol: int = ...,
draggable: bool = ...
) -> None: ...
def contains(self, event: MouseEvent) -> tuple[bool, dict[Any, Any]]: ...
def contains(self, mouseevent: MouseEvent) -> tuple[bool, dict[Any, Any]]: ...
def set_ncols(self, ncols: int) -> None: ...
@classmethod
def get_default_handler_map(cls) -> dict[type, HandlerBase]: ...
Expand Down
22 changes: 17 additions & 5 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2890,12 +2890,24 @@ def csd(
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
@_copy_docstring_and_deprecators(Axes.ecdf)
def ecdf(
x, weights=None, *, complementary=False,
orientation='vertical', compress=False, data=None, **kwargs):
x: ArrayLike,
weights: ArrayLike | None = None,
*,
complementary: bool = False,
orientation: Literal["vertical", "horizonatal"] = "vertical",
compress: bool = False,
data=None,
**kwargs,
) -> Line2D:
return gca().ecdf(
x, weights=weights, complementary=complementary,
orientation=orientation, compress=compress,
**({"data": data} if data is not None else {}), **kwargs)
x,
weights=weights,
complementary=complementary,
orientation=orientation,
compress=compress,
**({"data": data} if data is not None else {}),
**kwargs,
)


# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
Expand Down

0 comments on commit d33a545

Please sign in to comment.