Skip to content

Trigger multi-xia2 on I23 - #394

Open
pblowey wants to merge 7 commits into
mainfrom
collate_sweeps_i23
Open

pblowey wants to merge 7 commits into
mainfrom
collate_sweeps_i23

Conversation

@pblowey

@pblowey pblowey commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Addresses https://github.com/DiamondLightSource/mx-analysis/issues/50

Adds function to trigger service for running multi-xia2. On most MX beamlines, mutli-xia2 runs automatically on data collections collected in the same data collection group. This used to also be true for I23. I23 no longer have data collection group functionality (not clear why this the case), however, they would still like multi-xia2 to run on MAD wedge style experiments.

The new trigger function is designed to be called with a delay from the start of the xia2 recipes. The trigger function has logic to then check to see if any more recent data collections have been made with matching sampleid, sessionid, prefix and run number. If there is a more recent collection, the trigger is skipped as the more recent data collection will also attempt to trigger multi-xia2. If there is not a more recent data collection that matches the criteria, the MAD wedge experiment will have been assumed to have completed and the pipeline will run. The delay (which is set by the recipe) should be long enough to allow subsequent wedges to have been collected before the trigger conditions are assessed.

@pblowey

pblowey commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Following feedback from I23, experiments can vary significantly in number of energies (up to 10) so having a static delay to wait for new data collections is not appropriate. I have added logic that, upon finding two or more related data collections (same prefix and run number), it will see how many data collections were taken between them on the same sample to work out how many energies were in the experiment. It also looks to see if any more recent dcids have been made on the same sample at all so that the pipeline can be triggered sooner if needed.

An overall sanity timeout is also applied in case something unexpected happens in the data collection/timeout logic to avoid an indefinite wait for more collections.

@pblowey
pblowey requested a review from isikhar October 8, 2026 15:38
@pblowey pblowey self-assigned this Oct 8, 2026
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

Successfully merging this pull request may close these issues.

1 participant