def jump(self, axis_name, position, steps=1, sleep=None):
"Move the output named `axis_name` to `position`."
- _LOG.debug('jump %s to %s in %d steps' % (axis_name, position, steps))
+ _LOG.debug('jump {} to {} in {} steps'.format(
+ axis_name, position, steps))
if steps > 1:
try:
orig_pos = self.last_output[axis_name]
("cannot make a soft jump to {} because we don't have a "
'last-output position for {}').format(
position, axis_name))
- steps = 1
+ return self.jump(axis_name=axis_name, position=position)
else:
- for pos in _numpy.linspace(orig_pos, position, steps+1)[1:]:
+ for i,pos in enumerate(_numpy.linspace(
+ orig_pos, position, steps+1))[1:]:
+ _LOG.debug('jump {} to {} ({} of {} steps)'.format(
+ axis_name, pos, i, steps))
self.jump(axis_name=axis_name, position=pos)
if sleep:
_sleep(sleep)