Skip to content
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
3 changes: 3 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ dependencies:
- sphinx
- sphinx-design
- sphinx-copybutton

# static typing
- scipy-stubs
- types-python-dateutil
- types-PyMySQL
- types-pytz
Expand Down
4 changes: 3 additions & 1 deletion pandas/core/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
)

if TYPE_CHECKING:
from collections.abc import Callable
from typing import TypeAlias

from pandas import Index
Expand Down Expand Up @@ -548,7 +549,7 @@ def _interpolate_scipy_wrapper(
new_x = np.asarray(new_x)

# ignores some kwargs that could be passed along.
alt_methods = {
alt_methods: dict[str, Callable[..., np.ndarray]] = {
"barycentric": interpolate.barycentric_interpolate,
"krogh": interpolate.krogh_interpolate,
"from_derivatives": _from_derivatives,
Expand All @@ -566,6 +567,7 @@ def _interpolate_scipy_wrapper(
"cubic",
"polynomial",
]
terp: Callable[..., np.ndarray] | None
if method in interp1d_methods:
if method == "polynomial":
kind = order
Expand Down
4 changes: 3 additions & 1 deletion pandas/plotting/_matplotlib/hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def _get_ind(y: np.ndarray, ind):

@classmethod
# error: Signature of "_plot" incompatible with supertype "MPLPlot"
def _plot( # type: ignore[override]
def _plot( # type: ignore[override]
cls,
ax: Axes,
y: np.ndarray,
Expand All @@ -277,6 +277,8 @@ def _plot( # type: ignore[override]
y = remove_na_arraylike(y)
gkde = gaussian_kde(y, bw_method=bw_method, weights=weights)

# gaussian_kde.evaluate(None) raises TypeError, so pyright requires this check
assert ind is not None
y = gkde.evaluate(ind)
lines = MPLPlot._plot(ax, ind, y, style=style, **kwds)
return lines
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pytest-cython
sphinx
sphinx-design
sphinx-copybutton
scipy-stubs
types-python-dateutil
types-PyMySQL
types-pytz
Expand Down
Loading