Repository navigation
Add transparent state to energy specific attenuation - #2248
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2248 +/- ##
=======================================
Coverage 99.30% 99.31%
=======================================
Files 379 379
Lines 14892 14941 +49
=======================================
+ Hits 14789 14838 +49
Misses 103 103 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CoePaul
force-pushed
the
dodal_2123_transp
branch
3 times, most recently
from
November 3, 2026 18:37
986fba6 to
eb4edf4
Compare
CoePaul
force-pushed
the
dodal_2123_transp
branch
2 times, most recently
from
November 6, 2026 22:51
7d50c3c to
755ccfb
Compare
The natural constant for not attenuating is hereby included in the energy_specific_attenuation pairing class
Raise error without predefining message string
* Widen use of dunder contains to ask if an energy lies inside a modelled absorption spectrum (or does not) * Adjust affected production classes and tests
* Add span to provide interval length
* Add directed segment, an interval with directional sense
- these can be used to perform 1:1 bidirectional mappings
via y=mx+c style "straight" line mappings x <--> y
* Add parametric interpolation / extrapolation
- whereby a fraction 0 to 1 runs along the interval
(or, when strict interpolation mode is false,
outside values are reached by fractions
outside the 0 to 1 range)
* Tighten type checking for args of the FloatInterval dunder contains method
- Motive
Any check reporting the bool answer to
Q: 'does this specific real number lies within this FloatInterval?'
should not have to handle str or bool as spurious input arg types,
henceforce they are excluded explicitly
So this change will tighten up the checks
* Add tests to cover new tighter type checking
CoePaul
force-pushed
the
dodal_2123_transp
branch
from
November 13, 2026 15:28
755ccfb to
1c5f3af
Compare
noemifrisina
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several small updates for i19 attenuation
Contributes towards #2123
Namely:
The natural constant for transparency (ie 'not attenuating')
is hereby included in the energy_specific_attenuation pairing class
String preparation of the message in a raised error was simplified
(to drop declaring a local string variable before raising)
Improvement of checking energy suitability of a given absorber material:
The spectrally modelled absorption - of a given material - only covers
certain energy ranges and this code update improves the checking
relating to energy eligibility, there's also a specific error type for energy ineligibility.
FloatInterval maths is extended
a DirectedSegment is introduced ( since the interval types always go from a lower to upper value )
allowing for the start to end ( of a segment ) to face in either direction
Without this it's very awkward to use segment / interval types for bidirectional mapping
between y and x via relations of the form y = mx + c
But once we have the DirectedSegment type, not only is bidirectional mapping
made simplier, but parameterised mapping to (and from) a 0 to 1 fractional range is also
simple. This is particularly useful for mapping from lateral-position to thickness to absorption
in a wedge absorber
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}