Skip to content

Add energy specific attenuation - #2238

Merged
CoePaul merged 1 commit into
mainfrom
dodal_2123e
Oct 20, 2026
Merged

CoePaul merged 1 commit into
mainfrom
dodal_2123e

Conversation

@CoePaul

@CoePaul CoePaul commented Oct 19, 2026

Copy link
Copy Markdown
Contributor
  • Pairing type which combines an attenuation with the x-ray energy at which the attenuation is either demanded, predicted or reported will be a useful payload to pass between layers of transmission control logic for i19

  • Convenience methods will allow for:

    • equality checking
    • greater than comparability ( N.B. boilerplate total_ordering avoided as this would raise spurious type errors even for args of the same type )
    • attenuation demand reduction calculations where filter wheel assists wedge
    • python comprehensions over all available filter wheel absorber foils

Contributes towards #2123

Instructions to reviewer on how to test:

  1. Read code and commit explanations and tests to see if these look sane
  2. Confirm linter, testing CI and code coverage all sparkle verdantly

Note this is a small step for code
but a large leap for i19 transmission kind

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 noemifrisina October 19, 2026 18:50
@CoePaul CoePaul self-assigned this Oct 19, 2026
@CoePaul
CoePaul requested a review from a team as a code owner October 19, 2026 18:50
@CoePaul CoePaul added python Pull requests that update Python code i19-1 i19-2 labels Oct 19, 2026
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.29%. Comparing base (8c4b5db) to head (1e5658e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2238   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files         372      373    +1     
  Lines       14638    14687   +49     
=======================================
+ Hits        14535    14584   +49     
  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.

@CoePaul

CoePaul commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Note:
Anything handling "Attenuation" rather than "Transmission" is internal to dodal and a plan never needs to see it / handle it / deal with it / communicate with it.
Plans don't speak "Attenuation" plans only know about "Transmission."
"Attenuation" is an internal currency to use inside the transmission system device.

* Pairing type which combines an attenuation with the x-ray energy
  at which the attenuation is either demanded, predicted or reported
  will be a useful payload to pass between layers of transmission
  control logic for i19

* Convenience methods will allow for:
   - equality checking
   - greater than comparability
    ( N.B. boilerplate total_ordering avoided as this would raise
      spurious type errors even for args of the same type )
   - attenuation demand reduction calculations
      where filter wheel assists wedge
   - python comprehensions over all available filter wheel absorber foils
@CoePaul
CoePaul merged commit b48576c into main Oct 20, 2026
11 checks passed
@CoePaul
CoePaul deleted the dodal_2123e branch October 20, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i19-1 i19-2 python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants