Skip to content

Commit

Permalink
Small optimisation in excprob function (#424)
Browse files Browse the repository at this point in the history
Co-authored-by: vikvnieu <[email protected]>
  • Loading branch information
viktor40 and vikvnieu authored Aug 20, 2024
1 parent 917c83b commit 9803d54
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pysteps/postprocessing/ensemblestats.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ def excprob(X, X_thr, ignore_nan=False):
scalar_thr = False

for x in X_thr:
X_ = X.copy()
X_ = np.zeros(X.shape)

X_[X >= x] = 1.0
X_[X < x] = 0.0
X_[~np.isfinite(X)] = np.nan

if ignore_nan:
Expand Down

0 comments on commit 9803d54

Please sign in to comment.