Skip to content

Commit 6429acc

Browse files
authored
Merge branch 'github-actions' into master
2 parents 263cb49 + 03f509f commit 6429acc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pygad/pygad.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,12 +1710,8 @@ def cal_pop_fitness(self):
17101710
# Reaching this block means that batch fitness calculation is used.
17111711

17121712
# Indices of the solutions to calculate their fitness.
1713-
solutions_indices = numpy.array([
1714-
sol_idx
1715-
for (sol_idx, fitness)
1716-
in enumerate(pop_fitness)
1717-
if fitness is undefined_pop_fitness
1718-
])
1713+
solutions_indices = [idx for idx, fit in enumerate(pop_fitness) if type(fit) is str and fit == "undefined"]
1714+
17191715
# Number of batches.
17201716
num_batches = int(numpy.ceil(len(solutions_indices) / self.fitness_batch_size))
17211717
# For each batch, get its indices and call the fitness function.

0 commit comments

Comments
 (0)