Commit 9ed11d4
Create ConfigServerEnergyMotorLookup and decouple gap and phase (#1733)
* add i09 look up table praiser
* move get_poly to lookuptable
* extracted EnergyMotorLookup base class from i10EnergyMotorLookup
* added new make_phase_tables function
* add test for correct table output
* remove_i09
* add docstring
* add test for helper functions
* add test for skipping
* group and reuse fixture, add J09 controller and tests
* there is no reason to set mock value to zero
* spacing fix
* remove print
* add gap tests
* add controller, energy and polarisation to i09_2 configuration
* move path to top
* add model_validation
* remove debug
* Update docstring for energy_jid function
* Update nc parameter and phase calculation logic
Change 'nc' parameter to negative ROW_PHASE_CIRCULAR and adjust phase calculation based on pol.
* Refactor Lookuptable class documentation
Removed outdated docstring from Lookuptable class and updated initialization docstring for I10EnergyMotorLookup class.
* update expected lookup table after sign change
* change lookup table schema to snake case
* replace dictionary with basemodel
* add tying
* add gap and phase
* fat finger correction
* Update ID lookup logic to use type checking
* Fix some tests
* Improve models to not use shared defaults
* undo syntax error
* Fixed test to check for success on loading i10 lut
* Simplified lut logic
* Added back generate_lookup_table function
* Fixed all tests but polarisation
* Updated doc strings
* Moved generic test from i10 to test_lookup_table_apple2
* Renamed lut_column_config to lut_config
* Updated more doc strings
* Fix default phase_file name and thus tests
* Use Pol in LookupTable rather than string
* Updated test_convert_csv_to_lookup_overwrite_name_convert_default to use Pol
* Update tests to use Pol rather str value
* fix tests
* fix i09 controller and test
* reuse fixture
* Improve EnergyCoverageEntry to have a poly serializer and EnergyCoverage to use float as key
* Add type checking to i10Apple2 phase
* Removed commente out code
* Update i10 id tests to use json files rather than pickle files so they are human readable
* Remove comments
* Fixed poly test
* Fixed test_make_phase_tables_multiple_entries
* Added test_lookup_table_is_serialisable
* Update src/dodal/devices/util/lookup_tables_apple2.py
Co-authored-by: Raymond Fan <[email protected]>
* Fixed formatting
* Improved code coverage
* Simplified ID lookup table logic
* Updated doc strings, tidy tests and variable names
* Made default files a constant
* added gap and phase lookup
* Update logging messages
* Removed duplicate test logic
* Decoupled path from LookupTableConfig, updated convert_csv_to_lookup to use file_contents again
* Updated doc strings
* Clean up imports
* fixed test
* update and reuse fixture
* change I09 to use json data
* fix controller
* add test for Path not given
* correct test
* typing
* modify _setpol to go to lh first for i09 id
* Rename class and update comments for clarity
* Remove POLY_DEG list from test_i09_apple2.py
Removed the POLY_DEG list from the test file.
* fix lint
* remove I09EnergyMotorLookup and move phase generation into EnergyMotorlookup
* move lookup table path into lut_config
* revert lookuptable with path
* introduce spacing to data
* Update src/dodal/devices/util/lookup_tables_apple2.py
Co-authored-by: oliwenmandiamond <[email protected]>
* Update src/dodal/devices/util/lookup_tables_apple2.py
Co-authored-by: oliwenmandiamond <[email protected]>
* remove J09defaultlookuptable
* remove default in test
* lint
* update ophyd
* Apply suggestions from code review
Co-authored-by: oliwenmandiamond <[email protected]>
* fix typo
* fix file name and test
* Create AbstractEnergyMotorLookup
* Moved apple2 fixture to dodal.testing.fixtures.devices.apple2
* Fix test
* Remove init for DummyEnergyMotorLookup
* Removed unneeded pytest plugins
* Adjust i17 implementation
* Fix tests
* Add PhaseAxes type to Apple2 for i17
* Update lookup_tables_apple2 doc strings
* Renamed update_lut to update_lookup_table
* Further improve type checking for i09 and i17 apple2
* Reworked GeneratePoly1DFromFileEnergyMotorLookup to ConfiguredEnergyMotorLookup. Update i09 to use phase lookup table
* Updated variable names for generate_lookup_table to be lut
* Restructured controller logic to reuse more components
* Updated doc strings and function names
* Add missing types to EnergyMotorLookup
* Correct return type for process_row
* Remove ConfiguredEnergyMotorLookup and changed this to EnergyMotorLookup, removed abstract
* Rename _id_set_value to _get_apple2_value
* Renamed get_motor_from_energy to find_value_in_lookup_table
* Remove available_pol from EnergyMotorLookup
* Fix tests
* Renamed parameters from feedback
* Renamed configured_energy_motor_lookup to energy_motor_lookup
* Removed pol arg from _set_apple2, i10 now extends _set_motors_from_energy_and_polarisation instead
* Add csv to ConfigServerEnergyMotorLookup doc stirng
* Update ConfigServerEnergyMotorLookup __init__ doc string to remove reference to gap
* Removed unneeded test setup
* Fixed test
* Updated docs for Apple2Controller
* Removed _set_apple2 as no longer needed
---------
Co-authored-by: Relm-Arrowny <[email protected]>1 parent 75e94dc commit 9ed11d4
File tree
19 files changed
+589
-717
lines changed- src/dodal
- beamlines
- devices
- i10
- i17
- util
- testing/fixtures/devices
- tests/devices
- i10
- i17
- util
19 files changed
+589
-717
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
83 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
84 | 93 | | |
85 | | - | |
| 94 | + | |
86 | 95 | | |
87 | 96 | | |
88 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
| |||
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
126 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
127 | 131 | | |
128 | | - | |
129 | | - | |
130 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | | - | |
133 | 140 | | |
134 | 141 | | |
135 | 142 | | |
| |||
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
191 | | - | |
| 198 | + | |
| 199 | + | |
192 | 200 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
196 | 213 | | |
197 | | - | |
198 | 214 | | |
199 | 215 | | |
200 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
430 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
431 | 433 | | |
432 | 434 | | |
433 | 435 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 436 | + | |
| 437 | + | |
439 | 438 | | |
440 | 439 | | |
441 | | - | |
| 440 | + | |
442 | 441 | | |
443 | 442 | | |
444 | 443 | | |
| |||
448 | 447 | | |
449 | 448 | | |
450 | 449 | | |
451 | | - | |
| 450 | + | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
465 | 464 | | |
| 465 | + | |
| 466 | + | |
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
| |||
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
| 485 | + | |
484 | 486 | | |
485 | | - | |
486 | | - | |
487 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
488 | 490 | | |
489 | 491 | | |
490 | 492 | | |
| |||
496 | 498 | | |
497 | 499 | | |
498 | 500 | | |
499 | | - | |
| 501 | + | |
500 | 502 | | |
501 | | - | |
| 503 | + | |
502 | 504 | | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
508 | | - | |
| 510 | + | |
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
512 | | - | |
| 514 | + | |
513 | 515 | | |
514 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
515 | 527 | | |
516 | | - | |
| 528 | + | |
| 529 | + | |
517 | 530 | | |
518 | 531 | | |
519 | 532 | | |
| |||
525 | 538 | | |
526 | 539 | | |
527 | 540 | | |
528 | | - | |
529 | 541 | | |
530 | 542 | | |
531 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
13 | 11 | | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
37 | 53 | | |
38 | 54 | | |
39 | | - | |
| 55 | + | |
| 56 | + | |
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 61 | + | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
58 | 69 | | |
59 | 70 | | |
60 | 71 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| |||
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
73 | | - | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
0 commit comments