aps-8id-dys / ipython-8idiuser

8-ID-I ipython configuration for bluesky (and other)
1 stars 1 forks source link

'AD_Acquire' crashes for Lambda #247

Closed qzhang234 closed 3 years ago

qzhang234 commented 3 years ago

I'm testing Bluesky with Lambda by running AD_Acquire only and Bluesky crashed with the following message. Lambda itself seems to work as confirmed from the EPICS interface.

8-ID-I has a dry-run with Nicholas and his team members next Monday and the real demo with light source directors on 01/13. Although we could always run Spec with Lambda and Bluesky with Rigaku (which seems to be working by the way), it would be great to just run a few measurements with Bluesky/Lambda as well.

Error message from Bluesky ``` In [25]: In [25]: RE(AD_Acquire(lambdadet, 'A001_Test', 0.1, 0.11, 100, '/home/8ididata/2020-3/demo202101')) Transient Scan ID: 203664 Time: 2021-01-08 22:35:59 Persistent Unique Scan ID: 'e15ef308-155c-4817-aab2-e4a07a66e299' New stream: 'baseline' New stream: 'Timebase_monitor' New stream: 'pind1_monitor' New stream: 'pind2_monitor' New stream: 'Atten1_monitor' New stream: 'Atten2_monitor' New stream: 'pid1_controlled_value_monitor' New stream: 'pid1_final_value_monitor' --------------------------------------------------------------------------- NameError Traceback (most recent call last) in ----> 1 RE(AD_Acquire(lambdadet, 'A001_Test', 0.1, 0.11, 100, '/home/8ididata/2020-3/demo202101')) ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/run_engine.py in __call__(self, *args, **metadata_kw) 805 self._task_fut.add_done_callback(set_blocking_event) 806 --> 807 self._resume_task(init_func=_build_task) 808 809 if self._interrupted: ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/run_engine.py in _resume_task(self, init_func) 929 if (exc is not None 930 and not isinstance(exc, _RunEnginePanic)): --> 931 raise exc 932 933 def install_suspender(self, suspender): ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/run_engine.py in _run(self) 1498 exit_reason = str(err) 1499 self.log.exception("Run aborted") -> 1500 raise err 1501 finally: 1502 if not exit_reason: ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/run_engine.py in _run(self) 1363 else: 1364 try: -> 1365 msg = self._plan_stack[-1].send(resp) 1366 # We have exhausted the top generator 1367 except StopIteration: ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in __call__(self, plan) 1305 plan = monitor_during_wrapper(plan, self.monitors) 1306 plan = baseline_wrapper(plan, self.baseline) -> 1307 return (yield from plan) 1308 1309 ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in baseline_wrapper(plan, devices, name) 1160 return (yield from plan) 1161 else: -> 1162 return (yield from plan_mutator(plan, insert_baseline)) 1163 1164 ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in monitor_during_wrapper(plan, signals) 801 plan1 = plan_mutator(plan, insert_after_open) 802 plan2 = plan_mutator(plan1, insert_before_close) --> 803 return (yield from plan2) 804 805 ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in fly_during_wrapper(plan, flyers) 859 plan1 = plan_mutator(plan, insert_after_open) 860 plan2 = plan_mutator(plan1, insert_before_close) --> 861 return (yield from plan2) 862 863 ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 168 continue 169 else: --> 170 raise ex 171 # if inserting / mutating, put new generator on the stack 172 # and replace the current msg with the first element from the ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 121 ret = result_stack.pop() 122 try: --> 123 msg = plan_stack[-1].send(ret) 124 except StopIteration as e: 125 # discard the exhausted generator ~/.ipython-bluesky/profile_bluesky/startup/instrument/plans/xpcs_acquire.py in AD_Acquire(areadet, file_name, acquire_time, acquire_period, num_images, path, submit_xpcs_job, atten, md) 317 318 logger.info("calling full_acquire_procedure()") --> 319 return (yield from full_acquire_procedure(md=md)) ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/utils.py in dec_inner(*inner_args, **inner_kwargs) 1125 plan = gen_func(*inner_args, **inner_kwargs) 1126 plan = wrapper(plan, *args, **kwargs) -> 1127 return (yield from plan) 1128 return dec_inner 1129 return dec ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in stage_wrapper(plan, devices) 950 return (yield from plan) 951 --> 952 return (yield from finalize_wrapper(inner(), unstage_devices())) 953 954 ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in finalize_wrapper(plan, final_plan, pause_for_debug) 507 cleanup = True 508 try: --> 509 ret = yield from plan 510 except GeneratorExit: 511 cleanup = False ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in inner() 948 def inner(): 949 yield from stage_devices() --> 950 return (yield from plan) 951 952 return (yield from finalize_wrapper(inner(), unstage_devices())) ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/utils.py in dec_inner(*inner_args, **inner_kwargs) 1125 plan = gen_func(*inner_args, **inner_kwargs) 1126 plan = wrapper(plan, *args, **kwargs) -> 1127 return (yield from plan) 1128 return dec_inner 1129 return dec ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in monitor_during_wrapper(plan, signals) 801 plan1 = plan_mutator(plan, insert_after_open) 802 plan2 = plan_mutator(plan1, insert_before_close) --> 803 return (yield from plan2) 804 805 ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 76 # if we have a stashed exception, pass it along 77 try: ---> 78 msg = plan_stack[-1].throw(exception) 79 except StopIteration as e: 80 # discard the exhausted generator ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 76 # if we have a stashed exception, pass it along 77 try: ---> 78 msg = plan_stack[-1].throw(exception) 79 except StopIteration as e: 80 # discard the exhausted generator ~/.ipython-bluesky/profile_bluesky/startup/instrument/plans/xpcs_acquire.py in full_acquire_procedure(md) 285 logger.debug("before count()") 286 # yield from bp.count([areadet], md=md) --> 287 yield from inner_count([areadet], md=_md) 288 logger.debug("after count()") 289 ~/.ipython-bluesky/profile_bluesky/startup/instrument/plans/xpcs_acquire.py in inner_count(devices, md) 244 if hasattr(obj, 'trigger'): 245 no_wait = False --> 246 yield from bps.trigger(obj, group=grp) 247 if areadet.cam.EXT_TRIGGER > 0: 248 yield from soft_glue.start_trigger() ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/plan_stubs.py in trigger(obj, group, wait) 425 msg : Msg 426 """ --> 427 ret = yield Msg('trigger', obj, group=group) 428 if wait: 429 yield Msg('wait', None, group=group) ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 193 try: 194 # yield out the 'current message' and collect the return --> 195 inner_ret = yield msg 196 except GeneratorExit: 197 # special case GeneratorExit. We must clean up all of our plans ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/run_engine.py in _run(self) 1423 # exceptions (coming in via throw) can be 1424 # raised -> 1425 new_response = await coro(msg) 1426 1427 # special case `CancelledError` and let the outer ~/.conda/envs/bluesky_2021_1/lib/python3.8/site-packages/bluesky/run_engine.py in _trigger(self, msg) 1950 kwargs = dict(msg.kwargs) 1951 group = kwargs.pop('group', None) -> 1952 ret = msg.obj.trigger(*msg.args, **kwargs) 1953 p_event = asyncio.Event(loop=self._loop_for_kwargs) 1954 pardon_failures = self._pardon_failures ~/.ipython-bluesky/profile_bluesky/startup/instrument/devices/lambda_750k.py in trigger(self) 571 done_value = 0 572 --> 573 status = DeviceStatus(self) 574 575 def watch_state(value, old_value, **kwargs): NameError: name 'DeviceStatus' is not defined In [26]: ```
prjemian commented 3 years ago

Missing an from ophyd import DeviceStatus statement in ~/.ipython-bluesky/profile_bluesky/startup/instrument/devices/lambda_750k.py:

NameError: name 'DeviceStatus' is not defined
qzhang234 commented 3 years ago

Pete's patch fixed the problem. Thanks!