Repository navigation
Commit 9816da0
committed
Avoid a ZeroDivisionError in TreeConstruction.DistanceCalculator (#491)
Also add some comments and a line to the docstring to explain what's happening.
In an alignment where a pair of sequences have no overlapping non-gap
characters, there are no aligned characters to score. Instead, return the
maximum possible distance (i.e. 1, since distances are scaled to [0,1]).1 parent 35183e1 commit 9816da0
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
| |||
436 | 440 | | |
437 | 441 | | |
438 | 442 | | |
439 | | - | |
440 | | - | |
| 443 | + | |
| 444 | + | |
441 | 445 | | |
| 446 | + | |
442 | 447 | | |
443 | 448 | | |
444 | 449 | | |
445 | 450 | | |
446 | 451 | | |
447 | 452 | | |
448 | 453 | | |
| 454 | + | |
| 455 | + | |
449 | 456 | | |
450 | 457 | | |
451 | 458 | | |
| |||
0 commit comments