-
Notifications
You must be signed in to change notification settings - Fork 2
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
Correctly pass parameters through all of Hyperion's UDC parameters #746
Changes from 4 commits
53f0d07
8aadf2e
e240023
8648ef4
5bf4f72
b7ac4e7
1aa242e
2d6ea49
dbc2371
d3a6ea2
2945a54
b6716ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from pydantic import BaseModel, Field | ||
from pydantic import Field | ||
|
||
from mx_bluesky.common.parameters.components import WithPandaGridScan | ||
from mx_bluesky.hyperion.external_interaction.config_server import HyperionFeatureFlags | ||
|
||
|
||
class WithHyperionFeatures(BaseModel): | ||
class WithHyperionUDCFeatures(WithPandaGridScan): | ||
features: HyperionFeatureFlags = Field(default=HyperionFeatureFlags()) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from pydantic import Field | ||
|
||
from mx_bluesky.common.parameters.constants import HardwareConstants | ||
from mx_bluesky.common.parameters.robot_load import ( | ||
RobotLoadAndEnergyChange, | ||
RobotLoadThenCentre, | ||
) | ||
from mx_bluesky.hyperion.parameters.components import WithHyperionUDCFeatures | ||
from mx_bluesky.hyperion.parameters.gridscan import HyperionPinTipCentreThenXrayCentre | ||
|
||
|
||
class HyperionRobotLoadThenCentre(RobotLoadThenCentre, WithHyperionUDCFeatures): | ||
thawing_time: float = Field(default=HardwareConstants.THAWING_TIME) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
tip_offset_um: float = Field(default=HardwareConstants.TIP_OFFSET_UM) | ||
|
||
def robot_load_params(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can these methods have annotations? That way tooling can help more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be properties? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes to annotations! I'll make them properties as that's probably more consistent with the other params |
||
my_params = self.model_dump() | ||
return RobotLoadAndEnergyChange(**my_params) | ||
|
||
def pin_centre_then_xray_centre_params(self): | ||
my_params = self.model_dump() | ||
del my_params["thawing_time"] | ||
return HyperionPinTipCentreThenXrayCentre(**my_params) |
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.
Discussed with @rtuck99 - we're so far off any non-hyperion beamlines doing anything other than a grid scan, it's probably good to get rid of some of the common parameters like this one