Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
(#1406) Remove detector string from params
Browse files Browse the repository at this point in the history
  • Loading branch information
rtuck99 committed May 29, 2024
1 parent 72bb328 commit 5ab57db
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 29 deletions.
1 change: 0 additions & 1 deletion src/hyperion/parameters/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/hyperion/parameters/gridscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
WithScan,
XyzStarts,
)
from hyperion.parameters.constants import CONST
from hyperion.parameters.constants import CONST, I03Constants


class GridCommon(
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -118,19 +115,14 @@ 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,
):
assert (
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -101,19 +96,14 @@ 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,
):
assert (
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,
Expand Down

0 comments on commit 5ab57db

Please sign in to comment.