diff --git a/plotnine/geoms/geom_map.py b/plotnine/geoms/geom_map.py index 9b115dec9..c32288753 100644 --- a/plotnine/geoms/geom_map.py +++ b/plotnine/geoms/geom_map.py @@ -293,7 +293,7 @@ def ccw_coords(ring: LinearRing) -> npt.NDArray[Any]: # and the interiors _exterior = [] _interior = [] - for p in obj.geoms: + for p in obj.geoms: # type: ignore _exterior.append(Path(cw_coords(p.exterior))) _interior.extend([Path(ccw_coords(ring)) for ring in p.interiors]) diff --git a/plotnine/stats/stat_density.py b/plotnine/stats/stat_density.py index d05c2635f..6ab5d6f79 100644 --- a/plotnine/stats/stat_density.py +++ b/plotnine/stats/stat_density.py @@ -227,7 +227,8 @@ def compute_density(x, weight, range, **params): # Evaluating values beyond the ptp range helps us calculate a # boundary corrections. So we widen the range over which we will # evaluate, so that it contains all points supported by the grid. - x2 = np.linspace(kde.support[0], kde.support[-1], params["n"]) + low, high = cast(tuple[float, float], kde.support) + x2 = np.linspace(low, high, params["n"]) else: x2 = np.linspace(range[0], range[1], params["n"]) @@ -294,7 +295,7 @@ def nrd0(x: FloatArrayLike) -> float: ) std: float = np.std(x, ddof=1) # pyright: ignore - std_estimate: float = iqr(x) / 1.349 # pyright: ignore + std_estimate: float = iqr(x) / 1.349 low_std = min(std, std_estimate) if low_std == 0: low_std = std_estimate or np.abs(np.asarray(x)[0]) or 1