wf_psf.utils.configs_handler
Configs_Handler.
A module which provides general utility methods to manage the parameters of the config files
- Authors:
Jennifer Pollack <jennifer.pollack@cea.fr>
Functions
|
Get Run Configuration Instance. |
|
Register Config Class. |
|
Set Run Configuration Class. |
Classes
|
DataConfigHandler. |
|
MetricsConfigHandler. |
|
PlottingConfigHandler. |
|
TrainingConfigHandler. |
Exceptions
|
Custom Config Parameter Error exception class for specific error scenarios. |
- exception wf_psf.utils.configs_handler.ConfigParameterError(message='An error with your config settings occurred.')[source]
Bases:
ExceptionCustom Config Parameter Error exception class for specific error scenarios.
- class wf_psf.utils.configs_handler.DataConfigHandler(data_conf, training_model_params, batch_size=16, load_data=True)[source]
Bases:
objectDataConfigHandler.
A class to handle data configuration parameters.
- class wf_psf.utils.configs_handler.MetricsConfigHandler(metrics_conf, file_handler, training_conf=None)[source]
Bases:
objectMetricsConfigHandler.
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_confGet Data Conf.
metrics_confGet Metrics Conf.
metrics_dirGet Metrics Directory.
plotting_confGet Plotting Conf.
psf_modelGet PSF Model.
training_confGet Training Conf.
weights_basename_filepathGet PSF model weights filepath.
weights_pathGet 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
Get Data Conf.
A function to return an instance of the DataConfigHandler class.
- Return type:
An instance of the DataConfigHandler class.
- ids = ('metrics_conf',)
- property metrics_conf
Get Metrics Conf.
A function to return the metrics configuration file name.
- Returns:
An instance of the metrics configuration file.
- Return type:
- property metrics_dir
Get Metrics Directory.
A function that returns path of metrics directory.
- Returns:
Absolute path to metrics directory
- Return type:
- property plotting_conf
Get Plotting Conf.
A function to return the plotting configuration file name.
- Returns:
Name of plotting configuration file
- Return type:
- property psf_model
Get PSF Model.
A function to return an instance of the PSF model to be evaluated.
- Returns:
psf_model – An instance of the PSF model to be evaluated.
- Return type:
obj
- property training_conf
Get Training Conf.
A function to return the training configuration file name.
- Returns:
An instance of the training configuration file.
- Return type:
- 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:
- class wf_psf.utils.configs_handler.PlottingConfigHandler(plotting_conf, file_handler)[source]
Bases:
objectPlottingConfigHandler.
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:
objectTrainingConfigHandler.
A class to handle training configuration parameters.
- Parameters:
Methods
run()Run.
- ids = ('training_conf',)
- wf_psf.utils.configs_handler.get_run_config(run_config_name, *config_params)[source]
Get Run Configuration Instance.
A function to retrieve an instance of the appropriate configuration class for a WF-PSF run.