Implement EPICS-backed Polynomial ID Device for I06#2016
Implement EPICS-backed Polynomial ID Device for I06#2016Relm-Arrowny wants to merge 41 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2016 +/- ##
==========================================
- Coverage 99.09% 99.09% -0.01%
==========================================
Files 326 328 +2
Lines 12507 12600 +93
==========================================
+ Hits 12394 12486 +92
- Misses 113 114 +1 ☔ 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
| self.gap_energy_motor_lut = gap_energy_motor_lut | ||
| self.phase_energy_motor_lut = phase_energy_motor_lut | ||
| self.inverse_gap_energy_motor_lut = inverse_gap_energy_motor_lut |
There was a problem hiding this comment.
Is this needed? These are never used anywhere and parent class will keep the method to find the lut
| 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.
| # Insertion Device | ||
| # ------------- Downstream Insertion Device -------------------- | ||
| @devices.factory() | ||
| def i06_idd_epics_polynomial_device() -> I06EpicsPolynomialDevice: |
There was a problem hiding this comment.
| def i06_idd_epics_polynomial_device() -> I06EpicsPolynomialDevice: | |
| def idd_polynomial() -> I06EpicsPolynomialDevice: |
We don't need beamline, epics and device on the instance
|
|
||
| # -------------------- Upstream Insertion Device ------------------- | ||
| @devices.factory() | ||
| def i06_idu_epics_polynomial_device() -> I06EpicsPolynomialDevice: |
There was a problem hiding this comment.
| def i06_idu_epics_polynomial_device() -> I06EpicsPolynomialDevice: | |
| def idu_polynomial() -> I06EpicsPolynomialDevice: |
| } | ||
|
|
||
|
|
||
| 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.
| energy=self._energy, | ||
| derived_units=units, | ||
| ) | ||
| self._energy = soft_signal_rw(float, initial_value=100) |
There was a problem hiding this comment.
Why have we given a random value of 100 as the initial value. Where are the units?
Fixes #2003
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}