Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b869247

Browse files
Merge pull request #276 from ahmedfgad/github-actions
PyGAD 3.3.1
2 parents fff04c6 + 990f1a1 commit b869247

File tree

7 files changed

+309
-181
lines changed

7 files changed

+309
-181
lines changed

‎docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Ahmed Fawzy Gad'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '3.3.0'
25+
release = '3.3.1'
2626

2727
master_doc = 'index'
2828

‎docs/source/pygad.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,29 @@ Other Methods
603603
Summary <https://pygad.readthedocs.io/en/latest/pygad_more.html#print-lifecycle-summary>`__
604604
section for more details and examples.
605605

606+
- 4 methods with names starting with ``run_``. Their purpose is to keep
607+
the main loop inside the ``run()`` method clean. The details inside
608+
the loop are moved to 4 individual methods. Generally, any method
609+
with a name starting with ``run_`` is meant to be called by PyGAD
610+
from inside the ``run()`` method. Supported in `PyGAD
611+
3.3.1 <https://pygad.readthedocs.io/en/latest/releases.html#pygad-3-3-1>`__.
612+
613+
1. ``run_select_parents(call_on_parents=True)``: Select the parents
614+
and call the callable ``on_parents()`` if defined. If
615+
``call_on_parents`` is ``True``, then the callable
616+
``on_parents()`` is called. It must be ``False`` when the
617+
``run_select_parents()`` method is called to update the parents at
618+
the end of the ``run()`` method.
619+
620+
2. ``run_crossover()``: Apply crossover and call the callable
621+
``on_crossover()`` if defined.
622+
623+
3. ``run_mutation()``: Apply mutation and call the callable
624+
``on_mutation()`` if defined.
625+
626+
4. ``run_update_population()``: Update the ``population`` attribute
627+
after completing the processes of crossover and mutation.
628+
606629
The next sections discuss the methods available in the ``pygad.GA``
607630
class.
608631

‎docs/source/releases.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,25 @@ Release Date 29 January 2024
15321532
self.best_solution_generation = numpy.where(numpy.array(
15331533
self.best_solutions_fitness) == numpy.max(numpy.array(self.best_solutions_fitness)))[0][0]
15341534
1535+
.. _pygad-331:
1536+
1537+
PyGAD 3.3.1
1538+
-----------
1539+
1540+
Release Date 17 February 2024
1541+
1542+
1. After the last generation and before the ``run()`` method completes,
1543+
update the 2 instance attributes: 1) ``last_generation_parents`` 2)
1544+
``last_generation_parents_indices``. This is to keep the list of
1545+
parents up-to-date with the latest population fitness
1546+
``last_generation_fitness``.
1547+
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/275
1548+
1549+
2. 4 methods with names starting with ``run_``. Their purpose is to keep
1550+
the main loop inside the ``run()`` method clean. Check the `Other
1551+
Methods <https://pygad.readthedocs.io/en/latest/pygad.html#other-methods>`__
1552+
section for more information.
1553+
15351554
PyGAD Projects at GitHub
15361555
========================
15371556

‎pygad/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .pygad import * # Relative import.
22

3-
__version__ = "3.3.0"
3+
__version__ = "3.3.1"

‎pygad/pygad.py

Lines changed: 263 additions & 177 deletions
Large diffs are not rendered by default.

‎pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99

1010
[project]
1111
name = "pygad"
12-
version = "3.3.0"
12+
version = "3.3.1"
1313
description = "PyGAD: A Python Library for Building the Genetic Algorithm and Training Machine Learning Algoithms (Keras & PyTorch)."
1414
readme = {file = "README.md", content-type = "text/markdown"}
1515
requires-python = ">=3"

‎setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="pygad",
8-
version="3.3.0",
8+
version="3.3.1",
99
author="Ahmed Fawzy Gad",
1010
install_requires=["numpy", "matplotlib", "cloudpickle",],
1111
author_email="ahmed.f.gad@gmail.com",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /