This bug was fixed by implementing a try/except scheme
try:
f = InterpolatedUnivariateSpline(x_points,y_points)
ySPLINE = f(newX)
for index, j in enumerate(ySPLINE):
if j > maximum[1]:
maximum = (newX[index],j)
except ValueError:
data = zip(x_points,y_points)
if self.log == True:
with open('LaCyTools.log', 'a') as flog:
flog.write(str(datetime.now())+ "\tGuassian Curve Fit failed for analyte: "+str(i[0])+", reverting to non fitted local maximum\n")
for j in data:
if j[1] > maximum[1]:
maximum = (j[0],j[1])
except:
print "Analyte: "+str(i[0])+" is being troublesome, kill it"
This bug was fixed by implementing a try/except scheme