Skip to content

Fix for shutter renaming#1742

Open
DominicOram wants to merge 3 commits into
mainfrom
zebra_shutter_change
Open

Fix for shutter renaming#1742
DominicOram wants to merge 3 commits into
mainfrom
zebra_shutter_change

Conversation

@DominicOram
Copy link
Copy Markdown
Contributor

Update to match DiamondLightSource/dodal#2053

Instructions to reviewer on how to test:

  1. Confirm tests still pass on the linked dodal branch

Checks for reviewer

  • Would the PR title make sense to a user on a set of release notes

@DominicOram DominicOram requested a review from a team as a code owner May 11, 2026 13:19
@DominicOram DominicOram added the dev experience Changes relating to developer experience label May 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.87%. Comparing base (81d2db8) to head (64d5205).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1742   +/-   ##
=======================================
  Coverage   92.87%   92.87%           
=======================================
  Files         156      156           
  Lines        8563     8563           
=======================================
  Hits         7953     7953           
  Misses        610      610           
Components Coverage Δ
i24 SSX 77.15% <ø> (ø)
hyperion 98.73% <100.00%> (ø)
other 98.31% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter
from dodal.devices.zebra.zebra_controlled_shutter import MXZebraShutter
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.

I think MX should be Mx - but I guess here is not the place to argue that

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.

I would argue that MX is acronym, and as discussed in DiamondLightSource/dodal#2033 (comment), acronyms are all upper case in PEP8. I don't mind having the discussion but:

  • It should be in a wider group
  • If we change away from PEP8 we should then document the exception and fix it everywhere at once

"current, expected",
[
# exact multiples
(0, 0),
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.

if the numerical type is float rather than pure int You should have some non-integer test examples

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.

As above, this was an accidental change, I will remove

(-10, 0),
(-200, -360),
# halfway cases
(180, 0),
Copy link
Copy Markdown
Contributor

@CoePaul CoePaul May 12, 2026

Choose a reason for hiding this comment

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

I would have made these test case close to an edge like 180.1 or 179.9
balancing on the exact knife edge is inviting the test to go flaky and really nobody would care which way exactly 180 went ( when rounded ) in practice

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.

As above, this was an accidental change, I will remove


def find_nearest_omega_360(gonio: XYZOmegaStage):
current_omega = yield from bps.rd(gonio.omega.user_readback)
return round(current_omega / 360) * 360
Copy link
Copy Markdown
Contributor

@CoePaul CoePaul May 12, 2026

Choose a reason for hiding this comment

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

does it not make sense to put the maths into dodal ?
and test it there?

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.

Apologies, this was accidentally commited by me. Not sure why it made it made it here

Comment thread pyproject.toml
"ophyd-async >= 0.16.0",
"bluesky >= 1.14.6",
"dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@main",
"dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@cryst_bluesky_10_fast_shutter",
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.

again we're pinning to a specific version of dodal - is that an intended side effect of this PR ?

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.

Copy link
Copy Markdown
Contributor

@CoePaul CoePaul left a comment

Choose a reason for hiding this comment

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

Just commented on some things I noticed

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

Labels

dev experience Changes relating to developer experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants