From 27b7cd05f1edb15157cf46cca4b8bd748d86065f Mon Sep 17 00:00:00 2001 From: Garrett Wright Date: Mon, 23 Sep 2024 07:07:04 -0400 Subject: [PATCH] fix another bounds bug, triangle score ls --- src/aspire/abinitio/commonline_sync3n.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/aspire/abinitio/commonline_sync3n.py b/src/aspire/abinitio/commonline_sync3n.py index 6ec3b51e4a..db1dc69c12 100644 --- a/src/aspire/abinitio/commonline_sync3n.py +++ b/src/aspire/abinitio/commonline_sync3n.py @@ -455,10 +455,13 @@ def _triangle_scores_inner_host(self, Rijs): # Update histogram # Find integer bin [0,self.hist_intervals) - _l1, _l2, _l3 = np.minimum( - (self.hist_intervals * s).astype(int), # implicit floor - self.hist_intervals - 1, - ) # clamp upper bound + _l1, _l2, _l3 = np.maximum( + np.minimum( + (self.hist_intervals * s).astype(int), # implicit floor + self.hist_intervals - 1, # clamp upper bound + ), + 0, # clamp lower bound + ) scores_hist[_l1] += 1 scores_hist[_l2] += 1