I09-1 switch to config_server for hard undulator lut#1798
I09-1 switch to config_server for hard undulator lut#1798
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1798 +/- ##
=======================================
Coverage 99.11% 99.11%
=======================================
Files 318 318
Lines 12354 12370 +16
=======================================
+ Hits 12245 12261 +16
Misses 109 109 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Your i09 devices will be need to be moved to |
|
Anyone willing to review? |
| @@ -51,7 +65,8 @@ def iidenergy( | |||
| return HardInsertionDeviceEnergy( | |||
There was a problem hiding this comment.
I personally really dislike making config client global scope. However, this makes no sense as you have made it global, yet are still injecting it as a dependency for the device as configuration. Either use it globally, or use injection. I wouldn't mix the too.
However, looking at this further I can see several other beamlines have also opted for a similar pattern so I will raise as a separate issue
There was a problem hiding this comment.
@rtuck99 and I have discussed this, and there doesn't seem to be a great way of solving the problem that the client may be needed in plans as well as devices. In devices, the client can be injected but this doesn't work for plans. Welcome to any ideas to tidy this up
There was a problem hiding this comment.
For i03, I've created a device fixture so the device manager can inject the client into devices where needed:
@devices.fixture
@cache
def config_client() -> ConfigClient:
client = ConfigClient(I03_CONFIG_SERVER_ENDPOINT)
set_config_client(client)
return clientBut we still have to call set_config_client(client) in case the config client needs to be obtained inside a plan.
There was a problem hiding this comment.
Could you direct me to where you use it in plans?
There was a problem hiding this comment.
If you need access to it inside of plans, you can either make it an attribute of a device and then access that attribute of the device in the plan. Or you could wrap ConfigClient inside its own device and then easily inject it into any plan you need?
This change utilises existing functionality of the config server to read undulator parameters from.
Fixed #1919
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}