def inner(): print('Beamline Ready... waiting for HPLC Injected Signal') yield from kickoff(hplc, wait=True) print('Acquiring data...') for mo in monitors: yield from monitor(mo) status = yield from complete(hplc, wait=False) while True: yield from trigger_and_read(detectors) # one 'primary' event per loop if status.done: break for mo in monitors: yield from unmonitor(mo) print('Collecting the data...') yield from collect(hplc)
def inner(): print('Beamline Ready... waiting for HPLC Injected Signal') yield from kickoff(hplc, wait=True) print('Acquiring data...') for mo in monitors: yield from monitor(mo) status = yield from complete(hplc, wait=False) while True: yield from trigger_and_read( detectors) # one 'primary' event per loop if status.done: break for mo in monitors: yield from unmonitor(mo) print('Collecting the data...') yield from collect(hplc)
Msg('trigger', det2), Msg('wait'), Msg('create', None, name='baseline'), Msg('read', det1), Msg('read', det2), Msg('save') ]), (stage_context, ([det1, det2], ), {}, [ Msg('stage', det1), Msg('stage', det2) ], [Msg('unstage', det2), Msg('unstage', det1)]), (subs_context, ({ 'all': [cb] }, ), {}, [Msg('subscribe', None, 'all', cb) ], [Msg('unsubscribe', None, token=None)]), (monitor_context, (['sig'], ), {}, list(monitor('sig')), list(unmonitor('sig'))), (event_context, (), {}, [Msg('create', name='primary')], [Msg('save')]), (run_context, (), { 'md': { 'a': 1 } }, [Msg('open_run', a=1)], [Msg('close_run')]), ]) def test_plan_contexts(cm, args, kwargs, before, after): @planify def plan(): ps = deque() with cm(ps, *args, **kwargs): ps.append(['sentinel']) return ps
Msg('trigger', det2), Msg('wait'), Msg('create', None, name='baseline'), Msg('read', det1), Msg('read', det2), Msg('save')]), (stage_context, ([det1, det2],), {}, [Msg('stage', det1), Msg('stage', det2)], [Msg('unstage', det2), Msg('unstage', det1)]), (subs_context, ({'all': [cb]},), {}, [Msg('subscribe', None, 'all', cb)], [Msg('unsubscribe', None, token=None)]), (monitor_context, (['sig'],), {}, list(monitor('sig')), list(unmonitor('sig'))), (event_context, (), {}, [Msg('create', name='primary')], [Msg('save')]), (run_context, (), {'md': {'a': 1}}, [Msg('open_run', a=1)], [Msg('close_run')]), ]) def test_plan_contexts(cm, args, kwargs, before, after): @planify def plan(): ps = deque() with cm(ps, *args, **kwargs): ps.append(['sentinel']) return ps
), ( stage_context, ([det1, det2],), {}, [Msg("stage", det1), Msg("stage", det2)], [Msg("unstage", det2), Msg("unstage", det1)], ), ( subs_context, ({"all": [cb]},), {}, [Msg("subscribe", None, "all", cb)], [Msg("unsubscribe", None, token=None)], ), (monitor_context, (["sig"],), {}, list(monitor("sig")), list(unmonitor("sig"))), (event_context, (), {}, [Msg("create", name="primary")], [Msg("save")]), (run_context, (), {"md": {"a": 1}}, [Msg("open_run", a=1)], [Msg("close_run")]), ], ) def test_plan_contexts(cm, args, kwargs, before, after): @planify def plan(): ps = deque() with cm(ps, *args, **kwargs): ps.append(["sentinel"]) return ps actual_before = [] actual_after = [] target = actual_before