Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing typos in logging + docs #253

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/pygad_more.rst
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ After running the code again, it will find the same result.
[ 2.77249188 -4.06570662 0.04196872 -3.47770796 -0.57502138 -3.22775267]
0.04872203136549972

Continue without Loosing Progress
Continue without Losing Progress
=================================

In `PyGAD
Expand All @@ -615,7 +615,7 @@ call to the ``run()`` method.
4. ``self.solutions_fitness``

This helps the user to continue where the last run stopped without
loosing the values of these 4 attributes.
losing the values of these 4 attributes.

Now, the user can save the model by calling the ``save()`` method.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,8 @@ Release Date: 9 September 2022
generation. Another advantage happens when the instance is loaded and
the ``run()`` method is called, as the old fitness value are shown on
the graph alongside with the new fitness values. Read more in this
section: `Continue without Loosing
Progress <https://pygad.readthedocs.io/en/latest/pygad_more.html#continue-without-loosing-progress>`__
section: `Continue without Losing
Progress <https://pygad.readthedocs.io/en/latest/pygad_more.html#continue-without-losing-progress>`__

4. Thanks `Prof. Fernando Jiménez
Barrionuevo <http://webs.um.es/fernan>`__ (Dept. of Information and
Expand Down
6 changes: 3 additions & 3 deletions pygad/pygad.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def __init__(self,
if self.mutation_probability is None:
if not self.suppress_warnings:
warnings.warn(
f"The percentage of genes to mutate (mutation_percent_genes={mutation_percent_genes}) resutled in selecting ({mutation_num_genes}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.")
f"The percentage of genes to mutate (mutation_percent_genes={mutation_percent_genes}) resulted in selecting ({mutation_num_genes}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.")
mutation_num_genes = 1

elif type(mutation_percent_genes) in GA.supported_int_float_types:
Expand All @@ -745,7 +745,7 @@ def __init__(self,
if mutation_num_genes == 0:
if self.mutation_probability is None:
if not self.suppress_warnings:
warnings.warn(f"The percentage of genes to mutate (mutation_percent_genes={mutation_percent_genes}) resutled in selecting ({mutation_num_genes}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.")
warnings.warn(f"The percentage of genes to mutate (mutation_percent_genes={mutation_percent_genes}) resulted in selecting ({mutation_num_genes}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.")
mutation_num_genes = 1
else:
self.valid_parameters = False
Expand All @@ -771,7 +771,7 @@ def __init__(self,
# Based on the mutation percentage of genes, if the number of selected genes for mutation is less than the least possible value which is 1, then the number will be set to 1.
if mutation_num_genes[idx] == 0:
if not self.suppress_warnings:
warnings.warn(f"The percentage of genes to mutate ({mutation_percent_genes[idx]}) resutled in selecting ({mutation_num_genes[idx]}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.")
warnings.warn(f"The percentage of genes to mutate ({mutation_percent_genes[idx]}) resulted in selecting ({mutation_num_genes[idx]}) genes. The number of genes to mutate is set to 1 (mutation_num_genes=1).\nIf you do not want to mutate any gene, please set mutation_type=None.")
mutation_num_genes[idx] = 1
if mutation_percent_genes[0] < mutation_percent_genes[1]:
if not self.suppress_warnings:
Expand Down