Skip to content

Commit

Permalink
MAINT make all loggers module + classname
Browse files Browse the repository at this point in the history
  • Loading branch information
shukon committed Mar 14, 2017
1 parent 9cf84fd commit 7a94c87
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion smac/epm/random_epm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, rng):
----------
rng : np.random.RandomState
'''
self.logger = logging.getLogger("smac.epm.RandomEPM")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.rng = rng

def train(self, X, Y, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion smac/epm/rf_with_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, types,
min_samples_leaf, max_depth, eps_purity, seed]
self.seed = seed

self.logger = logging.getLogger("smac.epm.RF_with_instances")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

# Never use a lower variance than this
self.var_threshold = 10 ** -5
Expand Down
2 changes: 1 addition & 1 deletion smac/epm/rfr_imputator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, rs, cutoff, threshold,
"""

super(RFRImputator, self).__init__()
self.logger = logging.getLogger("smac.epm.RFRImputor")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.max_iter = max_iter
self.change_threshold = change_threshold
self.cutoff = cutoff
Expand Down
2 changes: 1 addition & 1 deletion smac/facade/func_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def fmin_smac(func: callable,
scenario = Scenario(scenario_dict)

smac = SMAC(scenario=scenario, tae_runner=ta, rng=rng)
smac.logger = logging.getLogger("smac.facade.fmin_smac")
smac.logger = logging.getLogger(smac.__module__ + "." + smac.__class__.__name__)
incumbent = smac.optimize()

config_id = smac.solver.runhistory.config_ids[incumbent]
Expand Down
2 changes: 1 addition & 1 deletion smac/facade/roar_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self,
rng: np.random.RandomState
Random number generator
'''
self.logger = logging.getLogger("smac.facade.ROAR")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

# initial random number generator
num_run, rng = self._get_rng(rng=rng)
Expand Down
2 changes: 1 addition & 1 deletion smac/facade/smac_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self,
rng: np.random.RandomState
Random number generator
'''
self.logger = logging.getLogger("smac.facade.SMAC")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

aggregate_func = average_cost

Expand Down
2 changes: 1 addition & 1 deletion smac/initial_design/initial_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self,
self.stats = stats
self.traj_logger = traj_logger
self.rng = rng
self.logger = logging.getLogger("smac.initial_design.InitialDesign")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

def run(self):
'''
Expand Down
2 changes: 1 addition & 1 deletion smac/intensification/intensification.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, tae_runner, stats, traj_logger, rng, instances,
self.instance_specifics = {}
else:
self.instance_specifics = instance_specifics
self.logger = logging.getLogger("smac.intensification.Intensifier")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.run_limit = run_limit
self.maxR = maxR
self.minR = minR
Expand Down
2 changes: 1 addition & 1 deletion smac/runhistory/runhistory2epm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, scenario, num_params,
rs : numpy.random.RandomState
only used for reshuffling data after imputation
'''
self.logger = logging.getLogger("smac.runhistory.runhistory2epm")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

# General arguments
self.scenario = scenario
Expand Down
4 changes: 2 additions & 2 deletions smac/scenario/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, scenario, cmd_args=None):
command line arguments that were not processed by argparse
"""
self.logger = logging.getLogger("smac.scenario.Scenario")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.PCA_DIM = 7

self.in_reader = InputReader()
Expand Down Expand Up @@ -352,4 +352,4 @@ def __getstate__(self):

def __setstate__(self, d):
self.__dict__.update(d)
self.logger = logging.getLogger("smac.scenario.Scenario")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
2 changes: 1 addition & 1 deletion smac/smac_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self):
'''
constructor
'''
self.logger = logging.getLogger("smac.SMAC_cli")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

def main_cli(self):
'''
Expand Down
2 changes: 1 addition & 1 deletion smac/smbo/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, model, **kwargs):
"""
self.model = model

self.logger = logging.getLogger("smac.smbo.AcquisitionFunction")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

def update(self, **kwargs):
"""Update the acquisition functions values.
Expand Down
2 changes: 1 addition & 1 deletion smac/smbo/base_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, acquisition_func=None, model=None,
if self.save_dir is not None:
self.create_save_dir()

self.logger = logging.getLogger("smac.smbo.BaseSolver")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

def init_last_iteration(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion smac/smbo/local_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, acquisition_function, config_space,
else:
self.rng = rng

self.logger = logging.getLogger("smac.smbo.LocalSearch")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

def maximize(self, start_point, *args):
"""
Expand Down
2 changes: 1 addition & 1 deletion smac/smbo/smbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self,
rng: np.random.RandomState
Random number generator
'''
self.logger = logging.getLogger("smac.smbo.SMBO")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.incumbent = None

self.scenario = scenario
Expand Down
2 changes: 1 addition & 1 deletion smac/stats/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, scenario):
self._EMA_ALPHA = 0.2

self._start_time = None
self._logger = logging.getLogger("smac.stats.Stats")
self._logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

def start_timing(self):
'''
Expand Down
2 changes: 1 addition & 1 deletion smac/utils/io/cmd_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self):
"""
Constructor
"""
self.logger = logging.getLogger("CMDReader")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
pass

def read_cmd(self):
Expand Down
2 changes: 1 addition & 1 deletion smac/utils/io/traj_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, output_dir, stats):
Stats object
"""
self.stats = stats
self.logger = logging.getLogger("TrajLogger")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

self.output_dir = output_dir
if output_dir is None:
Expand Down
2 changes: 1 addition & 1 deletion test/test_intensify/test_intensify.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setUp(self):
self.stats = Stats(scenario=self.scen)
self.stats.start_timing()

self.logger = logging.getLogger("test.test_intensify.TestIntensify")
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)

def test_compare_configs_no_joint_set(self):
intensifier = Intensifier(
Expand Down
2 changes: 1 addition & 1 deletion test/test_scenario/test_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ScenarioTest(unittest.TestCase):

def setUp(self):
logging.basicConfig()
self.logger = logging.getLogger('test.test_scenario.ScenarioTest')
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.logger.setLevel(logging.DEBUG)

base_directory = os.path.split(__file__)[0]
Expand Down
2 changes: 1 addition & 1 deletion test/test_utils/io/test_CMDReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CMDReaderTest(unittest.TestCase):

def setUp(self):
logging.basicConfig()
self.logger = logging.getLogger('test.test_utils.io.CMDReaderTest')
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.logger.setLevel(logging.DEBUG)
self.cr = CMDReader()
self.current_dir = os.getcwd()
Expand Down
2 changes: 1 addition & 1 deletion test/test_utils/io/test_traj_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def mocked_get_used_wallclock_time(self):

def setUp(self):
logging.basicConfig()
self.logger = logging.getLogger('test.test_utils.io.TrajLoggerTest')
self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
self.logger.setLevel(logging.DEBUG)
self.value = 0
self.cs = ConfigurationSpace()
Expand Down

0 comments on commit 7a94c87

Please sign in to comment.