Commit 39ee66b7 authored by Médéric Boquien's avatar Médéric Boquien

Rename ParametersHandler to ParametersManager to be consistent with new...

Rename ParametersHandler to ParametersManager to be consistent with new managers that will come in the near future.
parent a71a1db5
......@@ -9,7 +9,7 @@ import sys
from .session.configuration import Configuration
from .analysis_modules import get_module
from .handlers.parameters_handler import ParametersHandler
from .handlers.parameters_handler import ParametersManager
__version__ = "0.10.0"
......@@ -40,7 +40,7 @@ def check(config):
if configuration:
print("With this configuration cigale will compute {} "
"models.".format(ParametersHandler(configuration).size))
"models.".format(ParametersManager(configuration).size))
def run(config):
......
......@@ -41,7 +41,7 @@ from .workers import sed as worker_sed
from .workers import init_sed as init_worker_sed
from .workers import init_analysis as init_worker_analysis
from .workers import analysis as worker_analysis
from ...handlers.parameters_handler import ParametersHandler
from ...handlers.parameters_handler import ParametersManager
# Tolerance threshold under which any flux or error is considered as 0.
......@@ -134,12 +134,12 @@ class PdfAnalysis(AnalysisModule):
z = np.array(conf['sed_modules_params']['redshifting']['redshift'])
# The parameters handler allows us to retrieve the models parameters
# The parameters manager allows us to retrieve the models parameters
# from a 1D index. This is useful in that we do not have to create
# a list of parameters as they are computed on-the-fly. It also has
# nice goodies such as finding the index of the first parameter to
# have changed between two indices or the number of models.
params = ParametersHandler(conf)
params = ParametersManager(conf)
n_params = params.size
# Retrieve an arbitrary SED to obtain the list of output parameters
......
......@@ -25,8 +25,8 @@ def init_sed(params, filters, analysed, fluxes, variables, t_begin, n_computed):
Parameters
----------
params: ParametersHandler
Handles the parameters from a 1D index.
params: ParametersManager
Manages the parameters from a 1D index.
filters: List
Contains the names of the filters to compute the fluxes.
analysed: list
......@@ -78,8 +78,8 @@ def init_analysis(params, filters, analysed, z, fluxes, variables,
Parameters
----------
params: ParametersHandler
Handles the parameters from a 1D index.
params: ParametersManager
Manages the parameters from a 1D index.
filters: list
Contains filters to compute the fluxes.
analysed: list
......
......@@ -25,7 +25,7 @@ from .. import AnalysisModule
from ..utils import save_fluxes
from .workers import init_fluxes as init_worker_fluxes
from .workers import fluxes as worker_fluxes
from ...handlers.parameters_handler import ParametersHandler
from ...handlers.parameters_handler import ParametersManager
class SaveFluxes(AnalysisModule):
......@@ -72,12 +72,12 @@ class SaveFluxes(AnalysisModule):
name.endswith('_err')]
n_filters = len(filters)
# The parameters handler allows us to retrieve the models parameters
# The parameters manager allows us to retrieve the models parameters
# from a 1D index. This is useful in that we do not have to create
# a list of parameters as they are computed on-the-fly. It also has
# nice goodies such as finding the index of the first parameter to
# have changed between two indices or the number of models.
params = ParametersHandler(conf)
params = ParametersManager(conf)
n_params = params.size
info = conf['analysis_params']['variables']
......
......@@ -21,8 +21,8 @@ def init_fluxes(params, filters, save_sed, variables, fluxes, info, t_begin,
Parameters
----------
params: ParametersHandler
Handles the parameters from a 1D index.
params: ParametersManager
Manages the parameters from a 1D index.
filters: List
Contains the names of the filters to compute the fluxes.
save_sed: boolean
......@@ -75,7 +75,7 @@ def fluxes(idx):
----------
idx: int
Index of the model to retrieve its parameters from the parameters
handler.
manager.
"""
global gbl_previous_idx, gbl_keys
......
......@@ -9,14 +9,14 @@ import itertools
import numpy as np
from ..utils import read_table
from ..warehouse import SedWarehouse
class ParametersHandler(object):
"""Class to abstract the call to the relevant parameters handler depending
class ParametersManager(object):
"""Class to abstract the call to the relevant parameters manager depending
how the physical parameters of the models are provided (directly in the
pcigale.ini file ).
A ParametersHandler allows to generate a list containing the parameters for
A ParametersManager allows to generate a list containing the parameters for
a modules whose index is passed as an argument. It also allows to know what
modules have changed their parameters given their indices. Because the
order of the modules is optimised to minimise the computations, this allows
......@@ -25,13 +25,13 @@ class ParametersHandler(object):
def __new__(object, configuration):
if configuration['parameters_file']:
return ParametersHandlerFile(configuration)
return ParametersManagerFile(configuration)
else:
return ParametersHandlerGrid(configuration)
return ParametersManagerGrid(configuration)
class ParametersHandlerGrid(object):
"""Class to generate a parameters handler for a systematic grid using the
class ParametersManagerGrid(object):
"""Class to generate a parameters manager for a systematic grid using the
parameters given in the pcigale.ini file."""
def __init__(self, configuration):
......@@ -134,8 +134,8 @@ class ParametersHandlerGrid(object):
return len(self.shape)
class ParametersHandlerFile(object):
"""Class to generate a parameters handler for list of parameters given in an
class ParametersManagerFile(object):
"""Class to generate a parameters manager for list of parameters given in an
input file."""
def __init__(self, configuration):
......
......@@ -14,7 +14,7 @@ from glob import glob # To allow the use of glob() in "eval..."
import numpy as np
import validate
from ..handlers.parameters_handler import ParametersHandler
from ..handlers.parameters_handler import ParametersManager
from ..data import Database
from ..utils import read_table
from .. import sed_modules
......@@ -315,7 +315,7 @@ class Configuration(object):
configuration file and must be extracted from a dummy run."""
if not self.config['analysis_params']['variables']:
warehouse = SedWarehouse()
params = ParametersHandler(self.config.dict())
params = ParametersManager(self.config.dict())
sed = warehouse.get_sed(params.modules, params.from_index(0))
info = list(sed.info.keys())
info.sort()
......
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