Skip to content

Commit

Permalink
PyGAD 2.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedfgad committed Feb 14, 2023
1 parent 4de9ae8 commit 8734d98
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 23 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .pygad import * # Relative import.

__version__ = "2.18.1"
__version__ = "2.18.2"
20 changes: 20 additions & 0 deletions docs/source/Footer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,26 @@ Release Date: 19 September 2022
1. A big fix when ``keep_elitism`` is used.
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/132

.. _pygad-2182:

PyGAD 2.18.2
------------

Release Date: 14 February 2023

1. Remove ``numpy.int`` and ``numpy.float`` from the list of supported
data types.
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/151
https://github.com/ahmedfgad/GeneticAlgorithmPython/pull/152

2. Call the ``on_crossover()`` callback function even if
``crossover_type`` is ``None``.
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/138

3. Call the ``on_mutation()`` callback function even if
``mutation_type`` is ``None``.
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/138

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

Expand Down
4 changes: 2 additions & 2 deletions docs/source/README_pygad_ReadTheDocs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ as a seed for the random function generators.

PyGAD uses random functions in these 2 libraries:

1. NumPy
1. NumPy

2. random

Expand Down Expand Up @@ -2261,7 +2261,7 @@ gene's value.
def mutation_func(offspring, ga_instance):
for chromosome_idx in range(offspring.shape[0]):
random_gene_idx = numpy.random.choice(range(offspring.shape[0]))
random_gene_idx = numpy.random.choice(range(offspring.shape[1]))
offspring[chromosome_idx, random_gene_idx] += numpy.random.random()
Expand Down
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 = '2.18.1'
release = '2.18.2'

master_doc = 'index'

Expand Down
16 changes: 2 additions & 14 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ different types of crossover, mutation, and parent selection operators.
different types of problems to be optimized using the genetic algorithm
by customizing the fitness function.


.. figure:: https://user-images.githubusercontent.com/16560492/101267295-c74c0180-375f-11eb-9ad0-f8e37bd796ce.png
:alt:

*Logo designed by*\ `Asmaa
*Logo designed by* `Asmaa
Kabil <https://www.linkedin.com/in/asmaa-kabil-9901b7b6>`__

Besides building the genetic algorithm, it builds and optimizes machine
Expand Down Expand Up @@ -75,8 +74,6 @@ manipulating arrays and Matplotlib for creating figures. The exact NumPy
version used in developing PyGAD is 1.16.4. For Matplotlib, the version
is 3.1.0.

.. _header-n69:

Quick Start
===========

Expand Down Expand Up @@ -186,8 +183,6 @@ solution found by PyGAD can be accessed.
There is more to do using PyGAD. Read its documentation to explore the
features of PyGAD.

.. _header-n88:

PyGAD's Modules
===============

Expand Down Expand Up @@ -215,27 +210,20 @@ PyGAD's Modules
The documentation discusses each of these modules.

PyGAD Citation - Bibtex Formatted
==============
=================================

If you used PyGAD, please consider citing its paper with the following
details:

.. code::
@misc{gad2021pygad,
title={PyGAD: An Intuitive Genetic Algorithm Python Library},
author={Ahmed Fawzy Gad},
year={2021},
eprint={2106.06158},
archivePrefix={arXiv},
primaryClass={cs.NE}
}
Expand Down
12 changes: 8 additions & 4 deletions pygad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,10 @@ def run(self):
else:
self.last_generation_offspring_crossover = self.crossover(self.last_generation_parents,
offspring_size=(self.num_offspring, self.num_genes))
if not (self.on_crossover is None):
self.on_crossover(self, self.last_generation_offspring_crossover)

# PyGAD 2.18.2 // The on_crossover() callback function is called even if crossover_type is None.
if not (self.on_crossover is None):
self.on_crossover(self, self.last_generation_offspring_crossover)

# If self.mutation_type=None, then no mutation is applied and thus no changes are applied to the offspring created using the crossover operation. The offspring will be used unchanged in the next generation.
if self.mutation_type is None:
Expand All @@ -1381,8 +1383,10 @@ def run(self):
self.last_generation_offspring_mutation = self.mutation(self.last_generation_offspring_crossover, self)
else:
self.last_generation_offspring_mutation = self.mutation(self.last_generation_offspring_crossover)
if not (self.on_mutation is None):
self.on_mutation(self, self.last_generation_offspring_mutation)

# PyGAD 2.18.2 // The on_mutation() callback function is called even if mutation_type is None.
if not (self.on_mutation is None):
self.on_mutation(self, self.last_generation_offspring_mutation)

# Update the population attribute according to the offspring generated.
if self.keep_elitism == 0:
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="2.18.1",
version="2.18.2",
author="Ahmed Fawzy Gad",
install_requires=["numpy", "matplotlib",],
author_email="ahmed.f.gad@gmail.com",
Expand Down

0 comments on commit 8734d98

Please sign in to comment.