2020from simopt .base import Problem , Solver
2121from simopt .data_farming_base import DATA_FARMING_DIR
2222from simopt .experiment_base import (
23+ PlotType ,
2324 ProblemSolver ,
2425 ProblemsSolvers ,
2526 create_design ,
@@ -4027,7 +4028,7 @@ def show_plot_options(self, plot_type_tk: tk.StringVar) -> None:
40274028 subplot_type_options = [
40284029 "CDF Solvability" ,
40294030 "Quantile Solvability" ,
4030- "Difference of CDF Solvablility " ,
4031+ "Difference of CDF Solvability " ,
40314032 "Difference of Quantile Solvability" ,
40324033 ]
40334034 self .subplot_type_var = tk .StringVar ()
@@ -4317,7 +4318,7 @@ def enable_ref_solver(self, plot_type_tk: tk.StringVar) -> None:
43174318 if plot_type in ["CDF Solvability" , "Quantile Solvability" ]:
43184319 self .ref_solver_menu .configure (state = "disabled" )
43194320 elif plot_type in [
4320- "Difference of CDF Solvablility " ,
4321+ "Difference of CDF Solvability " ,
43214322 "Difference of Quantile Solvability" ,
43224323 ]:
43234324 self .ref_solver_menu .configure (state = "normal" )
@@ -4456,14 +4457,18 @@ def __plot_progress_curve(self) -> None:
44564457 parameters ["Quantile Probability" ] = beta
44574458 parameters ["Number Bootstrap Samples" ] = n_boot
44584459 parameters ["Confidence Level" ] = con_level
4460+ # Lookup plot type enum for passing to plotting function
4461+ subplot_type_enum : PlotType = PlotType .from_str (
4462+ subplot_type .lower ()
4463+ )
44594464 # create new plot for each problem
44604465 for i in range (n_problems ):
44614466 prob_list = []
44624467 for solver_group in exp_sublist :
44634468 prob_list .append (solver_group [i ])
44644469 returned_path = plot_progress_curves (
44654470 experiments = prob_list ,
4466- plot_type = subplot_type , # type: ignore
4471+ plot_type = subplot_type_enum ,
44674472 beta = beta ,
44684473 normalize = norm ,
44694474 all_in_one = all_in ,
@@ -4642,14 +4647,18 @@ def __plot_terminal_progress(self) -> None:
46424647 parameters ["Plot Type" ] = subplot_type
46434648 assert subplot_type in ["box" , "violin" ]
46444649 parameters ["Normalize Optimality Gaps" ] = normalize_str
4650+ # Lookup plot type enum for passing to plotting function
4651+ subplot_type_enum : PlotType = PlotType .from_str (
4652+ subplot_type .lower ()
4653+ )
46454654 # create a new plot for each problem
46464655 for i in range (n_problems ):
46474656 prob_list = []
46484657 for solver_group in exp_sublist :
46494658 prob_list .append (solver_group [i ])
46504659 returned_path = plot_terminal_progress (
46514660 experiments = prob_list ,
4652- plot_type = subplot_type , # type: ignore
4661+ plot_type = subplot_type_enum ,
46534662 all_in_one = all_in ,
46544663 normalize = norm ,
46554664 save_as_pickle = True ,
@@ -4736,7 +4745,7 @@ def __plot_solvability_profile(self) -> None:
47364745 subplot_types = {
47374746 "CDF Solvability" : "cdf_solvability" ,
47384747 "Quantile Solvability" : "quantile_solvability" ,
4739- "Difference of CDF Solvablility " : "diff_cdf_solvability" ,
4748+ "Difference of CDF Solvability " : "diff_cdf_solvability" ,
47404749 "Difference of Quantile Solvability" : "diff_quantile_solvability" ,
47414750 }
47424751 subplot_type = self .subplot_type_var .get ()
@@ -4768,11 +4777,12 @@ def __plot_solvability_profile(self) -> None:
47684777 "Difference of Quantile Solvability" ,
47694778 ]:
47704779 parameters ["Quantile Probability" ] = beta
4771-
4780+ # Lookup plot type enum for passing to plotting function
4781+ subplot_type_enum = PlotType .from_str (subplot_type )
47724782 if subplot_type in ["CDF Solvability" , "Quantile Solvability" ]:
47734783 returned_path = plot_solvability_profiles (
47744784 experiments = exp_sublist ,
4775- plot_type = plot_input , # type: ignore
4785+ plot_type = subplot_type_enum ,
47764786 all_in_one = all_in ,
47774787 n_bootstraps = n_boot ,
47784788 conf_level = con_level ,
@@ -4792,7 +4802,7 @@ def __plot_solvability_profile(self) -> None:
47924802 parameters ["Reference Solver" ] = ref_solver
47934803 returned_path = plot_solvability_profiles (
47944804 experiments = exp_sublist ,
4795- plot_type = plot_input , # type: ignore
4805+ plot_type = subplot_type_enum ,
47964806 all_in_one = all_in ,
47974807 n_bootstraps = n_boot ,
47984808 conf_level = con_level ,
0 commit comments