Implement EPICS-backed Polynomial ID Device for I06#2016
Implement EPICS-backed Polynomial ID Device for I06#2016Relm-Arrowny wants to merge 51 commits intomainfrom
Conversation
oliwenmandiamond
left a comment
There was a problem hiding this comment.
This looks good. Just think the variable name needs to be changed + need to add the config
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2016 +/- ##
=======================================
Coverage 99.11% 99.12%
=======================================
Files 328 330 +2
Lines 12774 12873 +99
=======================================
+ Hits 12661 12760 +99
Misses 113 113 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…mondLightSource/dodal into 2003-add-apple2-energy-device-to-i06
oliwenmandiamond
left a comment
There was a problem hiding this comment.
Thanks, is a good first start but I think the design needs a bit more work. Please see my comments
| def _get_apple2_value(self, gap: float, phase: float, pol: Pol) -> Apple2Val: | ||
| return Apple2Val( | ||
| gap=gap, | ||
| phase=Apple2PhasesVal( | ||
| top_outer=phase, | ||
| top_inner=0.0, | ||
| btm_inner=phase, | ||
| btm_outer=0.0, | ||
| ), | ||
| ) |
There was a problem hiding this comment.
This shares the same return as Apple2EnforceLHMoveController. I wonder if there is a better way we could do this or just accept the duplication. Maybe create a another controller called FourArmApple2Controller or UnlockedApple2Controller which this and Apple2EnforceLHMoveController inherit from.
There was a problem hiding this comment.
I think this will be moot when we add LA and extra lookup correct i06 has.
| } | ||
|
|
||
|
|
||
| class I06EpicsPolynomialDevice(Device, Triggerable): |
There was a problem hiding this comment.
This class seems confused to me. This should be inheriting from EnergyMotorLookup.
I think this possibly needs to be restructured so that we have three classes of this, one for EnergyGapEpicsMotorLookup, EnergyPhaseEpicsMotorLookup, and GapMotorEpicsEnergyLookup and then create an instance of each one. This way each logic is more focused and smaller.
Then we can also update base class method EnergyMotorLookup.update_lookup to be async and then create each one to then give to the controller. We could even make it automatically update by adding a monitor and then forcing an update table if detects a change.
There was a problem hiding this comment.
EpicsPolynomialEnergyMotorLookup now inherits from EnergyMotorLookup via a new shared StaticPolynomialEnergyMotorLookup class. I opted not to create three separate classes since their functions are identical, instead I make I06EpicsPolynomialDevice as a composition of EnergyMotorLookup.
We do not really want a autoupdate to prevent energy calibrations from changing without an explicit request through the triggerable interface. Not 100% if we want triggerable or not but it seem to me it much easier to do yield from bps.trigger(device) Then working out how to make blueapi do await device.update_lookup().
…mondLightSource/dodal into 2003-add-apple2-energy-device-to-i06
Fixes #2003
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}