Commit 3fc74583 authored by Médéric Boquien's avatar Médéric Boquien

Use a slightly denser variable name to improve the consistency across cigale.

parent 2c0e5962
...@@ -23,28 +23,28 @@ class ParametersManager(object): ...@@ -23,28 +23,28 @@ class ParametersManager(object):
to keep the cache of partially computed models in SedWarehouse as small as to keep the cache of partially computed models in SedWarehouse as small as
possible by weeding out partial models that will not be used anymore.""" possible by weeding out partial models that will not be used anymore."""
def __new__(object, configuration): def __new__(object, conf):
if configuration['parameters_file']: if conf['parameters_file']:
return ParametersManagerFile(configuration) return ParametersManagerFile(conf)
else: else:
return ParametersManagerGrid(configuration) return ParametersManagerGrid(conf)
class ParametersManagerGrid(object): class ParametersManagerGrid(object):
"""Class to generate a parameters manager for a systematic grid using the """Class to generate a parameters manager for a systematic grid using the
parameters given in the pcigale.ini file.""" parameters given in the pcigale.ini file."""
def __init__(self, configuration): def __init__(self, conf):
"""Instantiate the class. """Instantiate the class.
Parameters Parameters
---------- ----------
configuration: dictionary conf: dictionary
Contains the modules in the order they are called Contains the modules in the order they are called
""" """
self.modules = configuration['sed_modules'] self.modules = conf['sed_modules']
self.parameters = [self._param_dict_combine(configuration['sed_modules_params'][module]) self.parameters = [self._param_dict_combine(conf['sed_modules_params'][module])
for module in self.modules] for module in self.modules]
self.shape = tuple(len(parameter) for parameter in self.parameters) self.shape = tuple(len(parameter) for parameter in self.parameters)
self.size = int(np.product(self.shape)) self.size = int(np.product(self.shape))
...@@ -138,16 +138,16 @@ class ParametersManagerFile(object): ...@@ -138,16 +138,16 @@ class ParametersManagerFile(object):
"""Class to generate a parameters manager for list of parameters given in an """Class to generate a parameters manager for list of parameters given in an
input file.""" input file."""
def __init__(self, configuration): def __init__(self, conf):
"""Instantiate the class. """Instantiate the class.
Parameters Parameters
---------- ----------
configuration: dictionary conf: dictionary
Contains the name of the file containing the parameters Contains the name of the file containing the parameters
""" """
table = read_table(configuration['parameters_file']) table = read_table(conf['parameters_file'])
table.sort(table.colnames) table.sort(table.colnames)
self.size = len(table) self.size = len(table)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment