From 66e9ba1c4beca5bb768f09ac931e13b4401d71a9 Mon Sep 17 00:00:00 2001 From: Tom Silver Date: Mon, 6 Jun 2022 19:21:09 -0400 Subject: [PATCH] plotting fixes --- scripts/plotting/create_timing_option_learning_plots.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/plotting/create_timing_option_learning_plots.py b/scripts/plotting/create_timing_option_learning_plots.py index 11b69f7fea..fab2f5f8f6 100644 --- a/scripts/plotting/create_timing_option_learning_plots.py +++ b/scripts/plotting/create_timing_option_learning_plots.py @@ -105,13 +105,14 @@ def _load_results_for_seed(df: pd.DataFrame, selector: Callable[[pd.DataFrame], if np.isnan(result): continue # timeout all_time_results.append(result) - assert len(all_time_results) > 0 + if not all_time_results: + return [0, TIMEOUT], [0, 0] seed_xs = [0] + sorted(all_time_results) seed_ys = list(range(len(seed_xs))) assert seed_xs[-1] < TIMEOUT seed_xs.append(TIMEOUT) seed_ys.append(seed_ys[-1]) - seed_ys = np.array(seed_ys) / len(TASK_IDS) # convert to percent solved + seed_ys = 100 * np.array(seed_ys) / len(TASK_IDS) # convert to percent solved return seed_xs, seed_ys