Skip to content

Commit

Permalink
Pass size to np.random.uniform so it does not return a single value
Browse files Browse the repository at this point in the history
  • Loading branch information
garciampred committed Dec 9, 2024
1 parent 10ee7f3 commit 927e9d6
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),
np.random.uniform(0, p0, x.size),
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),
np.random.uniform(0, self.censoring_threshold, x.size),
x,
)
return scipy.stats.gamma.cdf(x, *fit)
Expand Down

0 comments on commit 927e9d6

Please sign in to comment.