Skip to content

Commit 330e7bd

Browse files
authored
PyGAD 3.0.1
Fix an issue with passing user-defined function/method for parent selection. #179
1 parent ab66e04 commit 330e7bd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .pygad import * # Relative import.
22

3-
__version__ = "3.0.0"
3+
__version__ = "3.0.1"

pygad.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1747,9 +1747,9 @@ def run(self):
17471747

17481748
# Selecting the best parents in the population for mating.
17491749
if callable(self.parent_selection_type):
1750-
self.last_generation_parents, self.last_generation_parents_indices = self.select_parents(self,
1751-
self.last_generation_fitness,
1752-
self.num_parents_mating, self)
1750+
self.last_generation_parents, self.last_generation_parents_indices = self.select_parents(self.last_generation_fitness,
1751+
self.num_parents_mating,
1752+
self)
17531753
if not type(self.last_generation_parents) is numpy.ndarray:
17541754
self.logger.error("The type of the iterable holding the selected parents is expected to be (numpy.ndarray) but {last_generation_parents_type} found.".format(last_generation_parents_type=type(self.last_generation_parents)))
17551755
raise TypeError("The type of the iterable holding the selected parents is expected to be (numpy.ndarray) but {last_generation_parents_type} found.".format(last_generation_parents_type=type(self.last_generation_parents)))

0 commit comments

Comments
 (0)