@@ -75,8 +75,7 @@ def get_args():
7575 parser .add_argument ("-r" ,
7676 "--reachsubset" ,
7777 type = str ,
78- help = "Name of reach subset file" ,
79- default = "reaches_of_interest.json" )
78+ help = "Name of reach subset file" )
8079
8180 return parser .parse_args ()
8281
@@ -98,7 +97,7 @@ def get_reach_list(indir:str, continent_prefix:str, continent_id_list:list, expa
9897
9998 # read in data depending on if it is the first or second run of the setfinder and return a list of reaches to consider
10099
101- if expanded :
100+ if expanded or reach_subset_file :
102101 with open (os .path .join (indir , reach_subset_file )) as jsonfile :
103102 reaches_of_interest = json .load (jsonfile )
104103
@@ -179,20 +178,28 @@ def main():
179178 else :
180179 reach_list = get_reach_list (indir = indir , continent_prefix = continent_prefix , continent_id_list = continent_id_list ,
181180 expanded = expanded , reach_subset_file = reach_subset_file )
182- print (f"Number of reaches to process: { len (reach_list )} " )
181+ print (f"Number of reaches to process: { len (list ( set ( reach_list )) )} " )
183182
184183 if reach_list :
185184
186185 sword_file = os .path .basename (sword_filepath )
187186 reach_dict_list = parse_reach_list_for_output (reach_list = list (set (reach_list )), continent_prefix = continent_prefix ,
188187 sword_version = sword_version , sword_file = sword_file )
189188
189+ print ('here is how many before generation of sets' , len (list (set (reach_list ))))
190+
190191 # Generate sets for FLPEs
191192 reach_list = generate_sets (reaches = reach_dict_list , continent = continent_prefix ,
192193 output_dir = outdir , algorithms = algorithms ,
193194 sword_dataset = sword , sword_filepath = sword_filepath ,
194195 expanded = expanded )
195196
197+ print ('here is how many after generation of sets' , len (list (set (reach_list ))))
198+ print (reach_list [:5 ])
199+
200+ reach_dict_list = parse_reach_list_for_output (reach_list = list (set (reach_list )), continent_prefix = continent_prefix ,
201+ sword_version = sword_version , sword_file = sword_file )
202+
196203 save_reach_list (outdir = outdir , reachesjson_dict = reach_dict_list , continent_prefix = continent_prefix , expanded = expanded )
197204
198205 else :
0 commit comments