Skip to content

Commit

Permalink
Fixed an issue in dominance computation (#28)
Browse files Browse the repository at this point in the history
The problem was in the case where all values are the same.

Co-authored-by: Raoul Schram <[email protected]>
  • Loading branch information
qubixes and qubixes authored Mar 27, 2024
1 parent f09222b commit 6a9fd3a
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 6a9fd3a

Please sign in to comment.