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

Create directory provider that can sync the file name prefix to a unique value based on the run engine #576

Open
callumforrester opened this issue May 24, 2024 · 2 comments

Comments

@callumforrester
Copy link
Contributor

As a user I would like the files my detector writes to be tied uniquely to the current bluesky run so that I can easily group my data files.

Possible Solution

#565 is a speculative PR that does this by using the RunEngine's scan id hook.

Acceptance Criteria

  • Directory provider that updates when the run engine updates exists
  • Used in I22

Optional Acceptance Criteria

  • UpdatingDirectoryProvider replaced with new provider
  • UDC and other MX applications use new provider
@callumforrester
Copy link
Contributor Author

Should consider how best to actually hook the new provider into the RunEngine. In particular we need to find something that works well for blueapi and hyperion. I don't think anything will be too bad as long as its documented (as @DominicOram requests in #565).

A few options:

  • Make a utility function for connecting the two together, document it, make blueapi and hyperion intentionally call it
  • Move the creation of a run engine to the dodal beamline module, set it up in a factory function there, import it into blueapi and hyperion
  • Create some sort of run engine config object (e.g. pydantic model) in the beamline module that blueapi and hyperion can use and set up

The first is simplest, the third is similar but possible more extensible, the second requires the most boilerplate but is very flexible.

@callumforrester callumforrester changed the title Create directory provider that can Create directory provider that can sync the file name prefix to a unique value based on the run engine May 24, 2024
@callumforrester
Copy link
Contributor Author

The flaw in this plan was that the RunEngine hook is still called after detectors are staged, and have opened their files, which is too late. So this approach has the same problems as the last one but with less custom code. This is an improvement, but to actually solve the problem we need to start making our detectors call .stage later. There is an ophyd-async issue for that: bluesky/ophyd-async#314

This issue plus that one would solve this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant