Skip to content

Tighten up I19 Attenuator related definitions - #2125

Merged
CoePaul merged 1 commit into
mainfrom
dodal2123_a
Jul 21, 2026
Merged

CoePaul merged 1 commit into
mainfrom
dodal2123_a

Conversation

@CoePaul

@CoePaul CoePaul commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Contributes to #2123

  • Rename the attenuator motor position dataclass to make it clear it can be used for more than just setting demands

  • Fix associated test which was brittle on the class name

  • Replace looser PositiveInt type ( which coerces ) with the stricter Annotated StrictInt type for wheel index positions

  • Adjust tests of Attenuator positions to catch up with these changes -- widen tests of invalid definitions using parametized testing

Instructions to reviewer on how to test:

  1. Confirm renaming of production code and corresponding test classes makes coherent sense
  2. Ensure all CI tests pass

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}

@CoePaul
CoePaul requested a review from a team as a code owner July 20, 2026 15:54
@CoePaul CoePaul self-assigned this Jul 20, 2026
@codecov

codecov Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (edea41f) to head (264dcc3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2125   +/-   ##
=======================================
  Coverage   99.15%   99.15%           
=======================================
  Files         353      353           
  Lines       13793    13794    +1     
=======================================
+ Hits        13677    13678    +1     
  Misses        116      116           

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

@CoePaul
CoePaul force-pushed the dodal2123_a branch 2 times, most recently from 50df20e to b4bf6d0 Compare July 21, 2026 10:34
Contributes to #2123

* Rename the attenuator motor position dataclass to make it clear it can be used for more than just setting demands

* Fix associated test which was brittle on the class name

* Replace looser PositiveInt type ( which coerces ) with the stricter Annotated StrictInt type for wheel index positions

* Adjust tests of Attenuator positions to catch up with these changes -- widen tests of invalid definitions using parametized testing
@CoePaul
CoePaul requested a review from rtuck99 July 21, 2026 10:37

@rtuck99 rtuck99 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.

Looks fine, I don't have particular opinons other than it feels like set() should call model_dump() instead of validate_complete_damnd() otherwise you're only getting half the benefit of using pydantic models. But that would require a change in the logic at both ends, so I'm not going to insist on it.

@CoePaul
CoePaul merged commit b012bbb into main Jul 21, 2026
11 checks passed
@CoePaul
CoePaul deleted the dodal2123_a branch July 21, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants