Skip to content

Commit

Permalink
Merge pull request #32 from garciampred/main
Browse files Browse the repository at this point in the history
Bugfix: Pass size to np.random.uniform so it does not return a single value
  • Loading branch information
jakobwes authored Dec 18, 2024
2 parents 10ee7f3 + 25976e9 commit a6426bf
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.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),
np.random.uniform(0, self.censoring_threshold, x.shape),
x,
)
return scipy.stats.gamma.cdf(x, *fit)
Expand Down

0 comments on commit a6426bf

Please sign in to comment.