Skip to content

Fix: hyperion-supervisor unable to serialize load centre collect#1575

Open
rtuck99 wants to merge 7 commits intomainfrom
1564_unable_to_serialize_load_centre_collect
Open

Fix: hyperion-supervisor unable to serialize load centre collect#1575
rtuck99 wants to merge 7 commits intomainfrom
1564_unable_to_serialize_load_centre_collect

Conversation

@rtuck99
Copy link
Contributor

@rtuck99 rtuck99 commented Jan 22, 2026

Fixes #1564

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

hyperion-supervisor should now be able to call the load_centre_collect plan on hyperion-blueapi.

The LoadCentreCollectParams payload replaces the LoadCentreCollect payload and no longer includes the paramter model version or duplicates of internal parameters.

Instructions to reviewer on how to test:

  1. Tests pass

Checks for reviewer

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

@rtuck99 rtuck99 added the bug Something isn't working label Jan 22, 2026
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 99.18033% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.86%. Comparing base (6520e6e) to head (0039c45).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1575      +/-   ##
==========================================
+ Coverage   92.81%   92.86%   +0.04%     
==========================================
  Files         153      156       +3     
  Lines        8642     8698      +56     
==========================================
+ Hits         8021     8077      +56     
  Misses        621      621              
Components Coverage Δ
i24 SSX 78.60% <ø> (ø)
hyperion 98.24% <99.16%> (+0.02%) ⬆️
other 98.23% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from fix_local_system_tests to main January 23, 2026 10:59
@rtuck99 rtuck99 force-pushed the 1564_unable_to_serialize_load_centre_collect branch from 8309bf7 to bec094d Compare January 23, 2026 11:02
@rtuck99 rtuck99 marked this pull request as ready for review January 23, 2026 11:17
@rtuck99 rtuck99 requested a review from a team as a code owner January 23, 2026 11:17
Copy link
Contributor

@jacob720 jacob720 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a couple of comments. I like this, it's generally cleaner but I think we need to pair it with removing some more of the old cruft. For example, I think we could probably remove MxBlueskyParameters as part of this PR. Alternatively we can do it in #1532 but that's starting to get a massive job

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could: At the moment we don't support a different rotation energy but this implies we do. Given these are the external facing params they probably should be as clean as possible. Could we remove this from here and just set it to the XRC one in the converter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be the other way round surely? They agamemnon isn't specifying the centring parameters, as the XRC is incidental and the rotation is what they are interested in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in person, answer is to add energy into the top level of LoadCentreCollectParams only

"sample_pin": agamemnon_params["sample"]["position"],
"select_centres": {
"name": "TopNByMaxCount",
"n": pin_type.expected_number_of_crystals,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must: select_centres seems to be missing from LoadCentreCollectParams? I think we need to specify at least the n (at the moment we only ever use the one selection strategy so I don't think we need to specify that). More worrying is why a test didn't catch this given that we should be forbidding extra fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's there, imported via WithCentreSelection, which is perhaps a bit of a cheat, I didn't want to duplicate that hierarchy here. Perhaps I should move those into the same package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, maybe that's ok then. It just wasn't obvious as everything else in that file is a clean slate

Comment on lines +15 to 22
class UDCDefaultState(BaseModel):
"""Represents an instruction to execute the UDC default state plan."""

pass


class UDCCleanup(MxBlueskyParameters):
class UDCCleanup(BaseModel):
"""Represents an instruction to perform UDC Cleanup,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: In collect() we're still passing in a parameter_model_version for both of these, which seems unnecessary.

@rtuck99 rtuck99 force-pushed the 1564_unable_to_serialize_load_centre_collect branch from bec094d to f3f5618 Compare January 30, 2026 11:25
@rtuck99 rtuck99 requested a review from DominicOram February 3, 2026 15:48
@rtuck99 rtuck99 force-pushed the 1564_unable_to_serialize_load_centre_collect branch 4 times, most recently from 5d36493 to 7ce4cfc Compare February 16, 2026 17:18
@rtuck99 rtuck99 force-pushed the 1564_unable_to_serialize_load_centre_collect branch from de3afa6 to 0039c45 Compare February 18, 2026 11:05
@rtuck99 rtuck99 changed the title 1564 unable to serialize load centre collect Fix: hyperion-supervisor unable to serialize load centre collect Feb 18, 2026
@rtuck99 rtuck99 added the hyperion Issues for Hyperion, the Bluesky UDC stack label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hyperion Issues for Hyperion, the Bluesky UDC stack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hyperion-supervisor cannot run load_centre_collect unable to serialize parameter_model_version

3 participants

Comments