Skip to content

I15-1: Add timeout calculations to slow attenuator - #2219

Merged
DominicOram merged 2 commits into
mainfrom
2215_increase_timeout_on_slow_attenuator
Sep 28, 2026
Merged

DominicOram merged 2 commits into
mainfrom
2215_increase_timeout_on_slow_attenuator

Conversation

@DominicOram

Copy link
Copy Markdown
Contributor

Fixes #2215

Instructions to reviewer on how to test:

  1. Confirm tests pass
  2. Confirm dodal connect i15-1 passes

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}

@DominicOram
DominicOram requested a review from a team as a code owner September 25, 2026 12:00
@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.28%. Comparing base (81f92b9) to head (248c6ae).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2219   +/-   ##
=======================================
  Coverage   99.28%   99.28%           
=======================================
  Files         366      366           
  Lines       14418    14437   +19     
=======================================
+ Hits        14315    14334   +19     
  Misses        103      103           

☔ View full report in Codecov by Harness.
📢 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.

Comment on lines 112 to +114
Will raise ValueError if the percentage is not possible.
"""
await self.transmission.set(value)
await self.transmission.set(value, timeout=self._timeout)

@oliwenmandiamond oliwenmandiamond Sep 25, 2026 •

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.

Is this timeout value ever going to change? If so, you only calculate it once on initial connect. Would it be better to calculate it dynamically every time on move?

E.g

timeout = await self._calculate_timeout()
await self.transmission.set(value, timeout=timeout)

If it never would change, then your current approach is probably correct

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.

It will only change when the hardware changes, so like maybe if they rip it all out and put new things in, which they've never done before. This seemed a good middle ground between the overhead of recalculating it on every move and the flexibility of not having to worry about changing it again in the future. I can add some comments to that affect though

@oliwenmandiamond oliwenmandiamond left a comment

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.

Can confirm dodal connect works. Nit: Add a comment in your connect method to say it shouldn't change dynamically and is okay to calculate once.

@DominicOram
DominicOram enabled auto-merge (squash) September 28, 2026 09:07
@DominicOram DominicOram changed the title Add timeout calculations to positioner I15-1: Add timeout calculations to slow attenuator Sep 28, 2026
@DominicOram
DominicOram enabled auto-merge (squash) September 28, 2026 09:07
@DominicOram
DominicOram merged commit 75bf602 into main Sep 28, 2026
11 checks passed
@DominicOram
DominicOram deleted the 2215_increase_timeout_on_slow_attenuator branch September 28, 2026 09:21
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.

I15-1: Slow attenuator times out

2 participants