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

Made MAX_EVAL_SECS configurable via environment #1306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions tpot/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@

from __future__ import print_function
from functools import wraps
import os
import warnings
from .export_utils import expr_to_tree, generate_pipeline_code
from deap import creator

from stopit import threading_timeoutable, TimeoutException
from stopit import threading_timeoutable


NUM_TESTS = 10
MAX_EVAL_SECS = 10
MAX_EVAL_SECS = int(os.environ.get('TPOT_MAX_EVAL_SECS') or 10)


def _pre_test(func):
Expand Down Expand Up @@ -79,7 +80,7 @@ def check_pipeline(self, *args, **kwargs):
try:
expr = func(self, *args, **kwargs)
pass_gen = True
except:
except Exception:
num_test_expr += 1
pass
# mutation operator returns tuple (ind,); crossover operator
Expand Down Expand Up @@ -116,5 +117,4 @@ def check_pipeline(self, *args, **kwargs):

return expr


return check_pipeline