DiamondLightSource / i22-bluesky

I22 specific bluesky plans and plan stubs
Apache License 2.0
0 stars 0 forks source link

Replace use of deprecated dodal plan writing utils #99

Closed DiamondJoseph closed 1 month ago

stan-dot commented 1 month ago

blocking issues

https://github.com/bluesky/ophyd-async/issues/618

stan-dot commented 1 month ago

ERROR tests/plans/test_stopflow.py - RuntimeError: Bluesky event loop not running

stan-dot commented 1 month ago

    exec(co, module.__dict__)
  File "/workspaces/i22-bluesky/tests/plans/test_stopflow.py", line 22, in <module>
    from i22_bluesky.plans import check_detectors_for_stopflow, stopflow
  File "/workspaces/i22-bluesky/src/i22_bluesky/plans/__init__.py", line 1, in <module>
    from .linkam import linkam_plan, save_linkam
  File "/workspaces/i22-bluesky/src/i22_bluesky/plans/linkam.py", line 17, in <module>
    from i22_bluesky.util.default_devices import (
  File "/workspaces/i22-bluesky/src/i22_bluesky/util/default_devices.py", line 28, in <module>
    saxs(),
    ^^^^^^
  File "/venv/lib/python3.11/site-packages/dodal/beamlines/i22.py", line 48, in saxs
    return device_instantiation(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/dodal/utils.py", line 97, in wrapper
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/dodal/common/beamlines/beamline_utils.py", line 113, in device_instantiation
    wait_for_connection(device_instance, mock=fake)
  File "/venv/lib/python3.11/site-packages/dodal/common/beamlines/beamline_utils.py", line 56, in wait_for_connection
    call_in_bluesky_event_loop(
  File "/venv/lib/python3.11/site-packages/bluesky/run_engine.py", line 2892, in call_in_bluesky_event_loop
    raise RuntimeError("Bluesky event loop not running")
RuntimeError: Bluesky event loop not running
------------------------------- Captured stderr ---

this is extremely odd, as the error is in the imports and the linkam plan works, though it has the same imports.

the error is during a call to device_instantiation so maybe the device_factory update didn't get propagated correctly

stan-dot commented 1 month ago

fixed with a test refactor, all good

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.00%. Comparing base (585ef60) to head (91acef0). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/i22_bluesky/panda/fly_scanning.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #99 +/- ## ======================================= Coverage 60.00% 60.00% ======================================= Files 10 10 Lines 225 225 ======================================= Hits 135 135 Misses 90 90 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DiamondJoseph commented 1 month ago

@stan-dot please do not merge my changes before I am ready for them to be merged. I wanted to get a proper release of dodal done so that I know what state everything is in- this repository should, for stability's sake since it contains code that is to be executed by users, not pin to a moving target in dodal.

stan-dot commented 1 month ago
  1. it's i22 so stability is not a metric Core should be worried about
  2. the only description of 'what are the goals of the PR' is the PR title - there is no description, no related issue
  3. you didn't mention the part about 'need proper release of dodal done'
  4. it's pointless to mention stability if this code has been known to be in flux for months, tested rarely

I know what state everything is in not a realistic target