Skip to content

Commit

Permalink
code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
quaquel committed Apr 11, 2019
1 parent 01b15c8 commit 821865a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 55 deletions.
3 changes: 0 additions & 3 deletions ema_workbench/em_framework/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
progress, always call super.
'''
from __future__ import (absolute_import, print_function, division,
unicode_literals)

import abc
import csv
import os
Expand Down
3 changes: 0 additions & 3 deletions ema_workbench/em_framework/ema_ipyparallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
with IPython parallel.
'''
from __future__ import (absolute_import, print_function, division,
unicode_literals)

import collections
import logging
import os
Expand Down
36 changes: 16 additions & 20 deletions ema_workbench/em_framework/evaluators.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
from ..util import EMAError, get_module_logger, ema_logging
from .util import NamedObjectMap, determine_objects
from .salib_samplers import (SobolSampler, MorrisSampler, FASTSampler)
from .samplers import (MonteCarloSampler, FullFactorialSampler, LHSSampler,
PartialFactorialSampler, sample_levers,
sample_uncertainties)
from .parameters import (experiment_generator, Scenario, Policy)
from .outcomes import ScalarOutcome, AbstractOutcome
from .optimization import (evaluate_robust, evaluate, EpsNSGAII,
to_problem, to_robust_problem,
process_levers, process_uncertainties,
process_robust, _optimize)
from .model import AbstractModel
from .experiment_runner import ExperimentRunner
from .ema_multiprocessing import LogQueueReader, initializer, add_tasks
from .callbacks import DefaultCallback
'''
collection of evaluators for performing experiments, optimization, and robust
optimization
'''
from __future__ import (unicode_literals, print_function, absolute_import,
division)

import multiprocessing
import numbers
import os
Expand All @@ -33,14 +14,29 @@

warnings.simplefilter("once", ImportWarning)


try:
from .ema_ipyparallel import (start_logwatcher, set_engine_logger,
initialize_engines, cleanup, _run_experiment)
except (ImportError, ModuleNotFoundError):
warnings.warn(
'ipyparallel not installed - IpyparalleEvaluator not available')

from ..util import EMAError, get_module_logger, ema_logging
from .util import NamedObjectMap, determine_objects
from .salib_samplers import (SobolSampler, MorrisSampler, FASTSampler)
from .samplers import (MonteCarloSampler, FullFactorialSampler, LHSSampler,
PartialFactorialSampler, sample_levers,
sample_uncertainties)
from .parameters import (experiment_generator, Scenario, Policy)
from .outcomes import ScalarOutcome, AbstractOutcome
from .optimization import (evaluate_robust, evaluate, EpsNSGAII,
to_problem, to_robust_problem,
process_levers, process_uncertainties,
process_robust, _optimize)
from .model import AbstractModel
from .experiment_runner import ExperimentRunner
from .ema_multiprocessing import LogQueueReader, initializer, add_tasks
from .callbacks import DefaultCallback

# TODO:: should become optional import

Expand Down
6 changes: 0 additions & 6 deletions ema_workbench/em_framework/experiment_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
helper module for running experiments and keeping track of which model
has been initialized with which policy.
'''
from __future__ import (absolute_import, print_function, division,
unicode_literals)

# import sys
# import traceback

from ..util import get_module_logger, EMAError, CaseError

# Created on Aug 11, 2015
Expand Down
9 changes: 1 addition & 8 deletions ema_workbench/em_framework/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,11 @@
an instance of an extension of this abstract base class.
'''
from __future__ import (absolute_import, print_function, division,
unicode_literals)

import operator
import os
import warnings

try:
from collections import MutableMapping
except ImportError:
from collections.abc import MutableMapping # @UnusedImport

from collections.abc import MutableMapping # @UnusedImport
from collections import defaultdict

from .util import (NamedObject, combine, NamedObjectMapDescriptor)
Expand Down
4 changes: 0 additions & 4 deletions ema_workbench/em_framework/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
'''
from __future__ import (unicode_literals, print_function, absolute_import,
division)

import copy
import functools
import os
Expand All @@ -15,7 +12,6 @@
import numpy as np

from .outcomes import AbstractOutcome

from .parameters import (IntegerParameter, RealParameter, CategoricalParameter,
BooleanParameter, Scenario, Policy)
from .samplers import determine_parameters
Expand Down
2 changes: 0 additions & 2 deletions ema_workbench/em_framework/outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Module for outcome classes
'''
from __future__ import (absolute_import, print_function, division,
unicode_literals)
import abc
import collections
import numbers
Expand Down
3 changes: 0 additions & 3 deletions ema_workbench/em_framework/parameters.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
'''parameters and collections of parameters'''
from __future__ import (unicode_literals, print_function, absolute_import,
division)

import abc
import itertools
import numbers
Expand Down
2 changes: 0 additions & 2 deletions ema_workbench/em_framework/salib_samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Samplers for working with SALib
'''
from __future__ import (unicode_literals, print_function, absolute_import,
division)
import operator
import warnings

Expand Down
4 changes: 0 additions & 4 deletions ema_workbench/em_framework/util.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
'''utilities used throughout em_framework'''
from __future__ import (unicode_literals, print_function, absolute_import,
division)

import copy
from collections import OrderedDict


from collections import UserDict
from collections.abc import MutableMapping # @UnusedImport

Expand Down

0 comments on commit 821865a

Please sign in to comment.