Skip to content

Commit

Permalink
Replaced x.size by x.shape to make it work for n-dimensional arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobwes committed Dec 18, 2024
1 parent 927e9d6 commit 25976e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ibicus/utils/_math_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def cdf(self, x: np.ndarray, *fit: tuple) -> np.ndarray:
else:
return np.where(
x == 0,
np.random.uniform(0, p0, x.size),
np.random.uniform(0, p0, x.shape),
p0 + (1 - p0) * self.distribution.cdf(x, *fit_rainy_days),
)

Expand Down Expand Up @@ -423,7 +423,7 @@ def cdf(self, x: np.ndarray, *fit: tuple) -> np.ndarray:
"""
x = np.where(
x < self.censoring_threshold,
np.random.uniform(0, self.censoring_threshold, x.size),
np.random.uniform(0, self.censoring_threshold, x.shape),
x,
)
return scipy.stats.gamma.cdf(x, *fit)
Expand Down

0 comments on commit 25976e9

Please sign in to comment.