fitbenchmarking.utils.options module

This file will handle all interaction with the options configuration file.

class fitbenchmarking.utils.options.Options(file_name=None)

Bases: object

An options class to store and handle all options for fitbenchmarking

DEFAULTS = {'FITTING': {'algorithm_type': 'all', 'jac_method': 'SciPyFD', 'num_method': '2point', 'num_runs': 5, 'software': ['scipy', 'scipy_ls'], 'use_errors': True}, 'LOGGING': {'append': False, 'external_output': 'log_only', 'file_name': 'fitbenchmarking.log', 'level': 'INFO'}, 'MINIMIZERS': {'bumps': ['amoeba', 'lm-bumps', 'newton', 'mp'], 'dfo': ['dfogn', 'dfols'], 'gsl': ['lmsder', 'lmder', 'nmsimplex', 'nmsimplex2', 'conjugate_pr', 'conjugate_fr', 'vector_bfgs', 'vector_bfgs2', 'steepest_descent'], 'mantid': ['BFGS', 'Conjugate gradient (Fletcher-Reeves imp.)', 'Conjugate gradient (Polak-Ribiere imp.)', 'Damped GaussNewton', 'Levenberg-Marquardt', 'Levenberg-MarquardtMD', 'Simplex', 'SteepestDescent', 'Trust Region'], 'minuit': ['minuit'], 'ralfit': ['gn', 'gn_reg', 'hybrid', 'hybrid_reg'], 'scipy': ['Nelder-Mead', 'Powell', 'CG', 'BFGS', 'Newton-CG', 'L-BFGS-B', 'TNC'], 'scipy_ls': ['lm-scipy-no-jac', 'lm-scipy', 'trf', 'dogbox']}, 'PLOTTING': {'colour_scale': [(1.1, '#fef0d9'), (1.33, '#fdcc8a'), (1.75, '#fc8d59'), (3, '#e34a33'), (inf, '#b30000')], 'comparison_mode': 'both', 'make_plots': True, 'results_dir': 'fitbenchmarking_results', 'table_type': ['acc', 'runtime', 'compare', 'local_min']}}
DEFAULT_FITTING = {'algorithm_type': 'all', 'jac_method': 'SciPyFD', 'num_method': '2point', 'num_runs': 5, 'software': ['scipy', 'scipy_ls'], 'use_errors': True}
DEFAULT_LOGGING = {'append': False, 'external_output': 'log_only', 'file_name': 'fitbenchmarking.log', 'level': 'INFO'}
DEFAULT_MINIMZERS = {'bumps': ['amoeba', 'lm-bumps', 'newton', 'mp'], 'dfo': ['dfogn', 'dfols'], 'gsl': ['lmsder', 'lmder', 'nmsimplex', 'nmsimplex2', 'conjugate_pr', 'conjugate_fr', 'vector_bfgs', 'vector_bfgs2', 'steepest_descent'], 'mantid': ['BFGS', 'Conjugate gradient (Fletcher-Reeves imp.)', 'Conjugate gradient (Polak-Ribiere imp.)', 'Damped GaussNewton', 'Levenberg-Marquardt', 'Levenberg-MarquardtMD', 'Simplex', 'SteepestDescent', 'Trust Region'], 'minuit': ['minuit'], 'ralfit': ['gn', 'gn_reg', 'hybrid', 'hybrid_reg'], 'scipy': ['Nelder-Mead', 'Powell', 'CG', 'BFGS', 'Newton-CG', 'L-BFGS-B', 'TNC'], 'scipy_ls': ['lm-scipy-no-jac', 'lm-scipy', 'trf', 'dogbox']}
DEFAULT_PLOTTING = {'colour_scale': [(1.1, '#fef0d9'), (1.33, '#fdcc8a'), (1.75, '#fc8d59'), (3, '#e34a33'), (inf, '#b30000')], 'comparison_mode': 'both', 'make_plots': True, 'results_dir': 'fitbenchmarking_results', 'table_type': ['acc', 'runtime', 'compare', 'local_min']}
VALID = {'FITTING': {'algorithm_type': ['all', 'ls', 'deriv_free', 'general'], 'jac_method': ['SciPyFD'], 'num_method': ['2point', '3point', 'cs'], 'software': ['bumps', 'dfo', 'gsl', 'mantid', 'minuit', 'ralfit', 'scipy', 'scipy_ls'], 'use_errors': [True, False]}, 'LOGGING': {'append': [True, False], 'external_output': ['debug', 'display', 'log_only'], 'level': ['NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']}, 'MINIMIZERS': {'bumps': ['amoeba', 'lm-bumps', 'newton', 'de', 'mp'], 'dfo': ['dfogn', 'dfols'], 'gsl': ['lmsder', 'lmder', 'nmsimplex', 'nmsimplex2', 'conjugate_pr', 'conjugate_fr', 'vector_bfgs', 'vector_bfgs2', 'steepest_descent'], 'mantid': ['BFGS', 'Conjugate gradient (Fletcher-Reeves imp.)', 'Conjugate gradient (Polak-Ribiere imp.)', 'Damped GaussNewton', 'Levenberg-Marquardt', 'Levenberg-MarquardtMD', 'Simplex', 'SteepestDescent', 'Trust Region'], 'minuit': ['minuit'], 'ralfit': ['gn', 'gn_reg', 'hybrid', 'hybrid_reg'], 'scipy': ['Nelder-Mead', 'Powell', 'CG', 'BFGS', 'Newton-CG', 'L-BFGS-B', 'TNC', 'SLSQP'], 'scipy_ls': ['lm-scipy-no-jac', 'lm-scipy', 'trf', 'dogbox']}, 'PLOTTING': {'comparison_mode': ['abs', 'rel', 'both'], 'make_plots': [True, False], 'table_type': ['acc', 'runtime', 'compare', 'local_min']}}
VALID_FITTING = {'algorithm_type': ['all', 'ls', 'deriv_free', 'general'], 'jac_method': ['SciPyFD'], 'num_method': ['2point', '3point', 'cs'], 'software': ['bumps', 'dfo', 'gsl', 'mantid', 'minuit', 'ralfit', 'scipy', 'scipy_ls'], 'use_errors': [True, False]}
VALID_LOGGING = {'append': [True, False], 'external_output': ['debug', 'display', 'log_only'], 'level': ['NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']}
VALID_MINIMIZERS = {'bumps': ['amoeba', 'lm-bumps', 'newton', 'de', 'mp'], 'dfo': ['dfogn', 'dfols'], 'gsl': ['lmsder', 'lmder', 'nmsimplex', 'nmsimplex2', 'conjugate_pr', 'conjugate_fr', 'vector_bfgs', 'vector_bfgs2', 'steepest_descent'], 'mantid': ['BFGS', 'Conjugate gradient (Fletcher-Reeves imp.)', 'Conjugate gradient (Polak-Ribiere imp.)', 'Damped GaussNewton', 'Levenberg-Marquardt', 'Levenberg-MarquardtMD', 'Simplex', 'SteepestDescent', 'Trust Region'], 'minuit': ['minuit'], 'ralfit': ['gn', 'gn_reg', 'hybrid', 'hybrid_reg'], 'scipy': ['Nelder-Mead', 'Powell', 'CG', 'BFGS', 'Newton-CG', 'L-BFGS-B', 'TNC', 'SLSQP'], 'scipy_ls': ['lm-scipy-no-jac', 'lm-scipy', 'trf', 'dogbox']}
VALID_PLOTTING = {'comparison_mode': ['abs', 'rel', 'both'], 'make_plots': [True, False], 'table_type': ['acc', 'runtime', 'compare', 'local_min']}
VALID_SECTIONS = ['MINIMIZERS', 'FITTING', 'PLOTTING', 'LOGGING']
minimizers
read_value(func, option)

Helper function which loads in the value

Parameters:
  • func (callable) – configparser function
  • option (str) – option to be read for file
Returns:

value of the option

Return type:

list/str/int/bool

reset()

Resets options object when running multiple problem groups.

results_dir
write(file_name)

Write the contents of the options object to a new options file.

Parameters:file_name (str) – The path to the new options file
write_to_stream(file_object)

Write the contents of the options object to a file object.

fitbenchmarking.utils.options.read_list(s)

Utility function to allow lists to be read by the config parser

Parameters:s (string) – string to convert to a list
Returns:list of items
Return type:list of str