Repository navigation
Fix auxiliary scan ordering #170
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
Open
jacob-williamson
wants to merge
20
commits into
main
Choose a base branch
from
164_add_order_test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
02a07da
WIP
jacob-williamson be08ff8
Ensure auxiliary ordering is correct
jacob-williamson 1d8c236
Fix bug and tests
jacob-williamson be1fcef
Ensure we get the right scan from tiled
jacob-williamson eea9b1e
Fix bug and add test
jacob-williamson 959e0d5
Update tests
jacob-williamson 9bf8c25
Improve docstring
jacob-williamson cfd5eb5
Tidy
jacob-williamson b00c61a
Tidy
jacob-williamson 0035967
Add some docs
jacob-williamson 1319a6d
Update flowchart
jacob-williamson bea4217
Fix docs
jacob-williamson 260464a
Fix docs
jacob-williamson ab343bb
Fix docs again
jacob-williamson 178927e
Fix docs
jacob-williamson 2c59f0f
Remove image
jacob-williamson 9e74e80
Merge branch 'main' into 164_add_order_test
jacob-williamson 1b2d734
Fix bug
jacob-williamson b536f58
Fix lint
jacob-williamson 325762e
Don't add list to metadata
jacob-williamson 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Beamlines | ||
|
|
||
| ```{toctree} | ||
| :maxdepth: 1 | ||
| :glob: | ||
|
|
||
| i15-1 <beamlines/i15-1/i15-1> | ||
| ``` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # i15-1 Auxiliary Scans | ||
|
|
||
| I15-1 PDF experiments require some scans to be run before hand, for use during analysis. These are added to the queue automatically by the i15-1 queue plugin. For each experiment, we need: | ||
|
|
||
| - an air scan, at room temperature | ||
| - an empty capillary scan, matching the capillary type and temperature range to the experiment | ||
| - a standard sample scan, at room temperature, matching the capillary type to the experiment | ||
|
|
||
| These must happen in this order, as the analysis process is layered - i.e, the empty capillary scan needs the air scan to be processed, the standard sample needs the empty capillary, and therefore the air, and the actual experiment needs all three. Additionally, to save time, we can merge these auxiliary scans together, to avoid queuing up three additional scans for every experiment. For example, experiments can always share an air scan (as it's always the same); empty capillary scans can be shared as long as the temperature range spans the range of the experiment, and the capillary type is the same; and standard sample scans can be shared as long as the capillary type is the same. | ||
|
|
||
| The above requirements lead to the following logic: | ||
|
|
||
| - An experiment will require the three auxiliary scans outlined above, the details of which will be a function of the experiment parameters. See `I151Converter._get_required_auxiliary_scans` | ||
| - An `AuxiliaryScan` has a `requires` field, which details the other required auxiliary scans that must proceed it. The `AuxiliaryScan` objects produced by `I151Converter._get_required_auxiliary_scans` have each other as requirements. The empty capillary scan will be required by the standard sample scan, and the air scan will be required by both the other two. | ||
|
|
||
| To add auxiliary scans, we build a new queue that includes the tasks along with their auxiliary scans. For each task in the queue, we will: | ||
|
|
||
| - Gather the required auxiliary scans | ||
| - For each required auxiliary scan: | ||
| - Check whether a matching auxiliary scan already exists in the queue or tiled. For an existing scan to be considered suitable, all of the required auxiliary scan's own required auxiliary scans must also be required by the existing scan. | ||
| - If a suitable existing does not exist, we will see if we can combine the required auxiliary scan with an existing scan. This, for example, could involve expanding the temperature range of a queued auxiliary scan. Combining these auxiliary scans also combines the requirements of both scans, so no requirement information is lost, but we also don't duplicate similar requirements. We then go to the beginning of this checklist, and repeat for the required auxiliary scans of the combined auxiliary scan, inserting the results before the combined scan in the queue. | ||
| - If we cannot combine the required auxiliary scan, we will add the auxiliary scan to the queue. However, right before we do this, we will go through the required auxiliary scans of the auxiliary scan we added, and repeat this checklist for them. This ensures the auxiliary scan is added behind its requirements. | ||
| - Once all the recursive adding of required auxiliary scans is complete, we add the task itself to the new queue. | ||
|
|
||
|  |
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # i15-1 | ||
|
|
||
| ```{toctree} | ||
| :maxdepth: 1 | ||
| :glob: | ||
|
|
||
| Auxiliary Scans <auxiliary_scans> | ||
| ``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
We only really need to have a requirement of
standard_samplenow, as the others are nested inside it. Should we do that? SimilarlyStandardSampleonly needs to depend onempty_capillary. The advantage of having all of them is that tiled links will be added.