Skip to content

Commit a6426bf

Browse files
authored
Merge pull request #32 from garciampred/main
Bugfix: Pass size to np.random.uniform so it does not return a single value
2 parents 10ee7f3 + 25976e9 commit a6426bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ibicus/utils/_math_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def cdf(self, x: np.ndarray, *fit: tuple) -> np.ndarray:
279279
else:
280280
return np.where(
281281
x == 0,
282-
np.random.uniform(0, p0),
282+
np.random.uniform(0, p0, x.shape),
283283
p0 + (1 - p0) * self.distribution.cdf(x, *fit_rainy_days),
284284
)
285285

@@ -423,7 +423,7 @@ def cdf(self, x: np.ndarray, *fit: tuple) -> np.ndarray:
423423
"""
424424
x = np.where(
425425
x < self.censoring_threshold,
426-
np.random.uniform(0, self.censoring_threshold),
426+
np.random.uniform(0, self.censoring_threshold, x.shape),
427427
x,
428428
)
429429
return scipy.stats.gamma.cdf(x, *fit)

0 commit comments

Comments
 (0)