test/data/vclamp_jpk/README: Document sample versions
[hooke.git] / hooke / util / fit.py
index d73b11bad085f74dc72c0acca9b1778d48e93250..f0bf32c9f915595ab859befd6adeb5147719554f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of Hooke.
 #
 #
 # This file is part of Hooke.
 #
@@ -115,9 +115,9 @@ class ModelFitter (object):
     machine rounding during computation.  We expect the values to be close
     to the input settings (slope 7, offset -33).
 
     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
     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
     -32.890
 
     The offset is a bit off because, the range is not a multiple of
@@ -128,9 +128,9 @@ class ModelFitter (object):
     >>> m = LinearModel(data, rescale=True)
     >>> outqueue = Queue()
     >>> slope,offset = m.fit(outqueue=outqueue)
     >>> m = LinearModel(data, rescale=True)
     >>> outqueue = Queue()
     >>> slope,offset = m.fit(outqueue=outqueue)
-    >>> print '%.3f' % slope
+    >>> print('{:.3f}'.format(slope))
     7.000
     7.000
-    >>> print '%.3f' % offset
+    >>> print('{:.3f}'.format(offset))
     -32.890
 
     Test single-parameter models:
     -32.890
 
     Test single-parameter models:
@@ -149,7 +149,7 @@ class ModelFitter (object):
     >>> data = 20*numpy.sin(arange(1000)) + 7.*arange(1000)
     >>> m = SingleParameterModel(data)
     >>> slope, = m.fit(outqueue=outqueue)
     >>> 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):
     7.000
     """
     def __init__(self, *args, **kwargs):
@@ -285,7 +285,7 @@ class ModelFitter (object):
 #        def dist(px,py,linex,liney):
 #            distancesx=scipy.array([(px-x)**2 for x in linex])
 #            minindex=numpy.argmin(distancesx)
 #        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
 #
 #
 #            return (py-liney[minindex])**2
 #
 #