File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,12 +177,17 @@ def main(argv=None):
177177
178178 try :
179179 table = count_trainable_lcs (survey_config )
180+ # Print before tearing down the cluster: on shared clusters
181+ # client.close() can hang and raise TimeoutError, which would
182+ # otherwise discard the already-computed result.
183+ print (f"Trainable light curves for { survey_config .catalog_root } , n_src >= { survey_config .n_src } :" )
184+ print (table .to_string (index = False ))
180185 finally :
181186 if client is not None :
182- client . close ()
183-
184- print ( f"Trainable light curves for { survey_config . catalog_root } , n_src >= { survey_config . n_src } :" )
185- print (table . to_string ( index = False ) )
187+ try :
188+ client . close ()
189+ except Exception as exc : # noqa: BLE001
190+ print (f"Warning: ignoring error during Dask client shutdown: { exc !r } " )
186191
187192
188193if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments