Skip to content

Instantly share code, notes, and snippets.

@tacaswell
Created Jun 2, 2016
Embed
What would you like to do?
get_timevars bug
TypeError Traceback (most recent call last)
<ipython-input-12-6114c6ec2b0f> in <module>()
----> 1 gs.RE(ud_crab_plan(pu,19.02, 19.0, 19.00, 19.0), lt)
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/bluesky/run_engine.py in __call__(self, plan, subs, raise_if_interrupted, **metadata_kw)
576 exc = self._task.exception()
577 if exc is not None:
--> 578 raise exc
579 if raise_if_interrupted and self._interrupted:
580 raise RunEngineInterrupted("RunEngine was interrupted.")
/home/xf05id1/conda_envs/collection/lib/python3.4/asyncio/tasks.py in _step(***failed resolving arguments***)
237 # We use the `send` method directly, because coroutines
238 # don't have `__iter__` and `__next__` methods.
--> 239 result = coro.send(None)
240 else:
241 result = coro.throw(exc)
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/bluesky/run_engine.py in _run(self)
855 self.log.error("Run aborted")
856 self.log.error("%r", err)
--> 857 raise err
858 finally:
859 # call stop() on every movable object we ever set()
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/bluesky/run_engine.py in _run(self)
827 raise
828 except Exception as e:
--> 829 msg = self._plan_stack[-1].throw(e)
830 self._plan_stack.append(single_gen(msg))
831 self._response_stack.append(None)
/nfs/xf05id1/ipython_ophyd/profile_xf05id1/startup/11-secret_undulator.py in ud_crab_plan(pu, us_u, us_l, ds_u, ds_l, other_dets)
384 fail_time = ttime.time() + 40 * 5
385 while not st.done:
--> 386 yield from trigger_and_read([pu] + other_dets)
387 if ttime.time() > fail_time:
388 mot.stop()
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/bluesky/plans.py in wrapped(*args, **kwargs)
68 gen_stack = func(*args, **kwargs)
69 for g in gen_stack:
---> 70 yield from g
71
72 return wrapped
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/bluesky/plans.py in single_gen(msg)
276 the input message
277 '''
--> 278 yield msg
279
280
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/bluesky/run_engine.py in _run(self)
822 try:
823 coro = self._command_registry[msg.command]
--> 824 response = yield from coro(msg)
825 self._response_stack.append(response)
826 except KeyboardInterrupt:
/home/xf05id1/conda_envs/collection/lib/python3.4/asyncio/coroutines.py in coro(*args, **kw)
204 @functools.wraps(func)
205 def coro(*args, **kw):
--> 206 res = func(*args, **kw)
207 if isinstance(res, futures.Future) or inspect.isgenerator(res):
208 res = yield from res
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/bluesky/run_engine.py in _read(self, msg)
1120 self._config_desc_cache[obj] = obj.describe_configuration()
1121 self._cache_config(obj)
-> 1122 ret = obj.read(*msg.args, **msg.kwargs)
1123 self._read_cache.append(ret)
1124 return ret
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/device.py in read(self)
674 """
675 res = super().read()
--> 676 res.update(self._read_attr_list(self.read_attrs))
677 return res
678
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/device.py in _read_attr_list(self, attr_list, config)
664 values.update(obj.read_configuration())
665
--> 666 values.update(obj.read())
667
668 return values
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/device.py in read(self)
674 """
675 res = super().read()
--> 676 res.update(self._read_attr_list(self.read_attrs))
677 return res
678
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/device.py in _read_attr_list(self, attr_list, config)
664 values.update(obj.read_configuration())
665
--> 666 values.update(obj.read())
667
668 return values
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/utils/epics_pvs.py in wrapper(self, *args, **kwargs)
339 def wrapper(self, *args, **kwargs):
340 if self.connected:
--> 341 return fcn(self, *args, **kwargs)
342 else:
343 raise DisconnectedError('{} is not connected'.format(self.name))
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/signal.py in read(self)
542
543 return {self.name: {'value': self.value,
--> 544 'timestamp': self.timestamp}}
545
546
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/utils/epics_pvs.py in wrapper(self, *args, **kwargs)
339 def wrapper(self, *args, **kwargs):
340 if self.connected:
--> 341 return fcn(self, *args, **kwargs)
342 else:
343 raise DisconnectedError('{} is not connected'.format(self.name))
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/signal.py in timestamp(self)
423 if not self._read_pv.auto_monitor:
424 # force updating the timestamp when not using auto monitoring
--> 425 self._read_pv.get_timevars()
426 return self._read_pv.timestamp
427
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/epics/pv.py in get_timevars(self, timeout, warn)
431 if not self.wait_for_connection():
432 return None
--> 433 kwds = ca.get_timevars(self.chid, timeout=timeout, warn=warn)
434 self._args.update(kwds)
435 return kwds
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/epics/ca.py in wrapper(*args, **kwds)
414 name(chid), timeout))
415
--> 416 return fcn(*args, **kwds)
417 wrapper.__doc__ = fcn.__doc__
418 wrapper.__name__ = fcn.__name__
/home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/epics/ca.py in get_timevars(chid, timeout, warn)
1482 return {}
1483
-> 1484 tmpv = ncache['time_value'][0]
1485 for attr in ('status', 'severity'):
1486 if hasattr(tmpv, attr):
TypeError: 'NoneType' object is not subscriptable
BlueSky [13]: %debug
> /home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/epics/ca.py(1484)get_timevars()
1482 return {}
1483
-> 1484 tmpv = ncache['time_value'][0]
1485 for attr in ('status', 'severity'):
1486 if hasattr(tmpv, attr):
ipdb> u
> /home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/epics/ca.py(416)wrapper()
414 name(chid), timeout))
415
--> 416 return fcn(*args, **kwds)
417 wrapper.__doc__ = fcn.__doc__
418 wrapper.__name__ = fcn.__name__
ipdb> u
> /home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/epics/pv.py(433)get_timevars()
431 if not self.wait_for_connection():
432 return None
--> 433 kwds = ca.get_timevars(self.chid, timeout=timeout, warn=warn)
434 self._args.update(kwds)
435 return kwds
ipdb> u
> /home/xf05id1/conda_envs/collection/lib/python3.4/site-packages/ophyd/signal.py(425)timestamp()
423 if not self._read_pv.auto_monitor:
424 # force updating the timestamp when not using auto monitoring
--> 425 self._read_pv.get_timevars()
426 return self._read_pv.timestamp
427
ipdb> self
EpicsSignal(read_pv='SR:C5-ID:G1{IVU21:1-Mtr:5}Sw:Go', name='pu_ds_upper_actuate', parent='pu_ds_upper', value=1, timestamp=1464876966.334643, pv_kw={}, auto_monitor=False, string=False, write_pv='SR:C5-ID:G1{IVU21:1-Mtr:5}Sw:Go', limits=False, put_complete=False)
ipdb>
BlueSky [14]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment