Skip to content

Set aperture according to XRC results#1705

Open
rtuck99 wants to merge 36 commits into
mainfrom
561_set_aperture_from_xrc_results
Open

Set aperture according to XRC results#1705
rtuck99 wants to merge 36 commits into
mainfrom
561_set_aperture_from_xrc_results

Conversation

@rtuck99
Copy link
Copy Markdown
Contributor

@rtuck99 rtuck99 commented Apr 22, 2026

Fixes

Link to dodal PR (if required): #XXX
(remember to update pyproject.toml with the dodal commit tag if you need it for tests to pass!)

For single-sample pins, the aperture is now selected according to the crystal size detected in XRC, if the crystal is larger than 1 box (20um) then the large aperture is selected, otherwise the medium aperture is selected.

The previous code in change_aperture_then_move_plan.py has been removed as it was never used.

For multisample pins, the large aperture is always selected.

This introduces changes to the parameter model whereby the type of selected_aperture is changed from ApertureValue (an enum defined by the dodal ApertureScatterguard device) to AperturePolicy.

These changes should be non-breaking for plans called via blueapi; SMALL, MEDIUM and LARGE values have the same json representation. However for plan implementations using this enum via DiffractionExperiment subclasses in the parameter model these must now explicitly map AperturePolicy to ApertureValue. There are the following changes:

  • AperturePolicy does not have the OUT_OF_BEAM or PARKED values as these are not useful for experiment plans
  • AperturePolicy has the additional values AUTO and CURRENT_POSITION, for plans where the aperture position is determined automatically (as in Hyperion UDC) and for plans which may opt to execute from the aperture's currently selected position (this may be useful for commissioning plans and for plans which are e.g. executed as part of GDA operation where aperture selection is managed externally)
  • The default value for selected_aperture in DiffractionExperiment is AUTO. None is no longer a valid value.
  • selected_aperture defaults in DiffractionExperiment are no longer overridden in subclasses. The intention is that where AUTO is selected, it will be resolved to one of the physical aperture sizes in the relevant part of the plan.

Instructions to reviewer on how to test:

  1. Do thing x
  2. Confirm thing y happens

Checks for reviewer

  • Would the PR title make sense to a user on a set of release notes

@rtuck99 rtuck99 added the hyperion Issues for Hyperion, the Bluesky UDC stack label Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 93.81443% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.71%. Comparing base (751294c) to head (43043b9).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           27_3_26_fix_system_tests    #1705      +/-   ##
============================================================
- Coverage                     92.83%   92.71%   -0.13%     
============================================================
  Files                           155      156       +1     
  Lines                          8545     8590      +45     
============================================================
+ Hits                           7933     7964      +31     
- Misses                          612      626      +14     
Components Coverage Δ
i24 SSX 77.15% <ø> (ø)
hyperion 98.58% <100.00%> (-0.07%) ⬇️
other 98.00% <89.09%> (-0.31%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

rtuck99 and others added 26 commits April 28, 2026 14:58
…nfig server fixture

now sets the URL env var
@rtuck99 rtuck99 force-pushed the 27_3_26_fix_system_tests branch from 6d2126e to cbfd727 Compare April 28, 2026 15:03
@rtuck99 rtuck99 force-pushed the 561_set_aperture_from_xrc_results branch from 1c41985 to 87e3e7b Compare April 28, 2026 16:17
@rtuck99 rtuck99 marked this pull request as ready for review April 28, 2026 16:17
@rtuck99 rtuck99 requested a review from a team as a code owner April 28, 2026 16:17
@rtuck99 rtuck99 force-pushed the 561_set_aperture_from_xrc_results branch from 87e3e7b to 43043b9 Compare April 28, 2026 16:25
Base automatically changed from 27_3_26_fix_system_tests to main May 15, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hyperion Issues for Hyperion, the Bluesky UDC stack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants