Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions runreeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def setupEnvironment(
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(',')

Expand All @@ -908,6 +908,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]
Expand All @@ -921,6 +924,12 @@ 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
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()

#%% User warnings
if (df_cases.loc['cleanup_level'].astype(int) > 0).any() and not skip_checks:
print(
Expand Down Expand Up @@ -950,7 +959,9 @@ 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:
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]: '))
Expand Down
Loading