Skip to content

Commit 8734d98

Browse files
committed
PyGAD 2.18.2
1 parent 4de9ae8 commit 8734d98

File tree

7 files changed

+35
-23
lines changed

7 files changed

+35
-23
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__ = "2.18.1"
3+
__version__ = "2.18.2"

docs/source/Footer.rst

+20
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,26 @@ Release Date: 19 September 2022
10641064
1. A big fix when ``keep_elitism`` is used.
10651065
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/132
10661066

1067+
.. _pygad-2182:
1068+
1069+
PyGAD 2.18.2
1070+
------------
1071+
1072+
Release Date: 14 February 2023
1073+
1074+
1. Remove ``numpy.int`` and ``numpy.float`` from the list of supported
1075+
data types.
1076+
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/151
1077+
https://github.com/ahmedfgad/GeneticAlgorithmPython/pull/152
1078+
1079+
2. Call the ``on_crossover()`` callback function even if
1080+
``crossover_type`` is ``None``.
1081+
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/138
1082+
1083+
3. Call the ``on_mutation()`` callback function even if
1084+
``mutation_type`` is ``None``.
1085+
https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/138
1086+
10671087
PyGAD Projects at GitHub
10681088
========================
10691089

docs/source/README_pygad_ReadTheDocs.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ as a seed for the random function generators.
18321832

18331833
PyGAD uses random functions in these 2 libraries:
18341834

1835-
1. NumPy
1835+
1. NumPy
18361836

18371837
2. random
18381838

@@ -2261,7 +2261,7 @@ gene's value.
22612261
def mutation_func(offspring, ga_instance):
22622262
22632263
for chromosome_idx in range(offspring.shape[0]):
2264-
random_gene_idx = numpy.random.choice(range(offspring.shape[0]))
2264+
random_gene_idx = numpy.random.choice(range(offspring.shape[1]))
22652265
22662266
offspring[chromosome_idx, random_gene_idx] += numpy.random.random()
22672267

docs/source/conf.py

+1-1
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 = '2.18.1'
25+
release = '2.18.2'
2626

2727
master_doc = 'index'
2828

docs/source/index.rst

+2-14
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ different types of crossover, mutation, and parent selection operators.
2121
different types of problems to be optimized using the genetic algorithm
2222
by customizing the fitness function.
2323

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

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

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

78-
.. _header-n69:
79-
8077
Quick Start
8178
===========
8279

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

189-
.. _header-n88:
190-
191186
PyGAD's Modules
192187
===============
193188

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

217212
PyGAD Citation - Bibtex Formatted
218-
==============
213+
=================================
219214

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

223218
.. code::
224219
225220
@misc{gad2021pygad,
226-
227221
title={PyGAD: An Intuitive Genetic Algorithm Python Library},
228-
229222
author={Ahmed Fawzy Gad},
230-
231223
year={2021},
232-
233224
eprint={2106.06158},
234-
235225
archivePrefix={arXiv},
236-
237226
primaryClass={cs.NE}
238-
239227
}
240228
241229

pygad.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,10 @@ def run(self):
13691369
else:
13701370
self.last_generation_offspring_crossover = self.crossover(self.last_generation_parents,
13711371
offspring_size=(self.num_offspring, self.num_genes))
1372-
if not (self.on_crossover is None):
1373-
self.on_crossover(self, self.last_generation_offspring_crossover)
1372+
1373+
# PyGAD 2.18.2 // The on_crossover() callback function is called even if crossover_type is None.
1374+
if not (self.on_crossover is None):
1375+
self.on_crossover(self, self.last_generation_offspring_crossover)
13741376

13751377
# 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.
13761378
if self.mutation_type is None:
@@ -1381,8 +1383,10 @@ def run(self):
13811383
self.last_generation_offspring_mutation = self.mutation(self.last_generation_offspring_crossover, self)
13821384
else:
13831385
self.last_generation_offspring_mutation = self.mutation(self.last_generation_offspring_crossover)
1384-
if not (self.on_mutation is None):
1385-
self.on_mutation(self, self.last_generation_offspring_mutation)
1386+
1387+
# PyGAD 2.18.2 // The on_mutation() callback function is called even if mutation_type is None.
1388+
if not (self.on_mutation is None):
1389+
self.on_mutation(self, self.last_generation_offspring_mutation)
13861390

13871391
# Update the population attribute according to the offspring generated.
13881392
if self.keep_elitism == 0:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

0 commit comments

Comments
 (0)