Skip to content

Commit

Permalink
Fixed an issue in dominance computation
Browse files Browse the repository at this point in the history
The problem was in the case where all values are the same.
  • Loading branch information
qubixes committed Mar 27, 2024
1 parent f09222b commit 0d13b8b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions metasyncontrib/disclosure/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def _compute_dominance(block_values, reverse=False):
same_vals = np.all(block_values == max_values, axis=1)
diff_sum = diff_values.sum(axis=1)
dominance = diff_values[~same_vals].max(axis=1) / diff_sum[~same_vals]
# If all values are the same, then dominance is 0.
if len(dominance) == 0:
return 0
return np.max(dominance)


Expand Down

0 comments on commit 0d13b8b

Please sign in to comment.