fitbenchmarking.core.results_output module
Functions that create the tables, support pages, figures, and indexes.
- fitbenchmarking.core.results_output.check_max_solvers(opts, solvers, max_solvers)
Check number of solvers and update the options to display in the dropdown.
- Parameters:
opts (dict[str]) – The options for the dropdown to be updated
solvers (list[str]) – The solvers to be plotted
max_solvers (int) – Maximum number of solvers that can be plotted
- Returns:
Options to display in the dropdown
- Return type:
dict[str]
- fitbenchmarking.core.results_output.create_directories(options, group_name)
Create the directory structure ready to store the results
- Parameters:
options (fitbenchmarking.utils.options.Options) – The options used in the fitting problem and plotting
group_name (str) – name of the problem group
- Returns:
paths to the top level group results, support pages, and figures directories
- Return type:
(str, str, str)
- fitbenchmarking.core.results_output.create_index_page(options: Options, groups: list[str], result_directories: list[str]) str
Creates the results index page for the benchmark, and copies the fonts and js directories to the correct location.
- Parameters:
options (fitbenchmarking.utils.options.Options) – The user options for the benchmark.
groups (A list of strings.) – Names for each of the problem set groups.
result_directories – Result directory paths for each
problem set group. :type result_directories: A list of strings. :return: The filepath of the results_index.html file. :rtype: str
- fitbenchmarking.core.results_output.create_plots(options, results, best_results, figures_dir)
Create a plot for each result and store in the figures directory
- Parameters:
options (fitbenchmarking.utils.options.Options) – The options used in the fitting problem and plotting
results (list of list of fitbenchmarking.utils.fitbm_result.FittingResult) – results nested array of objects
best_results (list[dict[str: fitbenchmarking.utils.fitbm_result.FittingResult]]) – best result for each problem seperated by cost function
figures_dir (str) – Path to directory to store the figures in
- fitbenchmarking.core.results_output.create_problem_level_index(options, table_names, group_name, group_dir, table_descriptions)
Generates problem level index page.
- Parameters:
options (fitbenchmarking.utils.options.Options) – The options used in the fitting problem and plotting
table_names (list) – list of table names
group_name (str) – name of the problem group
group_dir (str) – Path to the directory where the index should be stored
table_descriptions (dict) – dictionary containing descriptions of the tables and the comparison mode
- fitbenchmarking.core.results_output.display_page(pathname, profile_instances_all_groups, layout, max_solvers)
Update the layout of the dash app.
- Parameters:
pathname (str) – The link to the page with the Dash plot
profile_instances_all_groups (dict[str[dict]]) – The data to be plotted
layout (list of dcc or html components) – Layout of the Dash app
max_solvers (int) – Maximum number of solvers that can be plotted
- Returns:
The updated layout
- Return type:
html.Div
- fitbenchmarking.core.results_output.open_browser(output_file: str, options, pp_dfs_all_prob_sets) None
Opens a browser window to show the results of a fit benchmark.
- Parameters:
output_file (str) – The absolute path to the results index file.
options (fitbenchmarking.utils.options.Options) – The user options for the benchmark.
pp_dfs_all_prob_sets (dict[str, dict[str, pandas.DataFrame]]) – For each problem set, data to create dash plots.
- fitbenchmarking.core.results_output.preprocess_data(results: list[FittingResult])
Generate a dictionary of results lists sorted into the correct order with rows and columns as the key and list elements respectively.
This is used to create HTML and txt tables. This is stored in self.sorted_results
- Parameters:
results (list[fitbenchmarking.utils.fitbm_result.FittingResult]) – The results to process
- Returns:
The best result grouped by row and category (cost function), The sorted results grouped by row and category
- Return type:
dict[str, dict[str, utils.fitbm_result.FittingResult]], dict[str, dict[str, list[utils.fitbm_result.FittingResult]]]
- fitbenchmarking.core.results_output.run_dash_app(options, pp_dfs_all_prob_sets) None
Runs the Dash app to produce the interactive performance profile plots.
- Parameters:
options (fitbenchmarking.utils.options.Options) – The user options for the benchmark.
pp_dfs_all_prob_sets (dict[str, dict[str, pandas.DataFrame]]) – For each problem set, data to create dash plots.
- fitbenchmarking.core.results_output.save_results(options, results, group_name, failed_problems, unselected_minimizers)
Create all results files and store them. Result files are plots, support pages, tables, and index pages.
- Parameters:
options (fitbenchmarking.utils.options.Options) – The options used in the fitting problem and plotting
results (list[fitbenchmarking.utils.fitbm_result.FittingResult]) – The results from fitting
group_name (str) – name of the problem group
failed_problems (list) – list of failed problems to be reported in the html output
- Params unselected_minimizers:
Dictionary containing unselected minimizers based on the algorithm_type option
- Returns:
Path to directory of group results, data for building the performance profile plots
- Return type:
str, dict[str, pandas.DataFrame]
- fitbenchmarking.core.results_output.update_warning(solvers, max_solvers)
Give a warning if the number of solvers is above the maximum that can be displayed.
- Parameters:
solvers (list[str]) – The solvers to be plotted
max_solvers (int) – Maximum number of solvers that can be plotted
- Returns:
The warning
- Return type:
str