Skip to content

Commit

Permalink
[MNT] fix numpy 2 incompatibility of Pareto distribution (#436)
Browse files Browse the repository at this point in the history
This fixes `numpy 2` incompatibility of the `Pareto` distribution -
removd `np.infty` replaced by `np.inf`.
  • Loading branch information
fkiraly authored Jul 27, 2024
1 parent 1080e37 commit a250f7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions skpro/distributions/pareto.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _mean(self):
"""
alpha = self._bc_params["alpha"]
scale = self._bc_params["scale"]
mean = np.where(alpha <= 1, np.infty, scale**alpha / (alpha - 1))
mean = np.where(alpha <= 1, np.inf, scale**alpha / (alpha - 1))
return mean

def _var(self):
Expand All @@ -74,7 +74,7 @@ def _var(self):
alpha = self._bc_params["alpha"]
scale = self._bc_params["scale"]
var = np.where(
alpha <= 2, np.infty, scale**2 * alpha / ((alpha - 2) * (alpha - 1) ** 2)
alpha <= 2, np.inf, scale**2 * alpha / ((alpha - 2) * (alpha - 1) ** 2)
)
return var

Expand Down

0 comments on commit a250f7f

Please sign in to comment.