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