machine rounding during computation. We expect the values to be close
to the input settings (slope 7, offset -33).
- >>> print '%.3f' % slope
+ >>> print('{:.3f}'.format(slope))
7.000
- >>> print '%.3f' % offset
+ >>> print('{:.3f}'.format(offset))
-32.890
The offset is a bit off because, the range is not a multiple of
>>> m = LinearModel(data, rescale=True)
>>> outqueue = Queue()
>>> slope,offset = m.fit(outqueue=outqueue)
- >>> print '%.3f' % slope
+ >>> print('{:.3f}'.format(slope))
7.000
- >>> print '%.3f' % offset
+ >>> print('{:.3f}'.format(offset))
-32.890
Test single-parameter models:
>>> data = 20*numpy.sin(arange(1000)) + 7.*arange(1000)
>>> m = SingleParameterModel(data)
>>> slope, = m.fit(outqueue=outqueue)
- >>> print '%.3f' % slope
+ >>> print('{:.3f}'.format(slope))
7.000
"""
def __init__(self, *args, **kwargs):
# def dist(px,py,linex,liney):
# distancesx=scipy.array([(px-x)**2 for x in linex])
# minindex=numpy.argmin(distancesx)
-# print px, linex[0], linex[-1]
+# print(px, linex[0], linex[-1])
# return (py-liney[minindex])**2
#
#