NSLS-II / Bug-Reports

Unified issue-tracker for bugs in the data acquisition, management, and analysis software at NSLS-II
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

grid_scan command doesn't work anymore #201

Closed bisogni closed 4 years ago

bisogni commented 4 years ago

We are running a usual "grid_scan" command that we use at all restart of the beamline and get an error at each time we use it. This is preventing to go through the beamline alignment procedure.

'''

ValueError Traceback (most recent call last)

in ----> 1 RE(grid_scan([diagon_h_cam],feslt.hc,1,0.9,2,feslt.vc,1,0.9,2,True)) /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/run_engine.py in __call__(self, *args, **metadata_kw) 751 # it (unless it is a canceled error) 752 if exc is not None: --> 753 raise exc 754 755 if self._interrupted: /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/run_engine.py in _run(self) 1260 self._reason = str(err) 1261 self.log.exception("Run aborted") -> 1262 raise err 1263 finally: 1264 # Some done_callbacks may still be alive in other threads. /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/run_engine.py in _run(self) 1148 else: 1149 try: -> 1150 msg = self._plan_stack[-1].send(resp) 1151 # We have exhausted the top generator 1152 except StopIteration: /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in __call__(self, plan) 1292 plan = monitor_during_wrapper(plan, self.monitors) 1293 plan = baseline_wrapper(plan, self.baseline) -> 1294 return (yield from plan) /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in baseline_wrapper(plan, devices, name) 1147 return (yield from plan) 1148 else: -> 1149 return (yield from plan_mutator(plan, insert_baseline)) 1150 1151 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 167 continue 168 else: --> 169 raise ex 170 # if inserting / mutating, put new generator on the stack 171 # and replace the current msg with the first element from the /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 120 ret = result_stack.pop() 121 try: --> 122 msg = plan_stack[-1].send(ret) 123 except StopIteration as e: 124 # discard the exhausted generator /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in monitor_during_wrapper(plan, signals) 788 plan1 = plan_mutator(plan, insert_after_open) 789 plan2 = plan_mutator(plan1, insert_before_close) --> 790 return (yield from plan2) 791 792 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 167 continue 168 else: --> 169 raise ex 170 # if inserting / mutating, put new generator on the stack 171 # and replace the current msg with the first element from the /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 120 ret = result_stack.pop() 121 try: --> 122 msg = plan_stack[-1].send(ret) 123 except StopIteration as e: 124 # discard the exhausted generator /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 167 continue 168 else: --> 169 raise ex 170 # if inserting / mutating, put new generator on the stack 171 # and replace the current msg with the first element from the /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 120 ret = result_stack.pop() 121 try: --> 122 msg = plan_stack[-1].send(ret) 123 except StopIteration as e: 124 # discard the exhausted generator /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in fly_during_wrapper(plan, flyers) 846 plan1 = plan_mutator(plan, insert_after_open) 847 plan2 = plan_mutator(plan1, insert_before_close) --> 848 return (yield from plan2) 849 850 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 167 continue 168 else: --> 169 raise ex 170 # if inserting / mutating, put new generator on the stack 171 # and replace the current msg with the first element from the /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 120 ret = result_stack.pop() 121 try: --> 122 msg = plan_stack[-1].send(ret) 123 except StopIteration as e: 124 # discard the exhausted generator /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 167 continue 168 else: --> 169 raise ex 170 # if inserting / mutating, put new generator on the stack 171 # and replace the current msg with the first element from the /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 120 ret = result_stack.pop() 121 try: --> 122 msg = plan_stack[-1].send(ret) 123 except StopIteration as e: 124 # discard the exhausted generator /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/plans.py in grid_scan(detectors, per_step, md, *args) 921 922 return (yield from scan_nd(detectors, full_cycler, --> 923 per_step=per_step, md=_md)) 924 925 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/plans.py in scan_nd(detectors, cycler, per_step, md) 748 yield from per_step(detectors, step, pos_cache) 749 --> 750 return (yield from inner_scan_nd()) 751 752 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/utils.py in dec_inner(*inner_args, **inner_kwargs) 1009 plan = gen_func(*inner_args, **inner_kwargs) 1010 plan = wrapper(plan, *args, **kwargs) -> 1011 return (yield from plan) 1012 return dec_inner 1013 return dec /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in stage_wrapper(plan, devices) 937 return (yield from plan) 938 --> 939 return (yield from finalize_wrapper(inner(), unstage_devices())) 940 941 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in finalize_wrapper(plan, final_plan, pause_for_debug) 498 cleanup = True 499 try: --> 500 ret = yield from plan 501 except GeneratorExit: 502 cleanup = False /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in inner() 935 def inner(): 936 yield from stage_devices() --> 937 return (yield from plan) 938 939 return (yield from finalize_wrapper(inner(), unstage_devices())) /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/utils.py in dec_inner(*inner_args, **inner_kwargs) 1009 plan = gen_func(*inner_args, **inner_kwargs) 1010 plan = wrapper(plan, *args, **kwargs) -> 1011 return (yield from plan) 1012 return dec_inner 1013 return dec /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in run_wrapper(plan, md) 324 yield from contingency_wrapper(plan, 325 except_plan=except_plan, --> 326 else_plan=close_run) 327 return rs_uid 328 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in contingency_wrapper(plan, except_plan, else_plan, final_plan, pause_for_debug) 560 cleanup = True 561 try: --> 562 ret = yield from plan 563 except GeneratorExit: 564 cleanup = False /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/plans.py in inner_scan_nd() 746 def inner_scan_nd(): 747 for step in list(cycler): --> 748 yield from per_step(detectors, step, pos_cache) 749 750 return (yield from inner_scan_nd()) /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/plan_stubs.py in one_nd_step(detectors, step, pos_cache) 950 motors = step.keys() 951 yield from move_per_step(step, pos_cache) --> 952 yield from trigger_and_read(list(detectors) + list(motors)) 953 954 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/plan_stubs.py in trigger_and_read(devices, name) 800 from .preprocessors import rewindable_wrapper 801 return (yield from rewindable_wrapper(inner_trigger_and_read(), --> 802 rewindable)) 803 804 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in rewindable_wrapper(plan, rewindable) 678 restore_rewindable())) 679 else: --> 680 return (yield from plan) 681 682 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/plan_stubs.py in inner_trigger_and_read() 796 if reading is not None: 797 ret.update(reading) --> 798 yield from save() 799 return ret 800 from .preprocessors import rewindable_wrapper /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/plan_stubs.py in save() 55 :func:`bluesky.plan_stubs.create` 56 """ ---> 57 return (yield Msg('save')) 58 59 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 192 try: 193 # yield out the 'current message' and collect the return --> 194 inner_ret = yield msg 195 except GeneratorExit: 196 # special case GeneratorExit. We must clean up all of our plans /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 192 try: 193 # yield out the 'current message' and collect the return --> 194 inner_ret = yield msg 195 except GeneratorExit: 196 # special case GeneratorExit. We must clean up all of our plans /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 192 try: 193 # yield out the 'current message' and collect the return --> 194 inner_ret = yield msg 195 except GeneratorExit: 196 # special case GeneratorExit. We must clean up all of our plans /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 192 try: 193 # yield out the 'current message' and collect the return --> 194 inner_ret = yield msg 195 except GeneratorExit: 196 # special case GeneratorExit. We must clean up all of our plans /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/preprocessors.py in plan_mutator(plan, msg_proc) 192 try: 193 # yield out the 'current message' and collect the return --> 194 inner_ret = yield msg 195 except GeneratorExit: 196 # special case GeneratorExit. We must clean up all of our plans /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/run_engine.py in _run(self) 1206 # exceptions (coming in via throw) can be 1207 # raised -> 1208 new_response = yield from coro(msg) 1209 1210 # special case `CancelledError` and let the outer /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/run_engine.py in _save(self, msg) 1682 configuration=config, name=desc_key, 1683 hints=hints, object_keys=object_keys) -> 1684 yield from self.emit(DocumentNames.descriptor, doc) 1685 self.log.debug("Emitted Event Descriptor with name %r containing " 1686 "data keys %r (uid=%r)", desc_key, /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/asyncio/coroutines.py in coro(*args, **kw) 118 @functools.wraps(func) 119 def coro(*args, **kw): --> 120 res = func(*args, **kw) 121 if (base_futures.isfuture(res) or inspect.isgenerator(res) or 122 isinstance(res, CoroWrapper)): /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/run_engine.py in emit(self, name, doc) 2319 "Process blocking callbacks and schedule non-blocking callbacks." 2320 schema_validators[name].validate(doc) -> 2321 self.dispatcher.process(name, doc) 2322 2323 /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/run_engine.py in process(self, name, doc) 2339 doc : dict 2340 """ -> 2341 exceptions = self.cb_registry.process(name, name.name, doc) 2342 for exc, traceback in exceptions: 2343 warn("A %r was raised during the processing of a %s " /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/utils.py in process(self, sig, *args, **kwargs) 332 for cid, func in list(self.callbacks[sig].items()): 333 try: --> 334 func(*args, **kwargs) 335 except ReferenceError: 336 self._remove_proxy(func) /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/utils.py in __call__(self, *args, **kwargs) 413 mtd = self.func 414 # invoke the callable and return the result --> 415 return mtd(*args, **kwargs) 416 417 def __eq__(self, other): /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/callbacks/best_effort.py in __call__(self, name, doc) 91 return 92 ---> 93 super().__call__(name, doc) 94 95 def start(self, doc): /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/callbacks/core.py in __call__(self, name, doc) 15 def __call__(self, name, doc): 16 "Dispatch to methods expecting particular doc types." ---> 17 return getattr(self, name)(doc) 18 19 def event(self, doc): /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/bluesky/callbacks/best_effort.py in descriptor(self, doc) 311 if (1/MAR < data_aspect_ratio < MAR): 312 aspect = 'equal' --> 313 ax.set_aspect(aspect, adjustable='box-forced') 314 else: 315 aspect = 'auto' /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/matplotlib/axes/_base.py in set_aspect(self, aspect, adjustable, anchor, share) 1293 if adjustable is None: 1294 adjustable = self._adjustable -> 1295 self.set_adjustable(adjustable, share=share) # Handle sharing. 1296 1297 if anchor is not None: /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/matplotlib/axes/_base.py in set_adjustable(self, adjustable, share) 1333 and independently on each Axes as it is drawn. 1334 """ -> 1335 cbook._check_in_list(["box", "datalim"], adjustable=adjustable) 1336 if share: 1337 axes = set(self._shared_x_axes.get_siblings(self) /opt/conda_envs/collection-2019-3.0-six/lib/python3.7/site-packages/matplotlib/cbook/__init__.py in _check_in_list(values, **kwargs) 2158 raise ValueError( 2159 "{!r} is not a valid value for {}; supported values are {}" -> 2160 .format(v, k, ', '.join(map(repr, values)))) ValueError: 'box-forced' is not a valid value for adjustable; supported values are 'box', 'datalim' '''
danielballan commented 4 years ago

@bisogni This issue has been fixed in bluesky's master branch, but that fix didn't make it in time for the most recent software roll out. I imagine this problem will affect many beamlines. Thanks for being the first to report it --- I expect you have saved others some trouble!

We'll probably have to do a minor update soon to fix this properly, but I have fixed it manually on xf02id1-ws2 so that you can be un-blocked. All you'll need to do is exit IPython and start bsui again.

ambarb commented 4 years ago

Thanks. We changed hinted to normal and it worked, but after the scan stops we will restart and test.

ambarb commented 4 years ago

It works. Plot is correct. Thanks

danielballan commented 4 years ago

Excellent! Thanks for the confirmation and for the very useful initial report.