@@ -32,14 +32,12 @@ class FileHandler(object):
3232 List of modules to be run
3333 config : CustomParser
3434 Configuaration parser instance
35- exclusive : str, optional
36- Run this file number string exclusively if given, the default is None
3735 verbose : bool, optional
3836 Verbose setting, default is True
3937
4038 """
4139
42- def __init__ (self , run_name , modules , config , exclusive = None , verbose = True ):
40+ def __init__ (self , run_name , modules , config , verbose = True ):
4341
4442 self ._run_name = run_name
4543
@@ -48,7 +46,6 @@ def __init__(self, run_name, modules, config, exclusive=None, verbose=True):
4846 raise ValueError ("Invalid module list, check for a trailing comma" )
4947
5048 self ._config = config
51- self ._exclusive = exclusive
5249 self ._verbose = verbose
5350
5451 self .module_runners = get_module_runners (self ._module_list )
@@ -1089,7 +1086,20 @@ def _format_process_list(
10891086 if isinstance (self ._number_list , type (None )):
10901087 number_list = np .load (memory_map , mmap_mode = "r" )
10911088 else :
1089+ # NUMBER_LIST comes from the config on faith; check every
1090+ # entry against the numbers actually found on disk so that a
1091+ # wrong ID fails here, at start-up, rather than when a module
1092+ # first tries to open the (non-existent) files (#746).
10921093 number_list = self ._number_list
1094+ scanned = set (np .load (memory_map , mmap_mode = "r" ))
1095+ missing = [num for num in number_list if num not in scanned ]
1096+ if missing :
1097+ raise ValueError (
1098+ f"No input file found matching NUMBER_LIST "
1099+ f"entr{ 'ies' if len (missing ) > 1 else 'y' } "
1100+ f"{ missing } ; { len (scanned )} input file number(s) "
1101+ f"found on disk."
1102+ )
10931103
10941104 if len (number_list ) == 0 :
10951105 msg = "Empty number list"
@@ -1107,20 +1117,6 @@ def _format_process_list(
11071117 + f'numbering scheme "{ num_scheme } ".'
11081118 )
11091119
1110- # If "exclusive" options is set: discard all non-matching IDs
1111- if self ._exclusive is not None :
1112- id_to_test = f"-{ self ._exclusive .replace ('.' , '-' )} "
1113- if number == id_to_test :
1114- if self ._verbose :
1115- print (
1116- f"-- Using exclusive number { self ._exclusive } ({ id_to_test } )"
1117- )
1118- else :
1119- if self ._verbose :
1120- # print(f"Skipping {number}, not equal to {self._exclusive} ({id_to_test})")
1121- pass
1122- continue
1123-
11241120 if run_method == "serial" :
11251121 process_items = []
11261122 else :
@@ -1134,11 +1130,7 @@ def _format_process_list(
11341130 process_list .append (process_items )
11351131
11361132 if len (process_list ) == 0 :
1137- msg = "Empty process list"
1138- if self ._exclusive is not None :
1139- if len (number_list ) > 0 :
1140- msg = f"{ msg } . No input file found matching exclusive ID"
1141- raise ValueError (msg )
1133+ raise ValueError ("Empty process list" )
11421134
11431135 return process_list
11441136
0 commit comments