Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

706 make undulator gap writeable i18 #721

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

stan-dot
Copy link
Contributor

Fixes #706

needed for i18 #710 and DiamondLightSource/i18-bluesky#4

Instructions to reviewer on how to test:

  1. run the undulator_dcm routine for lookup table update
  2. Confirm nothing breaks 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}

@stan-dot stan-dot added enhancement New feature or request i18 labels Jul 31, 2024
@stan-dot stan-dot linked an issue Jul 31, 2024 that may be closed by this pull request
@DiamondJoseph
Copy link
Contributor

needs to be added to all of the undulator device instantiations

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.51%. Comparing base (c3ad7e4) to head (6a39c89).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #721      +/-   ##
==========================================
- Coverage   94.52%   94.51%   -0.01%     
==========================================
  Files         115      115              
  Lines        4621     4633      +12     
==========================================
+ Hits         4368     4379      +11     
- Misses        253      254       +1     

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

@stan-dot stan-dot self-assigned this Aug 1, 2024
@stan-dot stan-dot marked this pull request as ready for review August 1, 2024 14:43
src/dodal/beamlines/i04.py Outdated Show resolved Hide resolved
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.

The undulator is used in i04_1, i22 and p38 so we would need to add lookup paths there too.

The undulator was originally like this but @callumforrester changed it at #461 (comment) to "make the read-only case simpler". Do we still have a requirement for this to be read-only in some cases? Is this to do Adjust undulator gap to using current lookup table for initial Bragg angle in DiamondLightSource/i18-bluesky#12 (comment)? In which case you could leave it in the undulator_dcm and just set the undulator_dcm device to the current energy and it should correct the undulator with the correct gap?

tests/devices/unit_tests/test_undulator_dcm.py Outdated Show resolved Hide resolved
src/dodal/devices/undulator_dcm.py Outdated Show resolved Hide resolved
src/dodal/devices/undulator.py Outdated Show resolved Hide resolved
src/dodal/devices/undulator.py Show resolved Hide resolved
src/dodal/beamlines/i04.py Outdated Show resolved Hide resolved
@stan-dot
Copy link
Contributor Author

stan-dot commented Aug 16, 2024

         raise AccessError("Undulator gap access is disabled. Contact Control Room")

that is the not covered line. while I thought that this test tests/devices/unit_tests/test_undulator.py already covers it

@DominicOram perhaps you see something I don't about the behavior of the device here?

@DominicOram
Copy link
Contributor

@DominicOram perhaps you see something I don't about the behavior of the device here?

Odd, I agree it looks like it's tested. I think it's fine to not worry about it. You're still at high coverage

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, thanks. Minor points, mostly take them or leave them other than @DiamondJoseph's point that i22/p38 still need a lookup table

src/dodal/devices/undulator.py Outdated Show resolved Hide resolved
src/dodal/devices/undulator.py Outdated Show resolved Hide resolved
src/dodal/devices/undulator.py Outdated Show resolved Hide resolved
tests/devices/unit_tests/test_undulator.py Outdated Show resolved Hide resolved
tests/devices/unit_tests/test_undulator.py Outdated Show resolved Hide resolved
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.

Sorry, meant request changes based on the i22 issue

.github/workflows/ci.yml Outdated Show resolved Hide resolved
src/dodal/beamlines/i22.py Show resolved Hide resolved
src/dodal/devices/undulator.py Show resolved Hide resolved
src/dodal/devices/undulator.py Show resolved Hide resolved
@stan-dot stan-dot force-pushed the 706-make-undulator-gap-writeable-i18 branch from 0eea568 to 55cbb0b Compare August 21, 2024 08:55
@stan-dot stan-dot force-pushed the 706-make-undulator-gap-writeable-i18 branch 4 times, most recently from 9d3f0d4 to 6a39c89 Compare August 29, 2024 10:43
@stan-dot stan-dot force-pushed the 706-make-undulator-gap-writeable-i18 branch from 178786d to 8634f40 Compare September 9, 2024 10:24
@stan-dot stan-dot force-pushed the 706-make-undulator-gap-writeable-i18 branch from e61e1c1 to 1216791 Compare September 13, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i18
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Undulator gap writeable - i18
3 participants