Commit 279e583
230 bimorph optimisation plan (#1027)
* Change BimorphMirror.on_off datatype to BimorphMirrorOnOff rather than StrictEnum
* Add docstrings
* Remove uneccesary signals from BimorphMirror
* Add missing attribute to docstring
* Remove duplicate signal decleration
* Remove uneccesary BimorphMirror signal
* Change BimorphMirrorChannel.status to datatype BimorphMirrorOnOff
* Add BimorphMirrorStatus, set as BimorphMirror.status datatype
* Change BimorphMirror.channels datatype to str
* Change BimorphMirrorChannel to declare all signals declaratively
* Remove uneccesary argument
* Move all PV delimiters from suffix into prefix
* Fix incorrect use of PVSuffix
* Make BimorphMirrorChannel inherit from EpicsDevice
* Remove :CHANNELS signal from BimorphMirror
* Rename BimorphMirror.channel_list to .channels
* Remove unused import
* Replace BimorphMirror.set wait on rbv with wait=True
* Add bimorph test_set_channels
* Organise imports
* Make wait_for_value in BimorphMirror.set use DEFAULT_TIMEOUT instead of None
* Rename test_set_channels, fix said test, and add test_set_channels_triggers_alltrgt_proc
* Remove whitespace
* Remove unused import
* Add comments
* Parametrize test_set_channels_wait_for_readback
* Abstract setting vout mock values into fixture
* Parametrize test_set_channels_wait_for_readback
* Add whitespace
* Renam set_vout_mock_values to set_vout_mock_and_return_value
* Add test_set_channels_waits_for_vout_readback unimplemented
* Add test_read, and BIMORPH_NAME global variable
* Make mirror fixture take number_of_channels argument
* Correct BimorphMirrorChannel Format signal types
* Add valid_bimorph_values fixture
* Change test parametrization from bimorph input to number of channels
* Add format changes generated by tox pre-commit
* Change explcit channel number parameter to reference to global list of channel numbers
* Implement test_set_channels_waits_for_vout_readback
* Add test_set_invalid_chanel_throws_error
* Add Raises section to BimorphMirror.set docstring
* Make BiorphMirror.__init__ number_of_channels have no default value
* Replace all asserts inside for loops, to comprehension and comparison
* Remove BIMORPH_NAME global variable
* Remove prng from test input generation
* Add BimorphMirror.__init__ number_of_channels validation
* Add test_init_mirror_with_invalid_channels_throws_error
* Add BimorphMirror.__init__ docstring
* Replace assertion in BimorphMirror.set arg validation with raise ValueError
* Make test_set_invalid_channel_throws_error expect correct error type
* Replace real PV prefix with fake
* Add mock_vtrgt_vout_propogation, remove set_vout_mock fixtures
* Remove unused import
* Fix import for ophyd async 0.9.0a1
* Update src/dodal/devices/bimorph_mirror.py
Co-authored-by: Callum Forrester <callum.forrester@diamond.ac.uk>
* Update src/dodal/devices/bimorph_mirror.py
Co-authored-by: Callum Forrester <callum.forrester@diamond.ac.uk>
* Update src/dodal/devices/bimorph_mirror.py
Co-authored-by: Callum Forrester <callum.forrester@diamond.ac.uk>
* Remove BimorphMirror.number_of_channels
* Rename BimorphMirror.alltrgt_proc, .on_off for readability
* Rename BimorphMirrorChannel.vtrgt, .vout for readbility
* Change BimorphMirror.set type hinting
* Replace BimorphMirror.set sequential input validation with collection
Co-authored-by: Callum Forrester <callum.forrester@diamond.ac.uk>
* Add test_init_mirror_with_zero_channels
* Ensure bimorph has finished moving after set
* wait for value
* Update test_bimorph_mirror.py
* Crop PV name for BUSY toggle
* Crop PV name for BUSY toggle
* await IDLE status
* Update test to account for idling
* Make BimorphMirrorChannel Movable, add set method
* Remove unnecessary fixture from test_bimorph_mirror_channel_set
* Write bimorph_optimisation plan
* Make BimorphMirror.set set to target_voltage in serial, and wait check for mirror status.
* Add wait for BimorphMirrorStatus.IDLE before trigger in BimorphMirror.set
* Refactor mock_vtrgt_vout_propogation to use callback_on_mock_put
* Add mock_bimorph_mirror_status_functionality
* Aggregate mock_vtrgt_vout_propogation, mock_bimorph_mirror_status_functionality, into single bimorph_functionality fixture
* Make test_set_channels_waits_for_vout_readback check subset of call_args rather than equality
* Add bimorph_functionality fixture to test_set_channels_allows_tolerance
* Remove tolerance in BimorphMirror.set
* Remove unused argument in BimorphMirror.set
* Add comment to BimorphMirror.set explaining serial set
* Refactor test_bimorph_mirror to use mirror_with_mocked_put fixture
* Fix SlitDimension X datatype
* Fix move_slits dimension comparison
* Add test_birmorph.py with test_move_slits
* Add docstring to slits fixture
* Add oav fixture, test_bimorph_optimisaiton skeleton
* Add parameters to test_bimorph_optimisation, add initial_voltage_list fixture
* Fix not awaiting coroutine
* Add plan execution to test_bimorph_optimisation
* Add mock velocity value to slits fixture, remove breakpoint
* Fix outer func decorators
* Instantiate SimDetector in DeviceCollector context
* Fix bps.trigger_and_read parameters
* Fix oav fixture, add move_slits_message_generator, inner_scan_message_generator
* Add mirror fixture
* Add setup_message_generator, outer_message_generator
* Add mirror_with_mocked_put fixture
* Refactor capture_bimorph_state, restore_bimorph_state out of plan
* Remove unnecessary comment
* Add test_save_and_restore
* Add test_inner_scan
* Comlete test_bimorph_optimisation test
* Change test parameters
* Add whitespace
* Add typing to mirror_with_mocked_put status function
* Add type hinting to mirror_with_mocked_put vout_propogation_and_status function
* Rename all ..vout.. references to ..output_voltage..
* Make BimorphMirror.set use set_and_wait_for_other_value rather than two seperate calls
* Rewrite mirror_with_mocked_put to not use default arguments in helper functions, add docstring
* Renamed functions in mirror_with_mocked_put fixture for readability
* Refactor test_bimorph_optimisation to be method in TestBimorphOptimisation class
* Refactor mocks in TestBimorphOptimisation to be class parametrization. Add run_scan class fixture.
* Add start_state and mock_capture_bimorph_state fixtures, add test_settle_time_called and test_bimorph_state_restored tests
* Add TestOptimisation.test_bimorph_puts
* Rename TestOptimisation.test_bimorph_puts -> .test_plan_puts_to_bimorph
* Add TestBimorphOptimisation.test_plan_calls_inner_scan
* Add TestBimorphOptimisation.test_plan_sets_mirror_start_position
* Rename TestBimorphOptimisation.test -> .test_bimorph_state_captured
* Change placement of initial_voltage_list logic in multiple tests
* Refactor TestBimorphOptimisation.mock_capture_bimorph_state for readability
* Add docstring to TestBimorphOptimisation
* Add type hinting where lacking
* Set DEFAULT_TIMEOUT to 60
* Change BimorphMirror.set to write to output_voltage and to not trigger commit_target_voltages
* Remove BimorphMirror.commit_target_voltages
* Remove test_set_channels_triggers_alltrgt_proc
* Change test_set_channels_waits_for_readback to read from output_voltage
* Make test_set_one_channel read from output_voltage
* Rewrite inner_scan, outer docstrings
* Replace oav parameter with detectors readable list
* Add detectors fixture, make test_inner_scan use fixture
* Have test_inner_scan assert new dd mock_move_slitcall_args_list rather than mock device
* Refactor test_inner_scan to TestInnerScan.test_inner_scan_moves_slits
* Add TestInnerScan.test_inner_scan_triggers_and_reads
* Fix @stage_deecorator parameters
* Make all TestBimorphOptimisation tests use detectors fixture rather than oav
* Add run_metadata param to inner_scan
* Replace all DeviceCollector with init_devices
* Correct import
* Add missing
* Add close_run calls
* Move open_run to start of plan, fix indentation error
* Replace plans wrapping inner_scan with pure inner_scan as it is now a full plan
* In outer() use new dict for each run_metadata
* Fix inner_run parameters
* Add TestInnerScan.test_inner_scan_writes_run_metadata, and run_metadata fixture
* Reduce fixture permutations
* Add TestIntegration
* Make inner and outer create nested runs
* Remove mock=True from oav fixture
* Add prepare detectors in inner_scan
* Add mock=True to oav fixture
* Remove mock=True from OAV fixture
* Set number_of_triggers in detector preperation to 1
* Remove outer run
* Use different stream for each pencil beam scan
* Add stream_name
* Remove commented out code
* Update inner_scan docstring
* Replace TestInnerScan fixture and params from scan_metadata to stream_name
* Fix TestInnerScan.test_inner_scan_triggers_and_reads
* Remove uneccesary variable assignment
* Prepare detectors before first declare_stream
* Remove run_metadata
* Add metadata to outer_scan run
* Add TestBimorphOptimisation.test_metadata
* Add validate_bimorph_plan, check_valid_bimorph_state
* Add bimorph plan validation
* Add status wait to channel set
* Make BimorphMirrorChannel.set literally just set target voltage
* Change bimorph_optimisation to move bimorph via full mirror, rather than each channel
* Change BimorphMirrorChannel.set to set output_voltage, not target_voltage
* Have restore_bimorph_state move bimorph via mirror, not individual channels
* Change BimorphMirror.set to accept array param rather than mapping
(cherry picked from commit 38f3a904e323fe4f85bca38ae31c9283c082024e)
* Change BimorphMirror.set to set in parallel
* Add BimorphMirror.commit_target_voltages
* Update tests to reflect BimorphMirror.set interface change
(cherry picked from commit 602d07265d50429f74f30cf25d449a2fa78f802b)
* Replace DeviceCollector with init_devices
* Remove test_set_one_channel
* Fix syntax
* Make bimorph_optimisation move mirror with array rather than dict
* Mak restore_bimorph_state write to mirror with list rather than dict
* Fix test_save_and_restore fixture
* Add configurable slit settle time
* Add move to start voltage list before first inner_scan
* Add slit settle time after move to initial position
* Add bimorph settle time after moving into pos
* Move bimorph starting position out of outer scan
* Move all start position movements into outer_scan
* Add test_bimorph_position_generator, fix TestBimorphOptimisation.test_settle_time_called
* Add bimorph_position_generator
* Make bimorph_position_generator return copy of internal list
* Fix bimorph_position_generator returning internal list
* Add TestBimorphPositionGenerator
* Rework bimorph_position_generator to reduce copying mutables
* Remove BimorphMirrorChannel.set
* Add TestPlanValidation
* Fix bimorph_optimisation type ignore
* Fix type checking
* Replace PatternDetector with SimBlobDetector
* Fix BimorphMirror inheritance
* Improve test speeds
* Fix (badly) initial_voltage_list
* Fix test_copies_list positions
* Export bimorph_optimisation plan
* Remove uneccesary default argument
* Make SlitDimension inherit from Enum and str
* Remove merge conflict, fix BimorphMirror signature
* Change Enum to StrEnum
* Fix message in test_move_slits
* Replace StrEnum with str, Enum
* Make bimorph_optimisation accept metadata
* Mark test_full_plan as skip
* Remove skipped test
* Reimplement plan metadata to match standard
* Fix test_metadata
* Fix async issue in test_metadata
* Fix bimorph_optimisation docstring
* Change I22's vertical focusing mirror to 32 channel
* Revert "Change I22's vertical focusing mirror to 32 channel"
This reverts commit 3f83c78.
* Remove uneccesary type ignores
* Remove bimorph_optimisation from plan __init__ __all__
* Change validate_bimorph_plan exception to ValueError
* Rename test_invalid_plan to test_invalid_initial_voltage_list
* Add TestPlanValidation.test_late_invalid_plan
* Change TestPlanValidation.test_invalid_initial_voltage_list to use paramtrized variables
---------
Co-authored-by: Callum Forrester <callum.forrester@diamond.ac.uk>
Co-authored-by: Richard Cunningham <richard.cunningham@diamond.ac.uk>
Co-authored-by: root <root@ws540.diamond.ac.uk>
Co-authored-by: root <root@i22-ws001.diamond.ac.uk>1 parent 5ed3646 commit 279e583
2 files changed
+1126
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
0 commit comments