diff --git a/src/hyperion/parameters/components.py b/src/hyperion/parameters/components.py index dfc0fa8ce..b8885e139 100644 --- a/src/hyperion/parameters/components.py +++ b/src/hyperion/parameters/components.py @@ -152,7 +152,6 @@ class DiffractionExperiment(HyperionParameters): default=CONST.PARAM.DETECTOR.BEAM_XY_LUT_PATH ) zocalo_environment: str = Field(default=CONST.ZOCALO_ENV) - detector: str = Field(default=CONST.I03.DETECTOR) trigger_mode: TriggerMode = Field(default=TriggerMode.FREE_RUN) detector_distance_mm: float | None = Field(default=None, gt=0) demand_energy_ev: float | None = Field(default=None, gt=0) diff --git a/src/hyperion/parameters/gridscan.py b/src/hyperion/parameters/gridscan.py index bff47c574..ec345f34d 100644 --- a/src/hyperion/parameters/gridscan.py +++ b/src/hyperion/parameters/gridscan.py @@ -25,7 +25,7 @@ WithScan, XyzStarts, ) -from hyperion.parameters.constants import CONST +from hyperion.parameters.constants import CONST, I03Constants class GridCommon( @@ -73,7 +73,7 @@ def detector_params(self): ), "Detector distance must be filled before generating DetectorParams" os.makedirs(self.storage_directory, exist_ok=True) return DetectorParams( - detector_size_constants=self.detector, # type: ignore # Will be cleaned up in #1307 + detector_size_constants=I03Constants.DETECTOR, expected_energy_ev=self.demand_energy_ev, exposure_time=self.exposure_time_s, directory=self.storage_directory, diff --git a/tests/test_data/parameter_json_files/good_test_grid_with_edge_detect_parameters.json b/tests/test_data/parameter_json_files/good_test_grid_with_edge_detect_parameters.json index 7084cdf39..e6492a1d8 100644 --- a/tests/test_data/parameter_json_files/good_test_grid_with_edge_detect_parameters.json +++ b/tests/test_data/parameter_json_files/good_test_grid_with_edge_detect_parameters.json @@ -2,7 +2,6 @@ "parameter_model_version": "5.0.0", "beamline": "BL03S", "insertion_prefix": "SR03S", - "detector": "EIGER2_X_16M", "zocalo_environment": "devrmq", "storage_directory": "/tmp", "file_name": "file_name", diff --git a/tests/test_data/parameter_json_files/good_test_pin_centre_then_xray_centre_parameters.json b/tests/test_data/parameter_json_files/good_test_pin_centre_then_xray_centre_parameters.json index 9aaf5ad10..e0c67f70d 100644 --- a/tests/test_data/parameter_json_files/good_test_pin_centre_then_xray_centre_parameters.json +++ b/tests/test_data/parameter_json_files/good_test_pin_centre_then_xray_centre_parameters.json @@ -2,7 +2,6 @@ "parameter_model_version": "5.0.0", "beamline": "BL03S", "insertion_prefix": "SR03S", - "detector": "EIGER2_X_16M", "zocalo_environment": "devrmq", "storage_directory": "/tmp", "file_name": "file_name", diff --git a/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters.json b/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters.json index b05a6f97f..2e728e688 100644 --- a/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters.json +++ b/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters.json @@ -4,7 +4,6 @@ "det_dist_to_beam_converter_path": "tests/test_data/test_lookup_table.txt", "storage_directory": "/tmp/dls/i03/data/2024/cm31105-4/auto/123456/", "detector_distance_mm": 100.0, - "detector": "EIGER2_X_16M", "demand_energy_ev": 100, "exposure_time_s": 0.1, "insertion_prefix": "SR03S", diff --git a/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters_nomove.json b/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters_nomove.json index ae9a36940..a655bcaaa 100644 --- a/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters_nomove.json +++ b/tests/test_data/parameter_json_files/good_test_rotation_scan_parameters_nomove.json @@ -4,7 +4,6 @@ "det_dist_to_beam_converter_path": "tests/test_data/test_lookup_table.txt", "storage_directory": "/tmp/dls/i03/data/2024/cm31105-4/auto/123456/", "detector_distance_mm": 100.0, - "detector": "EIGER2_X_16M", "demand_energy_ev": 100, "exposure_time_s": 0.1, "insertion_prefix": "SR03S", diff --git a/tests/test_data/parameter_json_files/ispyb_gridscan_system_test_parameters.json b/tests/test_data/parameter_json_files/ispyb_gridscan_system_test_parameters.json index d34ff020e..c93653c42 100644 --- a/tests/test_data/parameter_json_files/ispyb_gridscan_system_test_parameters.json +++ b/tests/test_data/parameter_json_files/ispyb_gridscan_system_test_parameters.json @@ -2,7 +2,6 @@ "parameter_model_version": "5.0.0", "beamline": "BL03S", "insertion_prefix": "SR03S", - "detector": "EIGER2_X_16M", "zocalo_environment": "dev_artemis", "storage_directory": "/tmp", "file_name": "file_name", diff --git a/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py b/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py index 9e40bae03..e2063f093 100644 --- a/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py +++ b/tests/unit_tests/experiment_plans/test_flyscan_xray_centre_plan.py @@ -12,8 +12,6 @@ from dodal.beamlines import i03 from dodal.common.beamlines.beamline_utils import clear_device from dodal.devices.detector.det_dim_constants import ( - EIGER2_X_4M_DIMENSION, - EIGER_TYPE_EIGER2_X_4M, EIGER_TYPE_EIGER2_X_16M, ) from dodal.devices.fast_grid_scan import FastGridScan @@ -63,7 +61,6 @@ from hyperion.parameters.gridscan import ThreeDGridScan from tests.conftest import create_dummy_scan_spec -from ...conftest import default_raw_params from ...system_tests.external_interaction.conftest import ( TEST_RESULT_LARGE, TEST_RESULT_MEDIUM, @@ -120,7 +117,7 @@ def mock_ispyb(): class TestFlyscanXrayCentrePlan: td: TestData = TestData() - def test_given_full_parameters_dict_when_detector_name_used_and_converted_then_detector_constants_correct( + def test_eiger2_x_16_detector_specified( self, test_fgs_params: ThreeDGridScan, ): @@ -128,11 +125,6 @@ def test_given_full_parameters_dict_when_detector_name_used_and_converted_then_d test_fgs_params.detector_params.detector_size_constants.det_type_string == EIGER_TYPE_EIGER2_X_16M ) - raw_params_dict = default_raw_params() - raw_params_dict["detector"] = EIGER_TYPE_EIGER2_X_4M - params: ThreeDGridScan = ThreeDGridScan(**raw_params_dict) - det_dimension = params.detector_params.detector_size_constants.det_dimension - assert det_dimension == EIGER2_X_4M_DIMENSION def test_when_run_gridscan_called_then_generator_returned( self, diff --git a/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py b/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py index 830e129ad..fb48431d9 100644 --- a/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py +++ b/tests/unit_tests/experiment_plans/test_panda_flyscan_xray_centre_plan.py @@ -8,11 +8,7 @@ import pytest from bluesky.run_engine import RunEngine from bluesky.utils import Msg -from dodal.devices.detector.det_dim_constants import ( - EIGER2_X_4M_DIMENSION, - EIGER_TYPE_EIGER2_X_4M, - EIGER_TYPE_EIGER2_X_16M, -) +from dodal.devices.detector.det_dim_constants import EIGER_TYPE_EIGER2_X_16M from dodal.devices.panda_fast_grid_scan import PandAFastGridScan from dodal.devices.synchrotron import SynchrotronMode from ophyd.sim import make_fake_device @@ -53,7 +49,6 @@ from hyperion.parameters.constants import CONST from hyperion.parameters.gridscan import ThreeDGridScan -from ...conftest import default_raw_params from ...system_tests.external_interaction.conftest import ( TEST_RESULT_LARGE, TEST_RESULT_MEDIUM, @@ -103,7 +98,7 @@ def standalone_read_hardware_for_ispyb( class TestFlyscanXrayCentrePlan: td: TestData = TestData() - def test_given_full_parameters_dict_when_detector_name_used_and_converted_then_detector_constants_correct( + def test_eiger2_x_16_detector_specified( self, test_panda_fgs_params: ThreeDGridScan, ): @@ -111,11 +106,6 @@ def test_given_full_parameters_dict_when_detector_name_used_and_converted_then_d test_panda_fgs_params.detector_params.detector_size_constants.det_type_string == EIGER_TYPE_EIGER2_X_16M ) - raw_params_dict = default_raw_params() - raw_params_dict["detector"] = EIGER_TYPE_EIGER2_X_4M - params: ThreeDGridScan = ThreeDGridScan(**raw_params_dict) - det_dimension = params.detector_params.detector_size_constants.det_dimension - assert det_dimension == EIGER2_X_4M_DIMENSION def test_when_run_gridscan_called_then_generator_returned( self,