From 5e8aa406d052f539e23bfedf70ad1a91d017be6b Mon Sep 17 00:00:00 2001 From: devicerandom Date: Thu, 19 Nov 2009 19:10:11 +0000 Subject: [PATCH] (fit.py) Quick kludgy patch for crash of issue 0028 --- fit.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fit.py b/fit.py index c6a5b3a..b883ef1 100755 --- a/fit.py +++ b/fit.py @@ -294,8 +294,14 @@ class fitCommands: thule_index = len(xvector) #reverse etc. the domain ychunk=yvector[clicked_points[0].index:thule_index] - #print clicked_points[0].graph_coords[1] - y_evalchunk=np.linspace(min(ychunk),max(ychunk),100) + + if len(ychunk)>0: + y_evalchunk=np.linspace(min(ychunk),max(ychunk),100) + else: + #Empty y-chunk. It happens whenever we set the contact point after a recognized peak, + #or other buggy situations. Kludge to live with it now... + ychunk=yvector[:thule_index] + y_evalchunk=np.linspace(min(ychunk),max(ychunk),100) yfit_down=[-y for y in y_evalchunk] yfit_corr_down=[y+clicked_points[0].graph_coords[1] for y in yfit_down] -- 2.26.2