wf_psf.utils.configs_handler module
Configs_Handler.
A module which provides general utility methods to manage the parameters of the config files
- Authors:
Jennifer Pollack <jennifer.pollack@cea.fr>
- exception wf_psf.utils.configs_handler.ConfigParameterError(message='An error with your config settings occurred.')[source]
Bases:
Exception
Custom Config Parameter Error exception class for specific error scenarios.
- class wf_psf.utils.configs_handler.DataConfigHandler(data_conf, training_model_params)[source]
Bases:
object
DataConfigHandler.
A class to handle data configuration parameters.
- Parameters:
data_conf (str) – Path of the data configuration file
training_model_params (Recursive Namespace object) – Recursive Namespace object containing the training model parameters
- class wf_psf.utils.configs_handler.MetricsConfigHandler(metrics_conf, file_handler, training_conf=None)[source]
Bases:
object
MetricsConfigHandler.
A class to handle metrics configuation parameters.
- Parameters:
ids (tuple) – A tuple containing a string id for the Configuration Class
metrics_conf (str) – Path to the metrics configuration file
file_handler (object) – An instance of the FileIOHandler
training_conf (RecursiveNamespace object) – RecursiveNamespace object containing the training configuration parameters
- Attributes:
- data_conf
- metrics_conf
- metrics_dir
- plotting_conf
- psf_model
- training_conf
weights_basename_filepath
Get PSF model weights filepath.
- weights_path
Methods
call_plot_config_handler_run
(model_metrics)Make Metrics Plots.
run
()Run.
- call_plot_config_handler_run(model_metrics)[source]
Make Metrics Plots.
A function to call the PlottingConfigHandler run command to generate metrics plots.
- Parameters:
model_metrics (dict) – A dictionary storing the metrics output generated during evaluation of the trained PSF model.
- property data_conf
- ids = ('metrics_conf',)
- property metrics_conf
- property metrics_dir
- property plotting_conf
- property psf_model
- property training_conf
- property weights_basename_filepath
Get PSF model weights filepath.
A function to return the basename of the user-specified psf model weights path.
- Returns:
weights_basename – The basename of the psf model weights to be loaded.
- Return type:
- property weights_path
- class wf_psf.utils.configs_handler.PlottingConfigHandler(plotting_conf, file_handler)[source]
Bases:
object
PlottingConfigHandler.
A class to handle plotting config settings.
- Parameters:
Methods
Check and Update Metrics Confs.
Load Metrics into Dictionary.
Make dictionary of metrics.
run
()Run.
- check_and_update_metrics_confs()[source]
Check and Update Metrics Confs.
A function to check if user provided inputs metrics dir to add to metrics_confs dictionary.
- ids = ('plotting_conf',)
- load_metrics_into_dict()[source]
Load Metrics into Dictionary.
A method to load a metrics file of a trained model from a previous run into a dictionary.
- Returns:
metrics_files_dict – A dictionary containing all of the metrics from the loaded metrics files.
- Return type:
- class wf_psf.utils.configs_handler.TrainingConfigHandler(training_conf, file_handler)[source]
Bases:
object
TrainingConfigHandler.
A class to handle training configuration parameters.
- Parameters:
Methods
run
()Run.
- ids = ('training_conf',)
- wf_psf.utils.configs_handler.get_run_config(run_config, config_params, file_handler)[source]
Get Run Configuration.
A function to get the configuration for a wf-psf run.