Skip to content
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

Make a redis lookup table caching device #734

Closed
stan-dot opened this issue Aug 8, 2024 · 6 comments
Closed

Make a redis lookup table caching device #734

stan-dot opened this issue Aug 8, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request i18 python Pull requests that update Python code

Comments

@stan-dot
Copy link
Contributor

stan-dot commented Aug 8, 2024

As per discussion with @callumforrester and @DiamondJoseph this is needed for db IO as this cannot be in a plan or a stub as it would clog the RunEngine

problem description

i18 lookup tables are saved in brittle csv documents, with manual steps as part of the alignment process.

proposed solution

add a LookupTable device as part of the Undulator or Undulator-DCM system. The device holds a connection to a key value fast lookup store (like Redis, already deployed at i18). Alignment is done automatically just thorugh specifying the desired element and edge, without manual steps. At first peak matching is supported, later a weighed average algorithm could be added as an option.

relevant beamlines

i10 (@Relm-Arrowny has recently done work on that #744), and MX i03, i04 (as discussed with @DominicOram ) at the moment have ophyd-async devices that read the lookup tables from the filesystem

Acceptance Criteria

  • I can spin the device up at i18 and make a quick test plan to test redis read and write
@stan-dot stan-dot added enhancement New feature or request python Pull requests that update Python code i18 labels Aug 8, 2024
@stan-dot stan-dot self-assigned this Aug 8, 2024
@callumforrester
Copy link
Contributor

@stan-dot do you plan to put an API between the device and redis?

@stan-dot
Copy link
Contributor Author

stan-dot commented Aug 19, 2024

what do you mean? I'd use the redis client library and point at the redis instance on the cluster. which would need an ingress

@stan-dot
Copy link
Contributor Author

todo: need to move the temporary implementation from the i18-bluesky repo

@stan-dot
Copy link
Contributor Author

as @DominicOram commented elsewhere it fits best to include this as a child device in Undulator.

also this is relevant
DiamondLightSource/i18-bluesky#14

@stan-dot
Copy link
Contributor Author

as the scan also uses data from the diode, it remains to be decided how to split the logic between the plan and the device. we could have a data structure to get from the diode, and do all the calculations from the device

@stan-dot
Copy link
Contributor Author

as discussed, this should rather be a stateless callback to a stateful microservice

@stan-dot stan-dot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i18 python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

2 participants