diff --git a/src/dodal/plan_stubs/__init__.py b/src/dodal/plan_stubs/__init__.py index be28526889..5519ae3e28 100644 --- a/src/dodal/plan_stubs/__init__.py +++ b/src/dodal/plan_stubs/__init__.py @@ -2,12 +2,14 @@ from .data_session_metadata import attach_data_session_metadata_decorator from .motor_util_plans import ( MoveTooLarge, + check_and_cache_values, home_and_reset_decorator, home_and_reset_wrapper, move_and_reset_wrapper, ) __all__ = [ + "check_and_cache_values", "check_topup_and_wait_if_necessary", "wait_for_topup_complete", "attach_data_session_metadata_decorator", diff --git a/src/dodal/plan_stubs/motor_util_plans.py b/src/dodal/plan_stubs/motor_util_plans.py index 80d0e93611..5033f1c7fd 100644 --- a/src/dodal/plan_stubs/motor_util_plans.py +++ b/src/dodal/plan_stubs/motor_util_plans.py @@ -23,7 +23,7 @@ def __init__( super().__init__(*args) -def _check_and_cache_values( +def check_and_cache_values( devices_and_positions: dict[AnyDevice, float], smallest_move: float, maximum_move: float, @@ -87,7 +87,7 @@ def move_and_reset_wrapper( on. If false it is left up to the caller to wait on them. Defaults to True. """ - initial_positions = yield from _check_and_cache_values( + initial_positions = yield from check_and_cache_values( device_and_positions, smallest_move, maximum_move ) diff --git a/tests/plans/test_motor_util_plans.py b/tests/plan_stubs/test_motor_util_plans.py similarity index 96% rename from tests/plans/test_motor_util_plans.py rename to tests/plan_stubs/test_motor_util_plans.py index dc4a761ca2..bd758f4b59 100644 --- a/tests/plans/test_motor_util_plans.py +++ b/tests/plan_stubs/test_motor_util_plans.py @@ -14,9 +14,9 @@ from ophyd_async.epics.motor import Motor from dodal.devices.util.test_utils import patch_motor -from dodal.plans.motor_util_plans import ( +from dodal.plan_stubs import ( MoveTooLarge, - _check_and_cache_values, + check_and_cache_values, home_and_reset_wrapper, ) @@ -80,7 +80,7 @@ def test_given_a_device_when_check_and_cache_values_then_motor_values_returned( set_mock_value(motor.user_readback, i * 100) motors_and_positions: dict[Motor, float] = RE( - _check_and_cache_values( + check_and_cache_values( {motor_obj: 0.0 for motor_obj in my_device.motors}, 0, 1000 ) ).plan_result # type: ignore @@ -109,7 +109,7 @@ def test_given_a_device_with_a_too_large_move_when_check_and_cache_values_then_e motors_and_positions = {motor_obj: new_position for motor_obj in my_device.motors} with pytest.raises(MoveTooLarge) as e: - RE(_check_and_cache_values(motors_and_positions, 0, max)) + RE(check_and_cache_values(motors_and_positions, 0, max)) assert e.value.axis == my_device.y assert e.value.maximum_move == max @@ -136,7 +136,7 @@ def test_given_a_device_where_one_move_too_small_when_check_and_cache_values_the } motors_and_positions: dict[Motor, float] = RE( - _check_and_cache_values(motors_and_new_positions, min, 1000) + check_and_cache_values(motors_and_new_positions, min, 1000) ).plan_result # type: ignore cached_positions = motors_and_positions.values() @@ -156,7 +156,7 @@ def test_given_a_device_where_all_moves_too_small_when_check_and_cache_values_th motors_and_new_positions = {motor_obj: 0.0 for motor_obj in my_device.motors} motors_and_positions: dict[Motor, float] = RE( - _check_and_cache_values(motors_and_new_positions, 40, 1000) + check_and_cache_values(motors_and_new_positions, 40, 1000) ).plan_result # type: ignore cached_positions = motors_and_positions.values() diff --git a/tests/plans/test_topup_plan.py b/tests/plan_stubs/test_topup_plan.py similarity index 99% rename from tests/plans/test_topup_plan.py rename to tests/plan_stubs/test_topup_plan.py index 2b9fcce512..4838a0c4b0 100644 --- a/tests/plans/test_topup_plan.py +++ b/tests/plan_stubs/test_topup_plan.py @@ -7,7 +7,7 @@ from dodal.beamlines import i03 from dodal.devices.synchrotron import Synchrotron, SynchrotronMode -from dodal.plans.check_topup import ( +from dodal.plan_stubs import ( check_topup_and_wait_if_necessary, wait_for_topup_complete, )