Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/dodal/beamlines/i03_supervisor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of having the supervisor as a beamline seperate to i03? Is this so you can dodal connect i03_supervisor to just get the baton?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The supervisor beamline is loaded into the bluesky context inside the hyperion-supervisor process. It only needs to access the baton as all the devices are interacted with by the hyperion-blueapi blueapi instance.

I think it's cleaner to do it this way rather than loading the main i03 beamline and disabling all the other devices through some special flag, loading i03.py is also quite heavyweight due to all the other things it imports.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense

from dodal.device_manager import DeviceManager
from dodal.devices.baton import Baton
from dodal.log import set_beamline as set_log_beamline
from dodal.utils import BeamlinePrefix, get_beamline_name

BL = get_beamline_name("i03")
set_log_beamline(BL)
set_utils_beamline(BL)

PREFIX = BeamlinePrefix(BL)


devices = DeviceManager()


@devices.factory()
def baton() -> Baton:
return Baton(f"{PREFIX.beamline_prefix}-CS-BATON-01:")
Empty file added src/dodal/testing/__init__.py
Empty file.