def test_relative_set(RE, hw): motor = hw.motor motor.set(5) msgs = [] def accumulator(msg): msgs.append(msg) RE.msg_hook = accumulator def plan(): yield from (m for m in [Msg('set', motor, 8)]) RE(relative_set_wrapper(plan())) expected = [Msg('set', motor, 13)] for msg in msgs: msg.kwargs.pop('group', None) assert msgs == expected
def test_relative_set(RE, hw): motor = hw.motor motor.set(5) msgs = [] def accumulator(msg): msgs.append(msg) RE.msg_hook = accumulator def plan(): yield from (m for m in [Msg('set', motor, 8)]) RE(relative_set_wrapper(plan())) expected = [Msg('set', motor, 13)] for msg in msgs: msg.kwargs.pop('group', None) assert msgs == expected
def relative_mesh(dets, *args, time=None, md=None): plan = absolute_mesh(dets, *args, time=time, md=md) plan = bpp.relative_set_wrapper(plan) # re-write trajectory as relative return (yield from bpp.reset_positions_wrapper(plan))