Skip to content

Commit

Permalink
Merge pull request #276 from ahmedfgad/github-actions
Browse files Browse the repository at this point in the history
PyGAD 3.3.1
  • Loading branch information
ahmedfgad authored Feb 17, 2024
2 parents fff04c6 + 990f1a1 commit b869247
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 181 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Ahmed Fawzy Gad'

# The full version, including alpha/beta/rc tags
release = '3.3.0'
release = '3.3.1'

master_doc = 'index'

Expand Down
23 changes: 23 additions & 0 deletions docs/source/pygad.rst
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,29 @@ Other Methods
Summary <https://pygad.readthedocs.io/en/latest/pygad_more.html#print-lifecycle-summary>`__
section for more details and examples.

- 4 methods with names starting with ``run_``. Their purpose is to keep
the main loop inside the ``run()`` method clean. The details inside
the loop are moved to 4 individual methods. Generally, any method
with a name starting with ``run_`` is meant to be called by PyGAD
from inside the ``run()`` method. Supported in `PyGAD
3.3.1 <https://pygad.readthedocs.io/en/latest/releases.html#pygad-3-3-1>`__.

1. ``run_select_parents(call_on_parents=True)``: Select the parents
and call the callable ``on_parents()`` if defined. If
``call_on_parents`` is ``True``, then the callable
``on_parents()`` is called. It must be ``False`` when the
``run_select_parents()`` method is called to update the parents at
the end of the ``run()`` method.

2. ``run_crossover()``: Apply crossover and call the callable
``on_crossover()`` if defined.

3. ``run_mutation()``: Apply mutation and call the callable
``on_mutation()`` if defined.

4. ``run_update_population()``: Update the ``population`` attribute
after completing the processes of crossover and mutation.

The next sections discuss the methods available in the ``pygad.GA``
class.

Expand Down
19 changes: 19 additions & 0 deletions docs/source/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,25 @@ Release Date 29 January 2024
self.best_solution_generation = numpy.where(numpy.array(
self.best_solutions_fitness) == numpy.max(numpy.array(self.best_solutions_fitness)))[0][0]
.. _pygad-331:

PyGAD 3.3.1
-----------

Release Date 17 February 2024

1. After the last generation and before the ``run()`` method completes,
update the 2 instance attributes: 1) ``last_generation_parents`` 2)
``last_generation_parents_indices``. This is to keep the list of
parents up-to-date with the latest population fitness
``last_generation_fitness``.
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/275

2. 4 methods with names starting with ``run_``. Their purpose is to keep
the main loop inside the ``run()`` method clean. Check the `Other
Methods <https://pygad.readthedocs.io/en/latest/pygad.html#other-methods>`__
section for more information.

PyGAD Projects at GitHub
========================

Expand Down
2 changes: 1 addition & 1 deletion pygad/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .pygad import * # Relative import.

__version__ = "3.3.0"
__version__ = "3.3.1"
440 changes: 263 additions & 177 deletions pygad/pygad.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pygad"
version = "3.3.0"
version = "3.3.1"
description = "PyGAD: A Python Library for Building the Genetic Algorithm and Training Machine Learning Algoithms (Keras & PyTorch)."
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pygad",
version="3.3.0",
version="3.3.1",
author="Ahmed Fawzy Gad",
install_requires=["numpy", "matplotlib", "cloudpickle",],
author_email="ahmed.f.gad@gmail.com",
Expand Down

0 comments on commit b869247

Please sign in to comment.