From 9e30dcf87a2a11e4caf53ac989a739a434be89b5 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Solares <eglez@ast.cam.ac.uk> Date: Mon, 29 Apr 2019 16:03:16 +0100 Subject: [PATCH] Fix bare except --- stpt_pipeline/chi_functions.py | 2 +- stpt_pipeline/stpt_displacement.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stpt_pipeline/chi_functions.py b/stpt_pipeline/chi_functions.py index 83a6591..5b00cee 100644 --- a/stpt_pipeline/chi_functions.py +++ b/stpt_pipeline/chi_functions.py @@ -338,7 +338,7 @@ def find_overlap_conf( # in case of many nans, this fails, default to middle dx = desp_x[i_x][0] dy = desp_y[i_y][0] - except: + except IndexError: dx = int(np.median(desp_x)) dy = int(np.median(desp_y)) # diff --git a/stpt_pipeline/stpt_displacement.py b/stpt_pipeline/stpt_displacement.py index 2ed2e23..f73beb4 100644 --- a/stpt_pipeline/stpt_displacement.py +++ b/stpt_pipeline/stpt_displacement.py @@ -255,7 +255,7 @@ for this_dir in dirs: try: dx_mat = np.load(this_dir + 'desp_dist_x.npy') dy_mat = np.load(this_dir + 'desp_dist_y.npy') - except: + except FileNotFoundError: print('No saved displacements found') # # This is more or less the distance between images in detectors, -- GitLab