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

remove deprecated imp, fix docstring warning #1331

Merged
merged 1 commit into from
Feb 22, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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