Skip to content

Commit

Permalink
TYP: Fix typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Jul 26, 2024
1 parent 7b8a867 commit c3b7675
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plotnine/geoms/geom_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
5 changes: 3 additions & 2 deletions plotnine/stats/stat_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c3b7675

Please sign in to comment.