Skip to content

Commit

Permalink
Merge pull request #1331 from perib/imp-fix
Browse files Browse the repository at this point in the history
remove deprecated imp, fix docstring warning
  • Loading branch information
jay-m-dev authored Feb 22, 2024
2 parents 71933de + 7c6133e commit a8f7eb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tpot/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import inspect
import warnings
import sys
import imp

from functools import partial
from datetime import datetime
from multiprocessing import cpu_count
Expand All @@ -38,7 +38,7 @@

from tempfile import mkdtemp
from shutil import rmtree

import types
import numpy as np
from pandas import DataFrame
from scipy import sparse
Expand Down Expand Up @@ -411,7 +411,7 @@ def _setup_config(self, config_dict):
def _read_config_file(self, config_path):
if os.path.isfile(config_path):
try:
custom_config = imp.new_module("custom_config")
custom_config = types.ModuleType("custom_config")

with open(config_path, "r") as config_file:
file_string = config_file.read()
Expand Down
4 changes: 2 additions & 2 deletions tpot/gp_deap.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def mutate_random_individual(population, toolbox):


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 @@ -177,7 +177,7 @@ def initialize_stats_dict(individual):
def eaMuPlusLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen, pbar,
stats=None, halloffame=None, verbose=0,
per_generation_function=None, log_file=None):
"""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
operators.
Expand Down

0 comments on commit a8f7eb0

Please sign in to comment.