From: devicerandom Date: Thu, 19 Nov 2009 19:10:11 +0000 (+0000) Subject: (fit.py) Quick kludgy patch for crash of issue 0028 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5e8aa406d052f539e23bfedf70ad1a91d017be6b;p=hooke.git (fit.py) Quick kludgy patch for crash of issue 0028 --- 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]