Skip to content

Commit 34f66b6

Browse files
author
Julian Kates-Harbeck
committed
modified performance analyzer to handle case where shot is shorter than T_min_warn
1 parent 1d5cf00 commit 34f66b6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plasma/utils/performance.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,11 @@ def get_threshold_arrays(self,preds,truths,disruptives):
188188
d_early_thresholds.append(-np.inf)
189189
else:
190190
d_early_thresholds.append(np.max(pred[early_indices]))
191-
192-
d_correct_thresholds.append(np.max(pred[correct_indices]))
191+
192+
if np.sum(correct_indices) == 0:
193+
d_correct_thresholds.append(-np.inf)
194+
else:
195+
d_correct_thresholds.append(np.max(pred[correct_indices]))
193196
else:
194197
nd_thresholds.append(np.max(pred))
195198
return np.array(d_early_thresholds), np.array(d_correct_thresholds),np.array(d_late_thresholds), np.array(nd_thresholds)

0 commit comments

Comments
 (0)