Skip to content

Conversation

@DG-At-Diamond
Copy link
Contributor

Fixes DiamondLightSource/sm-bluesky#126

This adds the undulator for I16, setting the gap in mm. It does not currently include the energy calculations or lookup table, these are performed in GDA at the moment and will be implemented in bluesky in a later change.

Instructions to reviewer on how to test:

run dodal connect i16 and check the id is in the list

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}

@DG-At-Diamond DG-At-Diamond requested a review from a team as a code owner December 11, 2025 11:51
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.12%. Comparing base (a2e9629) to head (194583f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1778   +/-   ##
=======================================
  Coverage   99.11%   99.12%           
=======================================
  Files         281      282    +1     
  Lines       10667    10683   +16     
=======================================
+ Hits        10573    10589   +16     
  Misses         94       94           

☔ 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.

Copy link
Contributor

@oliwenmandiamond oliwenmandiamond left a comment

Choose a reason for hiding this comment

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

Just a nit with the name. This is also a good opportunity to use the new DeviceManager instead of device_factory as we need to migrate across (so it no longer uses a global context and instead use something to manage the context). See dodal/beamlines/i03.py for an example

e.g

from dodal.device_manager import DeviceManager
...
devices = DeviceManager()

@devices.factory
def id() -> ...

Comment on lines 13 to 17
@device_factory()
def id() -> UndulatorInMm:
return UndulatorInMm(
name="id", prefix=f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@device_factory()
def id() -> UndulatorInMm:
return UndulatorInMm(
name="id", prefix=f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:"
)
@device_factory()
def id() -> UndulatorInMm:
return UndulatorInMm(
prefix=f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:"
)

Remove the name, let the factory auto populate it with the function name

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, also you should just do this for the prefix

Suggested change
@device_factory()
def id() -> UndulatorInMm:
return UndulatorInMm(
name="id", prefix=f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:"
)
@device_factory()
def id() -> UndulatorInMm:
return UndulatorInMm(
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:"
)

Copy link
Contributor

@oliwenmandiamond oliwenmandiamond left a comment

Choose a reason for hiding this comment

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

Thanks, just need to remove the names and then all good

@DG-At-Diamond
Copy link
Contributor Author

I have been looking into the energy calculations and think this should be merged as is and we can add that later on as a separate PR as there are some unanswered questions about how it's going to work.

@DG-At-Diamond DG-At-Diamond merged commit a1a5829 into main Dec 17, 2025
11 checks passed
@DG-At-Diamond DG-At-Diamond deleted the i16-insertion-device branch December 17, 2025 12:36
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.

Add hard x-ray id for i16

3 participants