#
# This file is part of Hooke.
#
-# Hooke is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
-# Hooke is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+# Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Hooke. If not, see
inqueue = None
outqueue = NullQueue()
for i,block in enumerate(curve.data):
+ numpy.savetxt(open('curve.dat', 'w'), block, delimiter='\t')
params = {'curve':curve, 'block':i}
- contact._run(hooke, inqueue, outqueue, params)
+ try:
+ contact._run(hooke, inqueue, outqueue, params)
+ except PoorFit, e:
+ raise PoorFit('Could not fit %s %s: %s'
+ % (curve.path, i, str(e)))
force._run(hooke, inqueue, outqueue, params)
return curve
if abs(params[3]*10) > abs(params[1]) :
raise PoorFit('Slope in non-contact region, or no slope in contact')
if params[2] < self.info['min position']+0.02*self.info['position range']:
- raise poorFit(
+ raise PoorFit(
'No kink (kink %g less than %g, need more space to left)'
% (params[2],
self.info['min position']+0.02*self.info['position range']))