diff --git a/src/mx_bluesky/hyperion/parameters/gridscan.py b/src/mx_bluesky/hyperion/parameters/gridscan.py index 9d1159e25..0f8dc569f 100644 --- a/src/mx_bluesky/hyperion/parameters/gridscan.py +++ b/src/mx_bluesky/hyperion/parameters/gridscan.py @@ -44,15 +44,6 @@ class GridCommon( ) selected_aperture: ApertureValue | None = Field(default=ApertureValue.SMALL) - # @model_validator(mode="wrap") - # @classmethod - # def set_default_feature_flags(cls, values, handler) -> Any: - # if "use_panda" not in values: - # values["use_panda"] = cls.features.best_effort().use_panda_for_gridscan - # if "use_gpu" not in values: - # values["use_gpu"] = cls.features.best_effort().use_gpu_for_gridscan - # return values - @model_validator(mode="before") @classmethod def set_default_feature_flags(cls, values) -> Any: diff --git a/tests/unit_tests/hyperion/parameters/test_parameter_model.py b/tests/unit_tests/hyperion/parameters/test_parameter_model.py index 9f0c670c5..403acff03 100644 --- a/tests/unit_tests/hyperion/parameters/test_parameter_model.py +++ b/tests/unit_tests/hyperion/parameters/test_parameter_model.py @@ -121,3 +121,14 @@ def test_selected_aperture_uses_default(): raw_params["selected_aperture"] = None params = RotationScan(**raw_params) assert params.selected_aperture == ApertureValue.LARGE + + +def test_feature_flags_overriden_if_supplied(minimal_3d_gridscan_params): + test_params = ThreeDGridScan(**minimal_3d_gridscan_params) + assert test_params.use_panda is False + assert test_params.use_gpu is False + minimal_3d_gridscan_params["use_panda"] = True + minimal_3d_gridscan_params["use_gpu"] = True + test_params = ThreeDGridScan(**minimal_3d_gridscan_params) + assert test_params.use_gpu + assert test_params.use_panda