Skip to content

Commit

Permalink
Fix NumPy warning for array to scalar conversion (#211)
Browse files Browse the repository at this point in the history
Resolves:
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  • Loading branch information
wenzeslaus authored Feb 12, 2025
1 parent 6e478bb commit 088e71c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion popsborder/contamination.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_contamination_rate(config):
param2 = parameters["b"]
else:
param1, param2 = parameters
return float(stats.beta.rvs(param1, param2, size=1))
return float(stats.beta.rvs(param1, param2, size=1)[0])
raise RuntimeError(f"Unknown contamination rate distribution: {distribution}")


Expand Down

0 comments on commit 088e71c

Please sign in to comment.