Skip to content

Commit

Permalink
(DiamondLightSource/hyperion#1169) remove test feature flags from dod…
Browse files Browse the repository at this point in the history
…al (#682)
  • Loading branch information
rtuck99 authored Jul 23, 2024
1 parent 025efb0 commit 8ae0343
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
15 changes: 5 additions & 10 deletions src/dodal/devices/eiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

FREE_RUN_MAX_IMAGES = 1000000

# TODO present for testing purposes, remove
TEST_1169_FIX = True
TEST_1169_INJECT = False


class InternalEigerTriggerMode(Enum):
INTERNAL_SERIES = 0
Expand Down Expand Up @@ -101,7 +97,7 @@ def wait_on_arming_if_started(self):

def stage(self):
self.wait_on_arming_if_started()
if TEST_1169_INJECT or not self.is_armed():
if not self.is_armed():
LOGGER.info("Eiger not armed, arming")

self.async_stage().wait(timeout=self.ARMING_TIMEOUT)
Expand Down Expand Up @@ -341,6 +337,10 @@ def do_arming_chain(self) -> Status:
functions_to_do_arm.append(self.enable_roi_mode)

arming_sequence_funcs = [
# If a beam dump occurs after arming the eiger but prior to eiger staging,
# the odin may timeout which will cause the arming sequence to be retried;
# if this previously completed successfully we must reset the odin first
self.odin.stop,
lambda: self.change_dev_shm(detector_params.enable_dev_shm),
lambda: self.set_detector_threshold(detector_params.expected_energy_ev),
self.set_cam_pvs,
Expand All @@ -354,11 +354,6 @@ def do_arming_chain(self) -> Status:
self._wait_fan_ready,
self._finish_arm,
]
if TEST_1169_FIX:
# If a beam dump occurs after arming the eiger but prior to eiger staging,
# the odin may timeout which will cause the arming sequence to be retried;
# if this previously completed successfully we must reset the odin first
arming_sequence_funcs.insert(0, self.odin.stop)

functions_to_do_arm.extend(arming_sequence_funcs)

Expand Down
4 changes: 1 addition & 3 deletions tests/devices/unit_tests/test_eiger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from dodal.devices.detector import DetectorParams, TriggerMode
from dodal.devices.detector.det_dim_constants import EIGER2_X_16M_SIZE
from dodal.devices.eiger import TEST_1169_FIX, EigerDetector
from dodal.devices.eiger import EigerDetector
from dodal.devices.status import await_value
from dodal.devices.util.epics_util import run_functions_without_blocking
from dodal.log import LOGGER
Expand All @@ -31,8 +31,6 @@
TEST_USE_ROI_MODE = False
TEST_DET_DIST_TO_BEAM_CONVERTER_PATH = "tests/devices/unit_tests/test_lookup_table.txt"

TEST_1169_FIX = True


class StatusException(Exception):
pass
Expand Down

0 comments on commit 8ae0343

Please sign in to comment.