Skip to content

Commit

Permalink
Merge pull request #119 from better/km-t0
Browse files Browse the repository at this point in the history
handle T=0 for K-M
  • Loading branch information
Erik Bernhardsson committed Oct 20, 2019
2 parents 2ab6138 + 6503f4c commit ef6a637
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions convoys/single.py
Expand Up @@ -20,11 +20,11 @@ def fit(self, B, T):
'''
# See https://www.math.wustl.edu/~sawyer/handouts/greenwood.pdf
BT = [(b, t) for b, t in zip(B, T)
if t > 0 and 0 <= float(b) <= 1]
if t >= 0 and 0 <= float(b) <= 1]
if len(BT) < len(B):
n_removed = len(B) - len(BT)
warnings.warn('Warning! Removed %d/%d entries from inputs where '
'T <= 0 or B not 0/1' % (n_removed, len(B)))
'T < 0 or B not 0/1' % (n_removed, len(B)))
B, T = ([z[i] for z in BT] for i in range(2))
n = len(T)
self._ts = [0.0]
Expand Down

0 comments on commit ef6a637

Please sign in to comment.