Skip to content

Commit 2f7914c

Browse files
committed
on_start error indicate 1 parameter
1 parent 042b886 commit 2f7914c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pygad/utils/validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ def _validate_callbacks(self,
936936
self.on_start = on_start
937937
else:
938938
self.valid_parameters = False
939-
raise ValueError(f"The method assigned to the on_start parameter must accept only 2 parameters:\n1) The instance of the genetic algorithm.\nThe passed method named '{on_start.__code__.co_name}' accepts {len(inspect.signature(on_start).parameters)} parameter(s).")
939+
raise ValueError(f"The method assigned to the on_start parameter must accept only 1 parameter representing the instance of the genetic algorithm. The passed method named '{on_start.__code__.co_name}' accepts {len(inspect.signature(on_start).parameters)} parameter(s).")
940940
# Check if the on_start is a function.
941941
elif inspect.isfunction(on_start):
942942
# Check if the on_start function accepts only a single parameter.

0 commit comments

Comments
 (0)