From a516dc5466e14d28271df676e386e1ce69346f18 Mon Sep 17 00:00:00 2001 From: "Mindermann, Kennedy" Date: Thu, 14 May 2026 13:17:08 -0600 Subject: [PATCH 1/6] quit reeds run if no valid scenarios --- runreeds.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/runreeds.py b/runreeds.py index 6bcd6664..84217ea8 100644 --- a/runreeds.py +++ b/runreeds.py @@ -854,6 +854,7 @@ def setupEnvironment( single=single, skip_checks=skip_checks, ) + all_case_names = list(df_cases.columns) ## Propagate debug setting if debug: df_cases.loc['debug'] = str(debug) @@ -885,8 +886,8 @@ def setupEnvironment( for s in single.split(','): if s not in df_cases: err = ( - f'Specified single={single} but available cases are:\n' - + '\n> '.join([c for c in df_cases.columns]) + f'Specified single={single} but available cases are: ' + + ', '.join([c for c in df_cases.columns]) ) raise KeyError(err) df_cases = df_cases[single.split(',')].copy() @@ -896,6 +897,9 @@ def setupEnvironment( outpaths = [os.path.join(reeds_path,'runs',f'{BatchName}_{case}') for case in casenames] existing_outpaths = [i for i in outpaths if os.path.isdir(i)] if len(existing_outpaths): + if len(existing_outpaths) == 0: + print('Existing output directories were not overwritten. Exiting without starting runs.') + quit() print( f'The following {len(existing_outpaths)} output directories already exist:\n' + 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n' @@ -908,6 +912,9 @@ def setupEnvironment( shutil.rmtree(outpath) else: keep = [i for (i,c) in enumerate(outpaths) if c not in existing_outpaths] + if len(keep) == 0: + print('All output directories already exist and were not overwritten. Exiting without starting runs.') + quit() caseList = [caseList[i] for i in keep] casenames = [casenames[i] for i in keep] caseSwitches = [caseSwitches[i] for i in keep] @@ -921,6 +928,11 @@ def setupEnvironment( if skip.lower() not in ['y','yes']: raise IsADirectoryError('\n'+'\n'.join(existing_outpaths)) + # Exit early if no runnable cases remain after filtering + if len(caseList) == 0: + print(f"All {len(all_case_names)} scenario(s) in {cases_filename} have ignore=1. Exiting without starting runs.") + quit() + #%% User warnings if (df_cases.loc['cleanup_level'].astype(int) > 0).any() and not skip_checks: print( @@ -951,6 +963,9 @@ def setupEnvironment( WORKERS = simult_runs else: WORKERS = int(input('Number of simultaneous runs [integer]: ')) + if WORKERS <=0: + print('Number of simultaneous runs must be at least 1. Exiting.') + quit() if 'int' in df_cases.loc['timetype'].tolist() or 'win' in df_cases.loc['timetype'].tolist(): ccworkers = int(input('Number of simultaneous CC/Curt runs [integer]: ')) From 3d6e1e2eb7dfae9fe70340d2d565f593ad3b90a0 Mon Sep 17 00:00:00 2001 From: Kennedy Mindermann <49201708+kennedy-mindermann@users.noreply.github.com> Date: Mon, 18 May 2026 14:37:22 -0600 Subject: [PATCH 2/6] Update runreeds.py Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com> --- runreeds.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/runreeds.py b/runreeds.py index 84217ea8..a4a91c48 100644 --- a/runreeds.py +++ b/runreeds.py @@ -897,9 +897,6 @@ def setupEnvironment( outpaths = [os.path.join(reeds_path,'runs',f'{BatchName}_{case}') for case in casenames] existing_outpaths = [i for i in outpaths if os.path.isdir(i)] if len(existing_outpaths): - if len(existing_outpaths) == 0: - print('Existing output directories were not overwritten. Exiting without starting runs.') - quit() print( f'The following {len(existing_outpaths)} output directories already exist:\n' + 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n' From f6ce5a7a4c71b9a3c8344ab0b8c69c86bc2d1b97 Mon Sep 17 00:00:00 2001 From: Kennedy Mindermann <49201708+kennedy-mindermann@users.noreply.github.com> Date: Mon, 18 May 2026 14:37:32 -0600 Subject: [PATCH 3/6] Update runreeds.py Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com> --- runreeds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runreeds.py b/runreeds.py index a4a91c48..df659e74 100644 --- a/runreeds.py +++ b/runreeds.py @@ -959,7 +959,7 @@ def setupEnvironment( elif simult_runs > 0: WORKERS = simult_runs else: - WORKERS = int(input('Number of simultaneous runs [integer]: ')) + WORKERS = int(input('Number of simultaneous runs [positive integer]: ')) if WORKERS <=0: print('Number of simultaneous runs must be at least 1. Exiting.') quit() From 40ba278ab18ff12c91e3c52f3655c9ab3992ede6 Mon Sep 17 00:00:00 2001 From: Kennedy Mindermann <49201708+kennedy-mindermann@users.noreply.github.com> Date: Mon, 18 May 2026 14:37:40 -0600 Subject: [PATCH 4/6] Update runreeds.py Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com> --- runreeds.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runreeds.py b/runreeds.py index df659e74..18dc8445 100644 --- a/runreeds.py +++ b/runreeds.py @@ -960,9 +960,8 @@ def setupEnvironment( WORKERS = simult_runs else: WORKERS = int(input('Number of simultaneous runs [positive integer]: ')) - if WORKERS <=0: - print('Number of simultaneous runs must be at least 1. Exiting.') - quit() + if WORKERS <= 0: + raise ValueError(f'Provided {WORKERS} but must be a positive integer') if 'int' in df_cases.loc['timetype'].tolist() or 'win' in df_cases.loc['timetype'].tolist(): ccworkers = int(input('Number of simultaneous CC/Curt runs [integer]: ')) From d2a0c8b6873570272203cbce9c72f3384093d3cb Mon Sep 17 00:00:00 2001 From: "Mindermann, Kennedy" Date: Mon, 18 May 2026 15:20:39 -0600 Subject: [PATCH 5/6] change type of error so newline characters print correctly --- runreeds.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runreeds.py b/runreeds.py index 18dc8445..ed08e0ec 100644 --- a/runreeds.py +++ b/runreeds.py @@ -886,10 +886,10 @@ def setupEnvironment( for s in single.split(','): if s not in df_cases: err = ( - f'Specified single={single} but available cases are: ' - + ', '.join([c for c in df_cases.columns]) + f'Specified single={single} but available cases are:\n' + + '\n> '.join([c for c in df_cases.columns]) ) - raise KeyError(err) + raise ValueError(err) df_cases = df_cases[single.split(',')].copy() casenames = single.split(',') From c8fc64c361555e3bf321db1533c356fd7d08bcbb Mon Sep 17 00:00:00 2001 From: "Mindermann, Kennedy" Date: Mon, 18 May 2026 15:25:00 -0600 Subject: [PATCH 6/6] minor cleanup in runreeds.py --- runreeds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runreeds.py b/runreeds.py index ed08e0ec..6f15a290 100644 --- a/runreeds.py +++ b/runreeds.py @@ -854,7 +854,6 @@ def setupEnvironment( single=single, skip_checks=skip_checks, ) - all_case_names = list(df_cases.columns) ## Propagate debug setting if debug: df_cases.loc['debug'] = str(debug) @@ -926,6 +925,7 @@ def setupEnvironment( raise IsADirectoryError('\n'+'\n'.join(existing_outpaths)) # Exit early if no runnable cases remain after filtering + all_case_names = list(df_cases.columns) if len(caseList) == 0: print(f"All {len(all_case_names)} scenario(s) in {cases_filename} have ignore=1. Exiting without starting runs.") quit()