Skip to content

fast energy scan bugs #275

@Relm-Arrowny

Description

@Relm-Arrowny
Image Image
  • Because of speed caching fly_energy_scan only works on beam energy.
Image
  • await i10.d5a_det.drain_current.read() errors

`---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
Cell In[32], line 1
----> 1 await i10.d5a_det.drain_current.read()

File /dls/science/users/wvx67826/dodal/src/dodal/devices/current_amplifiers/current_amplifier_detector.py:66, in CurrentAmpDet.read(self)
     64         # Further details are provided to the user in the logged exception
     65         LOGGER.exception(ex)
---> 66 current = await self.get_corrected_current()
     67 self._set_current(current)
     68 return await super().read()

File /dls/science/users/wvx67826/dodal/src/dodal/devices/current_amplifiers/current_amplifier_detector.py:90, in CurrentAmpDet.get_corrected_current(self)
     86 async def get_corrected_current(self) -> float:
     87     """Convert the output (count and gain) back into the read detector output in
     88     Amp.
     89     """
---> 90     current_gain, voltage_per_sec = await asyncio.gather(
     91         self.current_amp().get_gain(),
     92         self.counter().get_voltage_per_sec(),
     93     )
     94     assert isinstance(current_gain.value, float)
     95     corrected_current = voltage_per_sec / current_gain.value

File /dls/science/users/wvx67826/dodal/src/dodal/devices/current_amplifiers/femto.py:131, in FemtoDDPCA.get_gain(self)
    130 async def get_gain(self) -> Enum:
--> 131     return self.gain_conversion_table[(await self.gain.get_value()).name]

File /dls/science/users/wvx67826/py-env/i10-bluesky/lib64/python3.12/site-packages/ophyd_async/core/_signal.py:48, in _add_timeout.<locals>.wrapper(self, *args, **kwargs)
     46 @functools.wraps(func)
     47 async def wrapper(self: Signal, *args, **kwargs):
---> 48     return await _wait_for(func(self, *args, **kwargs), self._timeout, self.source)

File /dls/science/users/wvx67826/py-env/i10-bluesky/lib64/python3.12/site-packages/ophyd_async/core/_signal.py:40, in _wait_for(coro, timeout, source)
     38 async def _wait_for(coro: Awaitable[T], timeout: float | None, source: str) -> T:
     39     try:
---> 40         return await asyncio.wait_for(coro, timeout)
     41     except TimeoutError as exc:
     42         raise TimeoutError(source) from exc

File /usr/lib64/python3.12/asyncio/tasks.py:520, in wait_for(fut, timeout)
    517         raise TimeoutError from exc
    519 async with timeouts.timeout(timeout):
--> 520     return await fut

File /dls/science/users/wvx67826/py-env/i10-bluesky/lib64/python3.12/site-packages/ophyd_async/core/_signal.py:242, in SignalR.get_value(self, cached)
    232 @_add_timeout
    233 async def get_value(self, cached: bool | None = None) -> SignalDatatypeT:
    234     """Return the current value.
    235 
    236     :param cached:
   (...)    240         - If True, explicitly use the cache and raise an error if it doesn't exist.
    241     """
--> 242     value = await self._backend_or_cache(cached).get_value()
    243     self.log.debug(f"get_value() on source {self.source} returned {value}")
    244     return value

File /dls/science/users/wvx67826/py-env/i10-bluesky/lib64/python3.12/site-packages/ophyd_async/epics/core/_aioca.py:353, in CaSignalBackend.get_value(self)
    352 async def get_value(self) -> SignalDatatypeT:
--> 353     value = await self._caget(self.read_pv, FORMAT_RAW)
    354     return self.converter.value(value)

File /dls/science/users/wvx67826/py-env/i10-bluesky/lib64/python3.12/site-packages/ophyd_async/epics/core/_aioca.py:298, in CaSignalBackend._caget(self, pv, format)
    296 async def _caget(self, pv: str, format: Format) -> AugmentedValue:
    297     return await caget(
--> 298         pv, datatype=self.converter.read_dbr, format=format, timeout=None
    299     )

File /dls/science/users/wvx67826/py-env/i10-bluesky/lib64/python3.12/site-packages/ophyd_async/epics/core/_aioca.py:121, in DisconnectedCaConverter.__getattribute__(self, _DisconnectedCaConverter__name)
    120 def __getattribute__(self, __name: str) -> Any:
--> 121     raise NotImplementedError("No PV has been set as connect() has not been called")

NotImplementedError: No PV has been set as connect() has not been called`


Image

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Acceptance Criteria

  • Specific criteria that will be used to judge if the issue is fixed

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions