Skip to content

Conversation

@adaudon
Copy link
Contributor

@adaudon adaudon commented Dec 16, 2025

Fixes #1765

Instructions to reviewer on how to test:

  1. Do thing x
  2. Confirm thing y happens

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@adaudon adaudon force-pushed the 1765-Convert_MX_to_new_device_manager branch 2 times, most recently from 5c175c7 to 4a05f61 Compare December 18, 2025 11:14
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.09%. Comparing base (00af332) to head (783ba6d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1788      +/-   ##
==========================================
- Coverage   99.12%   99.09%   -0.03%     
==========================================
  Files         283      283              
  Lines       10736    10745       +9     
==========================================
+ Hits        10642    10648       +6     
- Misses         94       97       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adaudon adaudon force-pushed the 1765-Convert_MX_to_new_device_manager branch from f65166e to 662aa54 Compare December 18, 2025 14:21
@adaudon adaudon force-pushed the 1765-Convert_MX_to_new_device_manager branch from f98b994 to 9bfbbc4 Compare December 18, 2025 16:16
@adaudon adaudon marked this pull request as ready for review January 5, 2026 14:24
@adaudon adaudon requested a review from a team as a code owner January 5, 2026 14:24
"""
return OAVToRedisForwarder(
f"{PREFIX.beamline_prefix}-DI-OAV-01:",
oav_roi=oav(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be updated to pass oav in to avoid multiple instances

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree, and we should do the same for the full screen one. e.g.:

@devices.factory()
def oav_to_redis_forwarder(oav: OAVBeamCentrePV, oav_full_screen:OAVBeamCentrePV) -> OAVToRedisForwarder:
    return OAVToRedisForwarder(
        f"{PREFIX.beamline_prefix}-DI-OAV-01:",
        oav_roi=oav,
        oav_fs=oav_full_screen,
        redis_host=RedisConstants.REDIS_HOST,
        redis_password=RedisConstants.REDIS_PASSWORD,
        redis_db=RedisConstants.MURKO_REDIS_DB,
    )

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Great, thank you. A couple more comments

Comment on lines 21 to 23
"""Get the i02-2 synchrotron device, instantiate it if it hasn't already been.
If this is called when already instantiated in i02-2, it will return the existing object.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: We can remove this comment, and the one below, as we have done elsewhere

)
@devices.v1_init(EigerDetector, prefix="BL03I-EA-EIGER-01:", wait=False)
def eiger(eiger: EigerDetector) -> EigerDetector:
return eiger
Copy link
Contributor

Choose a reason for hiding this comment

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

Must: You need to set the detector_id here, like we did for i03 (

eiger.detector_id = 78
). You probably also need to set the beamline in the same way, though it's not as important

Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be BL04I instead of BL03I?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, good spot. In both here and in i03.py they should be:

@devices.v1_init(
    EigerDetector, prefix=f"{PREFIX.beamline_prefix}-EA-EIGER-01:", wait=False
)

"""
return OAVToRedisForwarder(
f"{PREFIX.beamline_prefix}-DI-OAV-01:",
oav_roi=oav(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree, and we should do the same for the full screen one. e.g.:

@devices.factory()
def oav_to_redis_forwarder(oav: OAVBeamCentrePV, oav_full_screen:OAVBeamCentrePV) -> OAVToRedisForwarder:
    return OAVToRedisForwarder(
        f"{PREFIX.beamline_prefix}-DI-OAV-01:",
        oav_roi=oav,
        oav_fs=oav_full_screen,
        redis_host=RedisConstants.REDIS_HOST,
        redis_password=RedisConstants.REDIS_PASSWORD,
        redis_db=RedisConstants.MURKO_REDIS_DB,
    )



@device_factory(
skip=BL == "s04",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: Now we're removing s04 from here can we also remove it from the dictionary in dodal/tests/conftest.py

@device_factory()
@devices.factory()
def attenuator() -> EnumFilterAttenuator:
"""Get a read-only attenuator device for i24, instantiate it if it hasn't already
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: These comments, and others in this file, should be removed as they have been elsewhere

"""
return Aperture(
f"{PREFIX.beamline_prefix}-AL-APTR-01:",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could: Whilst we're here the formatting of a lot of these device instantiations is a bit odd. If we remove the trailing comma the save on format will make this one line. Same with many other devices in this file.

# wait=wait_for_connection,
# fake=fake_with_ophyd_sim,
# post_create=set_params,
# )
Copy link
Contributor

Choose a reason for hiding this comment

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

Should: This commented out code is now entirely wrong. I think we should delete it all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert MX beamlines to new device manager

4 participants