Skip to content

Commit c639175

Browse files
committed
Fix bug in average_hamming_distance
1 parent 2cc1441 commit c639175

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pygenalgo/engines/auxiliary.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from dataclasses import dataclass, field
33
from pygenalgo.genome.chromosome import Chromosome
44

5-
65
# Public interface.
76
__all__ = ["hamming_distance", "average_hamming_distance",
87
"apply_corrections", "SubPopulation"]
@@ -61,7 +60,7 @@ def average_hamming_distance(population: list[Chromosome]) -> float:
6160
total_diffs, total_genes = 0, 0
6261

6362
# Iterate through all the population.
64-
for i, item1 in enumerate(population[:-1]):
63+
for i, item1 in enumerate(population):
6564

6665
# Get the size of the chromosome. It is
6766
# assumed that all chromosomes have the

0 commit comments

Comments
 (0)