File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1108,16 +1108,19 @@ def get_directory_contents(results_dir: Path):
11081108 most_recent_summary = max (summary_files , key = os .path .getctime )
11091109 summary_df = pd .read_csv (most_recent_summary )
11101110
1111+ if len (summary_df ) == 0 or summary_df ["avg_reward" ].isna ().all ():
1112+ continue # skip if all avg_reward are NaN
1113+
11111114 # get row with max avg_reward
1112- max_reward_row = summary_df .loc [summary_df ["avg_reward" ].idxmax ()]
1115+ max_reward_row = summary_df .loc [summary_df ["avg_reward" ].idxmax (skipna = True )]
11131116 reward = max_reward_row ["avg_reward" ] * 100
11141117 completed = max_reward_row ["n_completed" ]
11151118 n_err = max_reward_row ["n_err" ]
11161119 exp_description += (
11171120 f" - avg-reward: { reward :.1f} % - completed: { completed } - errors: { n_err } "
11181121 )
11191122 except Exception as e :
1120- print (f"Error while reading summary file: { e } " )
1123+ print (f"Error while reading summary file { most_recent_summary } : { e } " )
11211124
11221125 exp_descriptions .append (exp_description )
11231126
You can’t perform that action at this time.
0 commit comments