Skip to content

Commit

Permalink
Merge pull request DEAP#577 from hidmic/feature/py38
Browse files Browse the repository at this point in the history
Use raw docstrings when LaTex is embedded
  • Loading branch information
fmder authored Nov 13, 2021
2 parents bfd3af8 + b98d797 commit eba726c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions deap/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


def varAnd(population, toolbox, cxpb, mutpb):
"""Part of an evolutionary algorithm applying only the variation part
r"""Part of an evolutionary algorithm applying only the variation part
(crossover **and** mutation). The modified individuals have their
fitness invalidated. The individuals are cloned so returned population is
independent of the input population.
Expand Down Expand Up @@ -190,7 +190,7 @@ def eaSimple(population, toolbox, cxpb, mutpb, ngen, stats=None,


def varOr(population, toolbox, lambda_, cxpb, mutpb):
"""Part of an evolutionary algorithm applying only the variation part
r"""Part of an evolutionary algorithm applying only the variation part
(crossover, mutation **or** reproduction). The modified individuals have
their fitness invalidated. The individuals are cloned so returned
population is independent of the input population.
Expand Down Expand Up @@ -247,7 +247,7 @@ def varOr(population, toolbox, lambda_, cxpb, mutpb):

def eaMuPlusLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen,
stats=None, halloffame=None, verbose=__debug__):
"""This is the :math:`(\mu + \lambda)` evolutionary algorithm.
r"""This is the :math:`(\mu + \lambda)` evolutionary algorithm.
:param population: A list of individuals.
:param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution
Expand Down Expand Up @@ -339,7 +339,7 @@ def eaMuPlusLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen,

def eaMuCommaLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen,
stats=None, halloffame=None, verbose=__debug__):
"""This is the :math:`(\mu~,~\lambda)` evolutionary algorithm.
r"""This is the :math:`(\mu~,~\lambda)` evolutionary algorithm.
:param population: A list of individuals.
:param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution
Expand Down
4 changes: 2 additions & 2 deletions deap/tools/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from collections import Sequence

class DeltaPenalty(object):
"""This decorator returns penalized fitness for invalid individuals and the
r"""This decorator returns penalized fitness for invalid individuals and the
original fitness value for valid individuals. The penalized fitness is made
of a constant factor *delta* added with an (optional) *distance* penalty. The
distance function, if provided, shall return a value growing as the
Expand Down Expand Up @@ -66,7 +66,7 @@ def wrapper(individual, *args, **kwargs):
DeltaPenality = DeltaPenalty

class ClosestValidPenalty(object):
"""This decorator returns penalized fitness for invalid individuals and the
r"""This decorator returns penalized fitness for invalid individuals and the
original fitness value for valid individuals. The penalized fitness is made
of the fitness of the closest valid individual added with a weighted
(optional) *distance* penalty. The distance function, if provided, shall
Expand Down
2 changes: 1 addition & 1 deletion deap/tools/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def mutUniformInt(individual, low, up, indpb):
######################################

def mutESLogNormal(individual, c, indpb):
"""Mutate an evolution strategy according to its :attr:`strategy`
r"""Mutate an evolution strategy according to its :attr:`strategy`
attribute as described in [Beyer2002]_. First the strategy is mutated
according to an extended log normal rule, :math:`\\boldsymbol{\sigma}_t =
\\exp(\\tau_0 \mathcal{N}_0(0, 1)) \\left[ \\sigma_{t-1, 1}\\exp(\\tau
Expand Down

0 comments on commit eba726c

Please sign in to comment.