-
Notifications
You must be signed in to change notification settings - Fork 12
I09-1 switch to config_server for hard undulator lut #1798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
2b6b6a3
switch to config_server for lut
af2d8c3
cast to np.ndarray
4cd8813
overwrite file
cb2b9f9
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 070dd75
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 4b8bd8f
fix mock side effect
758596f
fix lint
cafe52c
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 29f253c
small update to test failing certificate in daq-server
7941bde
change lut to lut_provider tp avoid call to daq-server in CI
01bff15
fix tests
b039205
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord bbe6ad4
switch to GenericLookupTable
c2eb47a
pin version daq-server to >=1.1.2
84886d9
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 76dc6a9
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 3524b72
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 69eefc1
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 480c763
merge main branch
1fd00ad
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord f816f60
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord f86aac3
Merge remote-tracking branch 'origin/main' into i09-1-add_lut_from_co…
d0c40a1
fix tests
61d00f0
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 5bae87d
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord ae4ed35
clean up functions, move logic get_file_content logic out of them
4048d69
rework classes
87690b8
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord df39eca
add more docstrings
3735d58
more docstrings
08c4856
docstring
d92bac6
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 6c1dd4a
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 8f8119d
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 586ec5f
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 14ff920
fix updated daq-config-server module
e179241
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 3ec366d
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord 62e4828
small typo
34d7645
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord d1eb2fa
Merge branch 'main' into i09-1-add_lut_from_config_server
Villtord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For i03, I've created a device fixture so the device manager can inject the client into devices where needed:
But 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you direct me to where you use it in plans?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/DiamondLightSource/mx-bluesky/blob/62c0c9ae5d4eef36c2d60ea8d1800dece8cbe84b/src/mx_bluesky/hyperion/utils/context.py#L20
Here's one example. Also for beamline parameters which aren't necessarily linked to a device
That's true, it feels a bit weird to make something a device just so we have access to it inside plans though. Would be nice if there was a different way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree maybe the name "Device" is slightly misleading, but it does utilise all the existing infrastructure and is much cleaner.
Something that might flow a little better is to get the
DeviceManagerin dodal and in turnBlueapito support allowing objects to only implement the nativeHasNameBluesky protocol so it is clear it is not a device but is still findable and therefore injectable into plans. Would give much more flexibility for any other future use cases for other objects we need accessible in plans via BlueAPI which are not devices.