Commit e127570
Bimorph mirrors (#992)
* Create bimorph_mirrors dir with __init__.py
* Create bimorph_mirror.py with basic class structure
* Add VOUT_RBV channel creation to __init__
* Move bimorph_mirror.py out of bimorph_mirrors directory
* Create BimorphMirrorChannel with vout_rbv SignalR
* Change BimorphMirrorChannel child creation to procedural
* Replace BimorphMirror child decleration to use BimorphMirrorChannel
* Remove unused imports
* Remove unused import
* Remove uneccesary Format in add_children_as_readables
* Add super().__init__ call
* Add VTRGT_RBV, STATUS to BimorphMirrorChannel
* Add BimorphMirror.set method
* Add bimorph test file
* Fix STATUS type
* Make BimorphMirror.set await values in VOUT_RBV
* Add assertion that channel exists to BimorphMirror.set
* Replace .get with square brackets in BimorphMirror.set to avoid typing errors
* Add BimorphMirrorChannel.shift
* Add BimorphMirror.all_shift, .add_volt
* Add BimorphMirror.channels, .status, .temps
* Rename previous BimorphMirror.channels to BimorphMirror.channel_list to avoid member name clash
* Add BimorphMirror.reset_err_proc, .err
* Add BimorphOnOff Strict Enum
* Add BimorphMirror.on_off
* Add BimorphMirrorMode StrictEnum
* Add BimorphMirror.op_mode
* 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
* 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
* 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
* 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
* 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
* Remove BimorphMirrorChannel.set
* Remove merge conflict, fix BimorphMirror signature
---------
Co-authored-by: Callum Forrester <callum.forrester@diamond.ac.uk>
Co-authored-by: Richard Cunningham <richard.cunningham@diamond.ac.uk>1 parent 3dc3b67 commit e127570
File tree
2 files changed
+116
-132
lines changed- src/dodal/devices
- tests/devices/unit_tests
2 files changed
+116
-132
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 60 | | |
69 | | - | |
| 61 | + | |
70 | 62 | | |
71 | 63 | | |
72 | 64 | | |
73 | 65 | | |
74 | 66 | | |
75 | | - | |
76 | 67 | | |
77 | 68 | | |
78 | 69 | | |
| |||
103 | 94 | | |
104 | 95 | | |
105 | 96 | | |
106 | | - | |
107 | | - | |
| 97 | + | |
| 98 | + | |
108 | 99 | | |
109 | 100 | | |
110 | | - | |
| 101 | + | |
111 | 102 | | |
112 | 103 | | |
113 | 104 | | |
114 | 105 | | |
115 | | - | |
| 106 | + | |
116 | 107 | | |
117 | | - | |
| 108 | + | |
| 109 | + | |
118 | 110 | | |
119 | 111 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
127 | 124 | | |
128 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
5 | | - | |
6 | | - | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
13 | | - | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| |||
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
27 | | - | |
28 | | - | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
33 | | - | |
| 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 | + | |
34 | 71 | | |
35 | | - | |
36 | | - | |
| 72 | + | |
37 | 73 | | |
38 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
39 | 78 | | |
40 | 79 | | |
41 | | - | |
42 | 80 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 81 | + | |
| 82 | + | |
46 | 83 | | |
47 | | - | |
| 84 | + | |
48 | 85 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
53 | 90 | | |
54 | 91 | | |
55 | | - | |
56 | 92 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 93 | + | |
| 94 | + | |
60 | 95 | | |
61 | | - | |
| 96 | + | |
62 | 97 | | |
63 | 98 | | |
64 | 99 | | |
65 | | - | |
| 100 | + | |
66 | 101 | | |
67 | 102 | | |
68 | 103 | | |
69 | 104 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
75 | 108 | | |
76 | 109 | | |
77 | 110 | | |
78 | 111 | | |
79 | | - | |
| 112 | + | |
80 | 113 | | |
81 | 114 | | |
82 | | - | |
83 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
84 | 119 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 120 | | |
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 | + | |
121 | 124 | | |
122 | 125 | | |
123 | | - | |
124 | 126 | | |
125 | | - | |
126 | | - | |
127 | | - | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | | - | |
| 130 | + | |
130 | 131 | | |
131 | | - | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
0 commit comments