Skip to content

Commit

Permalink
Fix for bug in rank norm reported by Cameron Ellis
Browse files Browse the repository at this point in the history
  • Loading branch information
xoltar committed Apr 12, 2018
1 parent 092085e commit 0153ef9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions atlatl/rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def barcode_rank(barcode, birth, death):
"""Return the number of bars that are born by
`birth` and die after `death`."""
arr = barcode.to_array()
if arr.shape[0] == 0:
return 0
included = np.logical_and(arr[:, 0] <= birth, arr[:, 1] > death)
return np.sum(arr[included, 2])

Expand Down

0 comments on commit 0153ef9

Please sign in to comment.