diff --git a/deploy/deploy_edm_for_ssx.sh b/deploy/deploy_edm_for_ssx.sh index 3aed52d0c..cbf44b067 100755 --- a/deploy/deploy_edm_for_ssx.sh +++ b/deploy/deploy_edm_for_ssx.sh @@ -24,7 +24,7 @@ mkdir $ex_edm mkdir $ft_edm scripts_placeholder="SCRIPTS_LOCATION" -scripts_loc="$base/src/mx_bluesky/I24/serial" +scripts_loc="$base/src/mx_bluesky/i24/serial" # Add blueapi configuration file to get stomp # See https://github.com/DiamondLightSource/blueapi/issues/485 diff --git a/docs/developer/serial-crystallography-on-i24/how-to/environment-setup.rst b/docs/developer/serial-crystallography-on-i24/how-to/environment-setup.rst index ad3481c45..bc6675f2d 100644 --- a/docs/developer/serial-crystallography-on-i24/how-to/environment-setup.rst +++ b/docs/developer/serial-crystallography-on-i24/how-to/environment-setup.rst @@ -37,7 +37,7 @@ point to the current visit and then running the command: .. code:: bash - ./path/to/mx_bluesky/src/mx_bluesky/I24/serial/set_visit_directory.sh + ./path/to/mx_bluesky/src/mx_bluesky/i24/serial/set_visit_directory.sh Note that the default experiment type for the script setting the directory will be ``fixed-target``. In case of an extruder collection, @@ -46,5 +46,5 @@ the command line. .. code:: bash - ./path/to/mx_bluesky/src/mx_bluesky/I24/serial/set_visit_directory.sh extruder + ./path/to/mx_bluesky/src/mx_bluesky/i24/serial/set_visit_directory.sh extruder diff --git a/docs/developer/serial-crystallography-on-i24/how-to/run-a-collection.rst b/docs/developer/serial-crystallography-on-i24/how-to/run-a-collection.rst index ffa72b3df..8679f5711 100644 --- a/docs/developer/serial-crystallography-on-i24/how-to/run-a-collection.rst +++ b/docs/developer/serial-crystallography-on-i24/how-to/run-a-collection.rst @@ -12,7 +12,7 @@ A couple of entry points have been set up so that: Before opening the experiment specific edm, each of these entry points will start a ``BlueAPI`` server. The configuration used by ``BlueAPI`` -is saved in ``src/mx_bluesky/I24/serial/blueapi_config.yaml``. +is saved in ``src/mx_bluesky/i24/serial/blueapi_config.yaml``. Detector choice =============== @@ -75,7 +75,7 @@ set up the coordinate system. Before this step remember to reset the scale and skew factors as well as the motor directions as needed. Current values are saved in -``src/mx_bluesky/I24/serial/parameters/fixed_target`` in the +``src/mx_bluesky/i24/serial/parameters/fixed_target`` in the ``cs_maker.json`` and ``motor_direction.txt`` files. 1. From the main edm screen open the ``viewer`` and ``moveonclick``. diff --git a/docs/developer/serial-crystallography-on-i24/how-to/stage-pmac-moves.rst b/docs/developer/serial-crystallography-on-i24/how-to/stage-pmac-moves.rst index dc68b96d8..52d9f5375 100644 --- a/docs/developer/serial-crystallography-on-i24/how-to/stage-pmac-moves.rst +++ b/docs/developer/serial-crystallography-on-i24/how-to/stage-pmac-moves.rst @@ -81,8 +81,8 @@ Theory for this computation The plan needs information stored in a few files: -* The motor directions are stored in ``src/mx_bluesky/I24/serial/parameters/fixed_target/cs/motor_directions.txt.`` The motor number multiplied by the motor direction should give the positive chip direction. -* The scale values for x,y,z, the skew value and the sign of Sx, Sy, Sz are all stored in ``src/mx_bluesky/I24/serial/parameters/fixed_target/cs/cs_maker.json`` +* The motor directions are stored in ``src/mx_bluesky/i24/serial/parameters/fixed_target/cs/motor_directions.txt.`` The motor number multiplied by the motor direction should give the positive chip direction. +* The scale values for x,y,z, the skew value and the sign of Sx, Sy, Sz are all stored in ``src/mx_bluesky/i24/serial/parameters/fixed_target/cs/cs_maker.json`` * The fiducials 1 and 2 positions are written to file when selecting the fiducials (Setting fiducial 0 instead sends a homing command directly to the pmac_string PV) NOTE. The ``motor_direction.txt`` and ``cs_maker.json`` files should diff --git a/pyproject.toml b/pyproject.toml index b54281d47..3368d988c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "requests", "opencv-python", "pydantic", - "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@main", + "dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@7e01eeaf18046eadf4d513c79b06e0a11d616776", "fastapi[all]<0.99", "blueapi @ git+https://github.com/DiamondLightSource/blueapi.git@main", ] @@ -51,8 +51,8 @@ dev = [ [project.scripts] mx_bluesky = "mx_bluesky.__main__:main" -run_extruder = "mx_bluesky.I24.serial.run_serial:run_extruder" -run_fixed_target = "mx_bluesky.I24.serial.run_serial:run_fixed_target" +run_extruder = "mx_bluesky.i24.serial.run_serial:run_extruder" +run_fixed_target = "mx_bluesky.i24.serial.run_serial:run_fixed_target" [project.urls] GitHub = "https://github.com/DiamondLightSource/mx_bluesky" diff --git a/src/mx_bluesky/I24/__init__.py b/src/mx_bluesky/i24/__init__.py similarity index 100% rename from src/mx_bluesky/I24/__init__.py rename to src/mx_bluesky/i24/__init__.py diff --git a/src/mx_bluesky/I24/serial/__init__.py b/src/mx_bluesky/i24/serial/__init__.py similarity index 100% rename from src/mx_bluesky/I24/serial/__init__.py rename to src/mx_bluesky/i24/serial/__init__.py diff --git a/src/mx_bluesky/I24/serial/blueapi_config.yaml b/src/mx_bluesky/i24/serial/blueapi_config.yaml similarity index 84% rename from src/mx_bluesky/I24/serial/blueapi_config.yaml rename to src/mx_bluesky/i24/serial/blueapi_config.yaml index 1d325aa6f..304352360 100644 --- a/src/mx_bluesky/I24/serial/blueapi_config.yaml +++ b/src/mx_bluesky/i24/serial/blueapi_config.yaml @@ -3,7 +3,7 @@ env: - kind: dodal module: dodal.beamlines.i24 - kind: planFunctions - module: mx_bluesky.I24.serial + module: mx_bluesky.i24.serial events: broadcast_status_events: False api: diff --git a/src/mx_bluesky/I24/serial/dcid.py b/src/mx_bluesky/i24/serial/dcid.py similarity index 99% rename from src/mx_bluesky/I24/serial/dcid.py rename to src/mx_bluesky/i24/serial/dcid.py index cc8e258dd..db86e83b1 100644 --- a/src/mx_bluesky/I24/serial/dcid.py +++ b/src/mx_bluesky/i24/serial/dcid.py @@ -10,8 +10,8 @@ import requests -from mx_bluesky.I24.serial.parameters import SSXType -from mx_bluesky.I24.serial.setup_beamline import ( +from mx_bluesky.i24.serial.parameters import SSXType +from mx_bluesky.i24.serial.setup_beamline import ( Detector, Eiger, Pilatus, diff --git a/src/mx_bluesky/I24/serial/extruder/EX-gui-edm/DetStage.edl b/src/mx_bluesky/i24/serial/extruder/EX-gui-edm/DetStage.edl similarity index 100% rename from src/mx_bluesky/I24/serial/extruder/EX-gui-edm/DetStage.edl rename to src/mx_bluesky/i24/serial/extruder/EX-gui-edm/DetStage.edl diff --git a/src/mx_bluesky/I24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl b/src/mx_bluesky/i24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl similarity index 100% rename from src/mx_bluesky/I24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl rename to src/mx_bluesky/i24/serial/extruder/EX-gui-edm/DiamondExtruder-I24-py3v1.edl diff --git a/src/mx_bluesky/I24/serial/extruder/EX-gui-edm/microdrop_alignment.edl b/src/mx_bluesky/i24/serial/extruder/EX-gui-edm/microdrop_alignment.edl similarity index 100% rename from src/mx_bluesky/I24/serial/extruder/EX-gui-edm/microdrop_alignment.edl rename to src/mx_bluesky/i24/serial/extruder/EX-gui-edm/microdrop_alignment.edl diff --git a/src/mx_bluesky/I24/serial/extruder/__init__.py b/src/mx_bluesky/i24/serial/extruder/__init__.py similarity index 100% rename from src/mx_bluesky/I24/serial/extruder/__init__.py rename to src/mx_bluesky/i24/serial/extruder/__init__.py diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py similarity index 96% rename from src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py rename to src/mx_bluesky/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index 375662ef8..c9b5a50a0 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/i24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -24,20 +24,20 @@ from dodal.devices.i24.beamstop import Beamstop from dodal.devices.i24.dcm import DCM from dodal.devices.i24.dual_backlight import DualBacklight -from dodal.devices.i24.I24_detector_motion import DetectorMotion +from dodal.devices.i24.i24_detector_motion import DetectorMotion from dodal.devices.zebra import DISCONNECT, SOFT_IN3, Zebra -from mx_bluesky.I24.serial import log -from mx_bluesky.I24.serial.dcid import DCID -from mx_bluesky.I24.serial.parameters import ExtruderParameters, SSXType -from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_NAME, PARAM_FILE_PATH -from mx_bluesky.I24.serial.setup_beamline import Pilatus, caget, caput, pv -from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup -from mx_bluesky.I24.serial.setup_beamline.setup_detector import ( +from mx_bluesky.i24.serial import log +from mx_bluesky.i24.serial.dcid import DCID +from mx_bluesky.i24.serial.parameters import ExtruderParameters, SSXType +from mx_bluesky.i24.serial.parameters.constants import PARAM_FILE_NAME, PARAM_FILE_PATH +from mx_bluesky.i24.serial.setup_beamline import Pilatus, caget, caput, pv +from mx_bluesky.i24.serial.setup_beamline import setup_beamline as sup +from mx_bluesky.i24.serial.setup_beamline.setup_detector import ( UnknownDetectorType, get_detector_type, ) -from mx_bluesky.I24.serial.setup_beamline.setup_zebra_plans import ( +from mx_bluesky.i24.serial.setup_beamline.setup_zebra_plans import ( GATE_START, TTL_EIGER, TTL_PILATUS, @@ -49,7 +49,7 @@ setup_zebra_for_extruder_with_pump_probe_plan, setup_zebra_for_quickshot_plan, ) -from mx_bluesky.I24.serial.write_nexus import call_nexgen +from mx_bluesky.i24.serial.write_nexus import call_nexgen usage = "%(prog)s command [options]" logger = logging.getLogger("I24ssx.extruder") diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/DetStage.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/DetStage.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/DetStage.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/DetStage.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/ME14E-GeneralPurpose.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/ME14E-GeneralPurpose.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/ME14E-GeneralPurpose.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/ME14E-GeneralPurpose.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/Shutter_Control.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/Shutter_Control.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/Shutter_Control.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/Shutter_Control.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/microdrop_alignment.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/microdrop_alignment.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/microdrop_alignment.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/microdrop_alignment.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/nudgechip.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/nudgechip.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/nudgechip.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/nudgechip.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/short1-laser.png b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/short1-laser.png similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/short1-laser.png rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/short1-laser.png diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/short2-laser.png b/src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/short2-laser.png similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/short2-laser.png rename to src/mx_bluesky/i24/serial/fixed_target/FT-gui-edm/short2-laser.png diff --git a/src/mx_bluesky/I24/serial/fixed_target/__init__.py b/src/mx_bluesky/i24/serial/fixed_target/__init__.py similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/__init__.py rename to src/mx_bluesky/i24/serial/fixed_target/__init__.py diff --git a/src/mx_bluesky/I24/serial/fixed_target/ft_utils.py b/src/mx_bluesky/i24/serial/fixed_target/ft_utils.py similarity index 100% rename from src/mx_bluesky/I24/serial/fixed_target/ft_utils.py rename to src/mx_bluesky/i24/serial/fixed_target/ft_utils.py diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py similarity index 98% rename from src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py rename to src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 738e83f91..ba2f5a1c6 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -20,30 +20,30 @@ from dodal.devices.i24.beamstop import Beamstop from dodal.devices.i24.dcm import DCM from dodal.devices.i24.dual_backlight import DualBacklight -from dodal.devices.i24.I24_detector_motion import DetectorMotion +from dodal.devices.i24.i24_detector_motion import DetectorMotion from dodal.devices.i24.pmac import PMAC from dodal.devices.zebra import Zebra -from mx_bluesky.I24.serial import log -from mx_bluesky.I24.serial.dcid import DCID -from mx_bluesky.I24.serial.fixed_target.ft_utils import ( +from mx_bluesky.i24.serial import log +from mx_bluesky.i24.serial.dcid import DCID +from mx_bluesky.i24.serial.fixed_target.ft_utils import ( ChipType, MappingType, PumpProbeSetting, ) -from mx_bluesky.I24.serial.parameters import ( +from mx_bluesky.i24.serial.parameters import ( ChipDescription, FixedTargetParameters, SSXType, ) -from mx_bluesky.I24.serial.parameters.constants import ( +from mx_bluesky.i24.serial.parameters.constants import ( LITEMAP_PATH, PARAM_FILE_NAME, PARAM_FILE_PATH_FT, ) -from mx_bluesky.I24.serial.setup_beamline import caget, cagetstring, caput, pv -from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup -from mx_bluesky.I24.serial.setup_beamline.setup_zebra_plans import ( +from mx_bluesky.i24.serial.setup_beamline import caget, cagetstring, caput, pv +from mx_bluesky.i24.serial.setup_beamline import setup_beamline as sup +from mx_bluesky.i24.serial.setup_beamline.setup_zebra_plans import ( SHUTTER_OPEN_TIME, arm_zebra, close_fast_shutter, @@ -52,7 +52,7 @@ reset_zebra_when_collection_done_plan, setup_zebra_for_fastchip_plan, ) -from mx_bluesky.I24.serial.write_nexus import call_nexgen +from mx_bluesky.i24.serial.write_nexus import call_nexgen ABORTED = False diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py similarity index 98% rename from src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py rename to src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 795041e13..697c97e08 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -21,19 +21,19 @@ from dodal.common import inject from dodal.devices.i24.beamstop import Beamstop, BeamstopPositions from dodal.devices.i24.dual_backlight import BacklightPositions, DualBacklight -from dodal.devices.i24.I24_detector_motion import DetectorMotion +from dodal.devices.i24.i24_detector_motion import DetectorMotion from dodal.devices.i24.pmac import PMAC, EncReset, LaserSettings -from mx_bluesky.I24.serial import log -from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_Mapping_py3v1 as mapping -from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_StartUp_py3v1 as startup -from mx_bluesky.I24.serial.fixed_target.ft_utils import ( +from mx_bluesky.i24.serial import log +from mx_bluesky.i24.serial.fixed_target import i24ssx_Chip_Mapping_py3v1 as mapping +from mx_bluesky.i24.serial.fixed_target import i24ssx_Chip_StartUp_py3v1 as startup +from mx_bluesky.i24.serial.fixed_target.ft_utils import ( ChipType, Fiducials, MappingType, ) -from mx_bluesky.I24.serial.parameters import get_chip_format -from mx_bluesky.I24.serial.parameters.constants import ( +from mx_bluesky.i24.serial.parameters import get_chip_format +from mx_bluesky.i24.serial.parameters.constants import ( CS_FILES_PATH, FULLMAP_PATH, LITEMAP_PATH, @@ -41,8 +41,8 @@ PARAM_FILE_PATH_FT, PVAR_FILE_PATH, ) -from mx_bluesky.I24.serial.setup_beamline import Pilatus, caget, caput, pv -from mx_bluesky.I24.serial.setup_beamline.setup_detector import get_detector_type +from mx_bluesky.i24.serial.setup_beamline import Pilatus, caget, caput, pv +from mx_bluesky.i24.serial.setup_beamline.setup_detector import get_detector_type logger = logging.getLogger("I24ssx.chip_manager") @@ -772,7 +772,7 @@ def cs_maker(pmac: PMAC = inject("pmac")) -> MsgGenerator: Values for scalex, scaley, scalez, and skew, as well as the sign of Sx, Sy, Sz are stored in a .json file and should be modified there. - Location of file: src/mx_bluesky/I24/serial/parameters/cs_maker.json + Location of file: src/mx_bluesky/i24/serial/parameters/cs_maker.json Theory Rx: rotation about X-axis, pitch diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py similarity index 94% rename from src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py rename to src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py index 117742f30..2ca4a23c9 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py +++ b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py @@ -10,17 +10,17 @@ import numpy as np from matplotlib import pyplot as plt -from mx_bluesky.I24.serial import log -from mx_bluesky.I24.serial.fixed_target.ft_utils import ChipType -from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( +from mx_bluesky.i24.serial import log +from mx_bluesky.i24.serial.fixed_target.ft_utils import ChipType +from mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( check_files, get_shot_order, get_xy, read_parameter_file, write_file, ) -from mx_bluesky.I24.serial.parameters import get_chip_format -from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_PATH_FT +from mx_bluesky.i24.serial.parameters import get_chip_format +from mx_bluesky.i24.serial.parameters.constants import PARAM_FILE_PATH_FT logger = logging.getLogger("I24ssx.chip_mapping") diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py similarity index 97% rename from src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py rename to src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py index f23631293..1ab0cf092 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py +++ b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py @@ -11,10 +11,10 @@ import numpy as np -from mx_bluesky.I24.serial import log -from mx_bluesky.I24.serial.fixed_target.ft_utils import ChipType -from mx_bluesky.I24.serial.parameters import FixedTargetParameters, get_chip_format -from mx_bluesky.I24.serial.parameters.constants import ( +from mx_bluesky.i24.serial import log +from mx_bluesky.i24.serial.fixed_target.ft_utils import ChipType +from mx_bluesky.i24.serial.parameters import FixedTargetParameters, get_chip_format +from mx_bluesky.i24.serial.parameters.constants import ( HEADER_FILES_PATH, PARAM_FILE_NAME, PARAM_FILE_PATH_FT, diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_moveonclick.py similarity index 96% rename from src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py rename to src/mx_bluesky/i24/serial/fixed_target/i24ssx_moveonclick.py index 53a73b240..ec4f8de74 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_moveonclick.py +++ b/src/mx_bluesky/i24/serial/fixed_target/i24ssx_moveonclick.py @@ -12,9 +12,9 @@ from dodal.devices.i24.pmac import PMAC from dodal.devices.oav.oav_detector import OAV -from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_Manager_py3v1 as manager -from mx_bluesky.I24.serial.fixed_target.ft_utils import Fiducials -from mx_bluesky.I24.serial.parameters.constants import OAV1_CAM +from mx_bluesky.i24.serial.fixed_target import i24ssx_Chip_Manager_py3v1 as manager +from mx_bluesky.i24.serial.fixed_target.ft_utils import Fiducials +from mx_bluesky.i24.serial.parameters.constants import OAV1_CAM logger = logging.getLogger("I24ssx.moveonclick") diff --git a/src/mx_bluesky/I24/serial/log.py b/src/mx_bluesky/i24/serial/log.py similarity index 100% rename from src/mx_bluesky/I24/serial/log.py rename to src/mx_bluesky/i24/serial/log.py diff --git a/src/mx_bluesky/I24/serial/parameters/__init__.py b/src/mx_bluesky/i24/serial/parameters/__init__.py similarity index 52% rename from src/mx_bluesky/I24/serial/parameters/__init__.py rename to src/mx_bluesky/i24/serial/parameters/__init__.py index 9308f50fa..184d36ff5 100644 --- a/src/mx_bluesky/I24/serial/parameters/__init__.py +++ b/src/mx_bluesky/i24/serial/parameters/__init__.py @@ -1,10 +1,10 @@ -from mx_bluesky.I24.serial.parameters.constants import SSXType -from mx_bluesky.I24.serial.parameters.experiment_parameters import ( +from mx_bluesky.i24.serial.parameters.constants import SSXType +from mx_bluesky.i24.serial.parameters.experiment_parameters import ( ChipDescription, ExtruderParameters, FixedTargetParameters, ) -from mx_bluesky.I24.serial.parameters.utils import get_chip_format +from mx_bluesky.i24.serial.parameters.utils import get_chip_format __all__ = [ "SSXType", diff --git a/src/mx_bluesky/I24/serial/parameters/constants.py b/src/mx_bluesky/i24/serial/parameters/constants.py similarity index 95% rename from src/mx_bluesky/I24/serial/parameters/constants.py rename to src/mx_bluesky/i24/serial/parameters/constants.py index 1da55fbdd..d45cf9995 100644 --- a/src/mx_bluesky/I24/serial/parameters/constants.py +++ b/src/mx_bluesky/i24/serial/parameters/constants.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import Optional -from mx_bluesky.I24.serial.log import _read_visit_directory_from_file +from mx_bluesky.i24.serial.log import _read_visit_directory_from_file class SSXType(Enum): diff --git a/src/mx_bluesky/I24/serial/parameters/experiment_parameters.py b/src/mx_bluesky/i24/serial/parameters/experiment_parameters.py similarity index 98% rename from src/mx_bluesky/I24/serial/parameters/experiment_parameters.py rename to src/mx_bluesky/i24/serial/parameters/experiment_parameters.py index d03bc37c3..416a54cd1 100644 --- a/src/mx_bluesky/I24/serial/parameters/experiment_parameters.py +++ b/src/mx_bluesky/i24/serial/parameters/experiment_parameters.py @@ -4,7 +4,7 @@ from pydantic import BaseModel, ConfigDict, validator -from mx_bluesky.I24.serial.fixed_target.ft_utils import ( +from mx_bluesky.i24.serial.fixed_target.ft_utils import ( ChipType, MappingType, PumpProbeSetting, diff --git a/src/mx_bluesky/I24/serial/parameters/fixed_target/cs/cs_maker.json b/src/mx_bluesky/i24/serial/parameters/fixed_target/cs/cs_maker.json similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/fixed_target/cs/cs_maker.json rename to src/mx_bluesky/i24/serial/parameters/fixed_target/cs/cs_maker.json diff --git a/src/mx_bluesky/I24/serial/parameters/fixed_target/cs/motor_direction.txt b/src/mx_bluesky/i24/serial/parameters/fixed_target/cs/motor_direction.txt similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/fixed_target/cs/motor_direction.txt rename to src/mx_bluesky/i24/serial/parameters/fixed_target/cs/motor_direction.txt diff --git a/src/mx_bluesky/I24/serial/parameters/fixed_target/pvar_files/minichip-oxford.pvar b/src/mx_bluesky/i24/serial/parameters/fixed_target/pvar_files/minichip-oxford.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/fixed_target/pvar_files/minichip-oxford.pvar rename to src/mx_bluesky/i24/serial/parameters/fixed_target/pvar_files/minichip-oxford.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/fixed_target/pvar_files/oxford.pvar b/src/mx_bluesky/i24/serial/parameters/fixed_target/pvar_files/oxford.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/fixed_target/pvar_files/oxford.pvar rename to src/mx_bluesky/i24/serial/parameters/fixed_target/pvar_files/oxford.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/utils.py b/src/mx_bluesky/i24/serial/parameters/utils.py similarity index 91% rename from src/mx_bluesky/I24/serial/parameters/utils.py rename to src/mx_bluesky/i24/serial/parameters/utils.py index fdcfde59a..ea1aa9a18 100644 --- a/src/mx_bluesky/I24/serial/parameters/utils.py +++ b/src/mx_bluesky/i24/serial/parameters/utils.py @@ -1,8 +1,8 @@ from typing import Any, Dict -from mx_bluesky.I24.serial.fixed_target.ft_utils import ChipType -from mx_bluesky.I24.serial.parameters.experiment_parameters import ChipDescription -from mx_bluesky.I24.serial.setup_beamline import caget, pv +from mx_bluesky.i24.serial.fixed_target.ft_utils import ChipType +from mx_bluesky.i24.serial.parameters.experiment_parameters import ChipDescription +from mx_bluesky.i24.serial.setup_beamline import caget, pv def get_chip_format(chip_type: ChipType) -> ChipDescription: diff --git a/src/mx_bluesky/I24/serial/run_extruder.sh b/src/mx_bluesky/i24/serial/run_extruder.sh similarity index 100% rename from src/mx_bluesky/I24/serial/run_extruder.sh rename to src/mx_bluesky/i24/serial/run_extruder.sh diff --git a/src/mx_bluesky/I24/serial/run_fixed_target.sh b/src/mx_bluesky/i24/serial/run_fixed_target.sh similarity index 100% rename from src/mx_bluesky/I24/serial/run_fixed_target.sh rename to src/mx_bluesky/i24/serial/run_fixed_target.sh diff --git a/src/mx_bluesky/I24/serial/run_serial.py b/src/mx_bluesky/i24/serial/run_serial.py similarity index 100% rename from src/mx_bluesky/I24/serial/run_serial.py rename to src/mx_bluesky/i24/serial/run_serial.py diff --git a/src/mx_bluesky/I24/serial/run_ssx.sh b/src/mx_bluesky/i24/serial/run_ssx.sh similarity index 100% rename from src/mx_bluesky/I24/serial/run_ssx.sh rename to src/mx_bluesky/i24/serial/run_ssx.sh diff --git a/src/mx_bluesky/I24/serial/set_visit_directory.sh b/src/mx_bluesky/i24/serial/set_visit_directory.sh similarity index 100% rename from src/mx_bluesky/I24/serial/set_visit_directory.sh rename to src/mx_bluesky/i24/serial/set_visit_directory.sh diff --git a/src/mx_bluesky/I24/serial/setup_beamline/__init__.py b/src/mx_bluesky/i24/serial/setup_beamline/__init__.py similarity index 100% rename from src/mx_bluesky/I24/serial/setup_beamline/__init__.py rename to src/mx_bluesky/i24/serial/setup_beamline/__init__.py diff --git a/src/mx_bluesky/I24/serial/setup_beamline/ca.py b/src/mx_bluesky/i24/serial/setup_beamline/ca.py similarity index 100% rename from src/mx_bluesky/I24/serial/setup_beamline/ca.py rename to src/mx_bluesky/i24/serial/setup_beamline/ca.py diff --git a/src/mx_bluesky/I24/serial/setup_beamline/pv.py b/src/mx_bluesky/i24/serial/setup_beamline/pv.py similarity index 100% rename from src/mx_bluesky/I24/serial/setup_beamline/pv.py rename to src/mx_bluesky/i24/serial/setup_beamline/pv.py diff --git a/src/mx_bluesky/I24/serial/setup_beamline/pv_abstract.py b/src/mx_bluesky/i24/serial/setup_beamline/pv_abstract.py similarity index 97% rename from src/mx_bluesky/I24/serial/setup_beamline/pv_abstract.py rename to src/mx_bluesky/i24/serial/setup_beamline/pv_abstract.py index ebd986cda..aceb83cdf 100644 --- a/src/mx_bluesky/I24/serial/setup_beamline/pv_abstract.py +++ b/src/mx_bluesky/i24/serial/setup_beamline/pv_abstract.py @@ -7,7 +7,7 @@ from typing import Union -from mx_bluesky.I24.serial.setup_beamline import pv +from mx_bluesky.i24.serial.setup_beamline import pv class Pilatus: diff --git a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py b/src/mx_bluesky/i24/serial/setup_beamline/setup_beamline.py similarity index 99% rename from src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py rename to src/mx_bluesky/i24/serial/setup_beamline/setup_beamline.py index 252687efc..f51c8eb0a 100644 --- a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py +++ b/src/mx_bluesky/i24/serial/setup_beamline/setup_beamline.py @@ -5,10 +5,10 @@ from dodal.devices.i24.aperture import Aperture, AperturePositions from dodal.devices.i24.beamstop import Beamstop, BeamstopPositions from dodal.devices.i24.dual_backlight import BacklightPositions, DualBacklight -from dodal.devices.i24.I24_detector_motion import DetectorMotion +from dodal.devices.i24.i24_detector_motion import DetectorMotion -from mx_bluesky.I24.serial.setup_beamline import pv -from mx_bluesky.I24.serial.setup_beamline.ca import caget, caput +from mx_bluesky.i24.serial.setup_beamline import pv +from mx_bluesky.i24.serial.setup_beamline.ca import caget, caput logger = logging.getLogger("I24ssx.sup") diff --git a/src/mx_bluesky/I24/serial/setup_beamline/setup_detector.py b/src/mx_bluesky/i24/serial/setup_beamline/setup_detector.py similarity index 90% rename from src/mx_bluesky/I24/serial/setup_beamline/setup_detector.py rename to src/mx_bluesky/i24/serial/setup_beamline/setup_detector.py index 03e4227ef..7ae182248 100644 --- a/src/mx_bluesky/I24/serial/setup_beamline/setup_detector.py +++ b/src/mx_bluesky/i24/serial/setup_beamline/setup_detector.py @@ -11,13 +11,13 @@ from blueapi.core import MsgGenerator from bluesky.utils import Msg from dodal.common import inject -from dodal.devices.i24.I24_detector_motion import DetectorMotion +from dodal.devices.i24.i24_detector_motion import DetectorMotion -from mx_bluesky.I24.serial import log -from mx_bluesky.I24.serial.parameters import SSXType -from mx_bluesky.I24.serial.setup_beamline import pv -from mx_bluesky.I24.serial.setup_beamline.ca import caget -from mx_bluesky.I24.serial.setup_beamline.pv_abstract import ( +from mx_bluesky.i24.serial import log +from mx_bluesky.i24.serial.parameters import SSXType +from mx_bluesky.i24.serial.setup_beamline import pv +from mx_bluesky.i24.serial.setup_beamline.ca import caget +from mx_bluesky.i24.serial.setup_beamline.pv_abstract import ( Detector, Eiger, Pilatus, diff --git a/src/mx_bluesky/I24/serial/setup_beamline/setup_zebra_plans.py b/src/mx_bluesky/i24/serial/setup_beamline/setup_zebra_plans.py similarity index 100% rename from src/mx_bluesky/I24/serial/setup_beamline/setup_zebra_plans.py rename to src/mx_bluesky/i24/serial/setup_beamline/setup_zebra_plans.py diff --git a/src/mx_bluesky/I24/serial/start_blueapi.sh b/src/mx_bluesky/i24/serial/start_blueapi.sh similarity index 100% rename from src/mx_bluesky/I24/serial/start_blueapi.sh rename to src/mx_bluesky/i24/serial/start_blueapi.sh diff --git a/src/mx_bluesky/I24/serial/write_nexus.py b/src/mx_bluesky/i24/serial/write_nexus.py similarity index 95% rename from src/mx_bluesky/I24/serial/write_nexus.py rename to src/mx_bluesky/i24/serial/write_nexus.py index 97ead6025..3476fcf73 100644 --- a/src/mx_bluesky/I24/serial/write_nexus.py +++ b/src/mx_bluesky/i24/serial/write_nexus.py @@ -8,9 +8,9 @@ import requests -from mx_bluesky.I24.serial.fixed_target.ft_utils import ChipType, MappingType -from mx_bluesky.I24.serial.parameters import ExtruderParameters, FixedTargetParameters -from mx_bluesky.I24.serial.setup_beamline import Eiger, caget, cagetstring +from mx_bluesky.i24.serial.fixed_target.ft_utils import ChipType, MappingType +from mx_bluesky.i24.serial.parameters import ExtruderParameters, FixedTargetParameters +from mx_bluesky.i24.serial.setup_beamline import Eiger, caget, cagetstring logger = logging.getLogger("I24ssx.nexus_writer") diff --git a/tests/I24/serial/__init__.py b/tests/i24/serial/__init__.py similarity index 100% rename from tests/I24/serial/__init__.py rename to tests/i24/serial/__init__.py diff --git a/tests/I24/serial/conftest.py b/tests/i24/serial/conftest.py similarity index 100% rename from tests/I24/serial/conftest.py rename to tests/i24/serial/conftest.py diff --git a/tests/I24/serial/extruder/__init__.py b/tests/i24/serial/extruder/__init__.py similarity index 100% rename from tests/I24/serial/extruder/__init__.py rename to tests/i24/serial/extruder/__init__.py diff --git a/tests/I24/serial/extruder/test_extruder_collect.py b/tests/i24/serial/extruder/test_extruder_collect.py similarity index 72% rename from tests/I24/serial/extruder/test_extruder_collect.py rename to tests/i24/serial/extruder/test_extruder_collect.py index b3cef31a1..7dd764fb7 100644 --- a/tests/I24/serial/extruder/test_extruder_collect.py +++ b/tests/i24/serial/extruder/test_extruder_collect.py @@ -5,7 +5,7 @@ from dodal.devices.zebra import DISCONNECT, SOFT_IN3 from ophyd_async.core import get_mock_put -from mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2 import ( +from mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2 import ( TTL_EIGER, TTL_PILATUS, collection_aborted_plan, @@ -16,8 +16,8 @@ main_extruder_plan, tidy_up_at_collection_end_plan, ) -from mx_bluesky.I24.serial.parameters import ExtruderParameters -from mx_bluesky.I24.serial.setup_beamline import Eiger, Pilatus +from mx_bluesky.i24.serial.parameters import ExtruderParameters +from mx_bluesky.i24.serial.setup_beamline import Eiger, Pilatus @pytest.fixture @@ -57,11 +57,11 @@ def fake_generator(value): return value -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.get_detector_type") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.logger") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.get_detector_type") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.logger") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") def test_initialise_extruder( fake_log_setup, fake_log, @@ -78,7 +78,7 @@ def test_initialise_extruder( assert fake_caget.call_count == 1 -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") async def test_enterhutch(fake_log_setup, detector_stage, RE): RE(enter_hutch(detector_stage)) assert await detector_stage.z.user_readback.get_value() == 1480 @@ -93,8 +93,8 @@ async def test_enterhutch(fake_log_setup, detector_stage, RE): ("laseroff", Pilatus(), "No", DISCONNECT), ], ) -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.get_detector_type") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.get_detector_type") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") async def test_laser_check( fake_log_setup, fake_det, @@ -114,17 +114,17 @@ async def test_laser_check( assert await zebra.output.out_pvs[TTL].get_value() == expected_out -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.call_nexgen") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.call_nexgen") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup") @patch( - "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_zebra_for_quickshot_plan" + "mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_zebra_for_quickshot_plan" ) -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.bps.rd") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.bps.rd") def test_run_extruder_quickshot_with_eiger( fake_read, fake_log_setup, @@ -171,16 +171,16 @@ def test_run_extruder_quickshot_with_eiger( mock_quickshot_plan.assert_called_once() -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup") @patch( - "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_zebra_for_extruder_with_pump_probe_plan" + "mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_zebra_for_extruder_with_pump_probe_plan" ) -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.bps.rd") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.setup_logging") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.bps.rd") def test_run_extruder_pump_probe_with_pilatus( fake_read, fake_log_setup, @@ -231,12 +231,12 @@ def test_run_extruder_pump_probe_with_pilatus( @patch( - "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.reset_zebra_when_collection_done_plan" + "mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.reset_zebra_when_collection_done_plan" ) -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup") def test_tidy_up_at_collection_end_plan_with_eiger( fake_sup, fake_caget, @@ -260,10 +260,10 @@ def test_tidy_up_at_collection_end_plan_with_eiger( fake_sup.eiger.assert_called_once_with("return-to-normal") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.disarm_zebra") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.disarm_zebra") def test_aborted_plan_with_pilatus( mock_disarm, fake_dcid, fake_caput, fake_sleep, RE, zebra ): @@ -274,10 +274,10 @@ def test_aborted_plan_with_pilatus( fake_dcid.collection_complete.assert_called_once_with(ANY, aborted=True) -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.shutil") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.shutil") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.DCID") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sleep") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") def test_collection_complete_plan_with_eiger( fake_caput, fake_sleep, fake_dcid, fake_shutil, dummy_params, RE ): diff --git a/tests/I24/serial/fixed_target/__init__.py b/tests/i24/serial/fixed_target/__init__.py similarity index 100% rename from tests/I24/serial/fixed_target/__init__.py rename to tests/i24/serial/fixed_target/__init__.py diff --git a/tests/I24/serial/fixed_target/conftest.py b/tests/i24/serial/fixed_target/conftest.py similarity index 80% rename from tests/I24/serial/fixed_target/conftest.py rename to tests/i24/serial/fixed_target/conftest.py index dd60c11a9..64501fd2a 100644 --- a/tests/I24/serial/fixed_target/conftest.py +++ b/tests/i24/serial/fixed_target/conftest.py @@ -1,7 +1,7 @@ import pytest -from mx_bluesky.I24.serial.fixed_target.ft_utils import ChipType -from mx_bluesky.I24.serial.parameters import FixedTargetParameters, get_chip_format +from mx_bluesky.i24.serial.fixed_target.ft_utils import ChipType +from mx_bluesky.i24.serial.parameters import FixedTargetParameters, get_chip_format @pytest.fixture diff --git a/tests/I24/serial/fixed_target/test_chip_manager.py b/tests/i24/serial/fixed_target/test_chip_manager.py similarity index 76% rename from tests/I24/serial/fixed_target/test_chip_manager.py rename to tests/i24/serial/fixed_target/test_chip_manager.py index 0c3742957..11127ab9e 100644 --- a/tests/I24/serial/fixed_target/test_chip_manager.py +++ b/tests/i24/serial/fixed_target/test_chip_manager.py @@ -5,12 +5,12 @@ import pytest from dodal.devices.i24.beamstop import Beamstop from dodal.devices.i24.dual_backlight import DualBacklight -from dodal.devices.i24.I24_detector_motion import DetectorMotion +from dodal.devices.i24.i24_detector_motion import DetectorMotion from dodal.devices.i24.pmac import PMAC from ophyd_async.core import get_mock_put -from mx_bluesky.I24.serial.fixed_target.ft_utils import Fiducials -from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1 import ( +from mx_bluesky.i24.serial.fixed_target.ft_utils import Fiducials +from mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1 import ( cs_maker, cs_reset, initialise_stages, @@ -36,10 +36,10 @@ cs_json = '{"scalex":1, "scaley":2, "scalez":3, "skew":-0.5, "Sx_dir":1, "Sy_dir":-1, "Sz_dir":0}' -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.sys") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.get_detector_type") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.sys") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.get_detector_type") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") async def test_initialise( fake_caput: MagicMock, fake_det: MagicMock, @@ -66,8 +66,8 @@ async def test_initialise( ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") async def test_moveto_oxford_origin( fake_caget: MagicMock, fake_log: MagicMock, pmac: PMAC, RE ): @@ -78,8 +78,8 @@ async def test_moveto_oxford_origin( assert await pmac.y.user_readback.get_value() == 0.0 -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") async def test_moveto_oxford_inner_f1( fake_caget: MagicMock, fake_log: MagicMock, pmac: PMAC, RE ): @@ -90,14 +90,14 @@ async def test_moveto_oxford_inner_f1( assert await pmac.y.user_readback.get_value() == 0.0 -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") async def test_moveto_chip_aspecific(fake_log: MagicMock, pmac: PMAC, RE): RE(moveto("zero", pmac)) assert await pmac.pmac_string.get_value() == "!x0y0z0" -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") async def test_moveto_preset( fake_caput: MagicMock, fake_log: MagicMock, @@ -123,8 +123,8 @@ async def test_moveto_preset( ("microdrop_position", 0, [6.0, -7.8, 0.0], False), ], ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") async def test_moveto_preset_with_pmac_move( fake_caput: MagicMock, fake_log: MagicMock, @@ -159,7 +159,7 @@ async def test_moveto_preset_with_pmac_move( ("laser2off", " M812=0 M811=1"), ], ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") async def test_laser_control_on_and_off( fake_log: MagicMock, laser_setting: str, expected_pmac_string: str, pmac: PMAC, RE ): @@ -168,9 +168,9 @@ async def test_laser_control_on_and_off( assert await pmac.pmac_string.get_value() == expected_pmac_string -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.bps.sleep") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.bps.sleep") def test_laser_control_burn_setting( fake_sleep: MagicMock, fake_caget: MagicMock, fake_log: MagicMock, pmac: PMAC, RE ): @@ -188,7 +188,7 @@ def test_laser_control_burn_setting( @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", mock_open(read_data=mtr_dir_str), ) def test_scrape_mtr_directions(): @@ -198,7 +198,7 @@ def test_scrape_mtr_directions(): @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", mock_open(read_data=fiducial_1_str), ) def test_scrape_mtr_fiducials(): @@ -229,9 +229,9 @@ def test_cs_pmac_str_set(pmac: PMAC, RE): ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.set_pmac_strings_for_cs" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.set_pmac_strings_for_cs" ) def test_cs_reset(mock_set_pmac_str: MagicMock, fake_log: MagicMock, pmac: PMAC, RE): RE(cs_reset(pmac)) @@ -239,17 +239,17 @@ def test_cs_reset(mock_set_pmac_str: MagicMock, fake_log: MagicMock, pmac: PMAC, @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", mock_open(read_data='{"a":11, "b":12,}'), ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_directions" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_directions" ) @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_fiducials" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_fiducials" ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") def test_cs_maker_raises_error_for_invalid_json( fake_log: MagicMock, fake_fid: MagicMock, @@ -265,17 +265,17 @@ def test_cs_maker_raises_error_for_invalid_json( @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", mock_open(read_data='{"scalex":11, "skew":12}'), ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_directions" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_directions" ) @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_fiducials" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_fiducials" ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") def test_cs_maker_raises_error_for_missing_key_in_json( fake_log: MagicMock, fake_fid: MagicMock, @@ -291,17 +291,17 @@ def test_cs_maker_raises_error_for_missing_key_in_json( @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.open", mock_open(read_data=cs_json), ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_directions" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_directions" ) @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_fiducials" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.scrape_mtr_fiducials" ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") def test_cs_maker_raises_error_for_wrong_direction_in_json( fake_log: MagicMock, fake_fid: MagicMock, @@ -316,9 +316,9 @@ def test_cs_maker_raises_error_for_wrong_direction_in_json( RE(cs_maker(pmac)) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.setup_logging") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") def test_pumpprobe_calc( fake_caget: MagicMock, fake_caput: MagicMock, fake_log: MagicMock, RE ): diff --git a/tests/I24/serial/fixed_target/test_chip_startup.py b/tests/i24/serial/fixed_target/test_chip_startup.py similarity index 83% rename from tests/I24/serial/fixed_target/test_chip_startup.py rename to tests/i24/serial/fixed_target/test_chip_startup.py index 2b93cef8b..aae8c6b04 100644 --- a/tests/I24/serial/fixed_target/test_chip_startup.py +++ b/tests/i24/serial/fixed_target/test_chip_startup.py @@ -2,7 +2,7 @@ import pytest -from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( +from mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( check_files, fiducials, pathli, @@ -14,9 +14,9 @@ def test_fiducials(): assert len(fiducials(1)) == 0 -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.os") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.os") @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.read_parameter_file" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.read_parameter_file" ) def test_check_files(fake_read_params, mock_os, dummy_params_without_pp): fake_read_params.return_value = dummy_params_without_pp diff --git a/tests/I24/serial/fixed_target/test_ft_collect.py b/tests/i24/serial/fixed_target/test_ft_collect.py similarity index 82% rename from tests/I24/serial/fixed_target/test_ft_collect.py rename to tests/i24/serial/fixed_target/test_ft_collect.py index d6a49a4e7..f6aa52107 100644 --- a/tests/I24/serial/fixed_target/test_ft_collect.py +++ b/tests/i24/serial/fixed_target/test_ft_collect.py @@ -7,8 +7,8 @@ from dodal.devices.zebra import Zebra from ophyd_async.core import get_mock_put -from mx_bluesky.I24.serial.fixed_target.ft_utils import MappingType -from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1 import ( +from mx_bluesky.i24.serial.fixed_target.ft_utils import MappingType +from mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1 import ( datasetsizei24, finish_i24, get_chip_prog_values, @@ -30,12 +30,12 @@ def fake_generator(value): return value -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") def test_datasetsizei24_for_one_block_and_two_exposures( fake_caput, dummy_params_without_pp ): with patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.open", + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.open", mock_open(read_data=chipmap_str), ): tot_num_imgs = datasetsizei24(2, dummy_params_without_pp.chip, MappingType.Lite) @@ -110,11 +110,11 @@ def test_load_motion_program_data( mock_pmac_str.assert_has_calls(call_list) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caget") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sup") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sleep") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sup") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sleep") def test_start_i24_with_eiger( fake_sleep, fake_sup, @@ -158,15 +158,15 @@ def test_start_i24_with_eiger( mock_shutter.assert_has_calls(shutter_call_list) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.write_userlog") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sleep") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.cagetstring") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caget") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sup") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.write_userlog") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sleep") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.cagetstring") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caget") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sup") @patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.reset_zebra_when_collection_done_plan" + "mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.reset_zebra_when_collection_done_plan" ) -@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.bps.rd") +@patch("mx_bluesky.i24.serial.extruder.i24ssx_Extruder_Collect_py3v2.bps.rd") def test_finish_i24( fake_read, fake_reset_zebra, @@ -200,7 +200,7 @@ def test_finish_i24( fake_userlog.assert_called_once_with(dummy_params_without_pp, "chip_01", 0.0, 0.6) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID") def test_run_aborted_plan(fake_dcid: MagicMock, pmac: PMAC, RE): RE(run_aborted_plan(pmac, fake_dcid)) @@ -213,10 +213,10 @@ def test_run_aborted_plan(fake_dcid: MagicMock, pmac: PMAC, RE): fake_dcid.collection_complete.assert_called_once_with(ANY, aborted=True) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.finish_i24") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sleep") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.finish_i24") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sleep") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") async def test_tidy_up_after_collection_plan( fake_caput, fake_dcid, diff --git a/tests/I24/serial/fixed_target/test_moveonclick.py b/tests/i24/serial/fixed_target/test_moveonclick.py similarity index 87% rename from tests/I24/serial/fixed_target/test_moveonclick.py rename to tests/i24/serial/fixed_target/test_moveonclick.py index f902a682c..b20b8e8d4 100644 --- a/tests/I24/serial/fixed_target/test_moveonclick.py +++ b/tests/i24/serial/fixed_target/test_moveonclick.py @@ -6,7 +6,7 @@ from dodal.devices.oav.oav_detector import OAV from ophyd_async.core import get_mock_put -from mx_bluesky.I24.serial.fixed_target.i24ssx_moveonclick import ( +from mx_bluesky.i24.serial.fixed_target.i24ssx_moveonclick import ( onMouse, update_ui, zoomcalibrator, @@ -33,7 +33,7 @@ ), ], ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_moveonclick._get_beam_centre") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_moveonclick._get_beam_centre") def test_onMouse_gets_beam_position_and_sends_correct_str( fake_get_beam_pos: MagicMock, beam_position: tuple, @@ -54,8 +54,8 @@ def test_onMouse_gets_beam_position_and_sends_correct_str( ) -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_moveonclick.cv") -@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_moveonclick._get_beam_centre") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_moveonclick.cv") +@patch("mx_bluesky.i24.serial.fixed_target.i24ssx_moveonclick._get_beam_centre") def test_update_ui_uses_correct_beam_centre_for_ellipse(fake_beam_pos, fake_cv): mock_frame = MagicMock() mock_oav = MagicMock() diff --git a/tests/I24/serial/parameters/test_utils.py b/tests/i24/serial/parameters/test_utils.py similarity index 86% rename from tests/I24/serial/parameters/test_utils.py rename to tests/i24/serial/parameters/test_utils.py index f94c9cf30..7306b428c 100644 --- a/tests/I24/serial/parameters/test_utils.py +++ b/tests/i24/serial/parameters/test_utils.py @@ -2,8 +2,8 @@ import pytest -from mx_bluesky.I24.serial.fixed_target.ft_utils import ChipType -from mx_bluesky.I24.serial.parameters import get_chip_format +from mx_bluesky.i24.serial.fixed_target.ft_utils import ChipType +from mx_bluesky.i24.serial.parameters import get_chip_format @pytest.mark.parametrize( @@ -26,7 +26,7 @@ def test_get_chip_format_for_oxford_chips( assert test_defaults["x_step_size"] == expected_step_size -@patch("mx_bluesky.I24.serial.parameters.utils.caget") +@patch("mx_bluesky.i24.serial.parameters.utils.caget") def test_get_chip_format_for_custom_chips(fake_caget: MagicMock): fake_caget.side_effect = ["10", "2", "0.2", "0.2"] test_chip_type = ChipType(2) diff --git a/tests/I24/serial/setup_beamline/__init__.py b/tests/i24/serial/setup_beamline/__init__.py similarity index 100% rename from tests/I24/serial/setup_beamline/__init__.py rename to tests/i24/serial/setup_beamline/__init__.py diff --git a/tests/I24/serial/setup_beamline/test_pv_abstract.py b/tests/i24/serial/setup_beamline/test_pv_abstract.py similarity index 73% rename from tests/I24/serial/setup_beamline/test_pv_abstract.py rename to tests/i24/serial/setup_beamline/test_pv_abstract.py index 3a816b97e..1ee233063 100644 --- a/tests/I24/serial/setup_beamline/test_pv_abstract.py +++ b/tests/i24/serial/setup_beamline/test_pv_abstract.py @@ -1,4 +1,4 @@ -from mx_bluesky.I24.serial.setup_beamline import Eiger, Pilatus +from mx_bluesky.i24.serial.setup_beamline import Eiger, Pilatus def test_eiger(): diff --git a/tests/I24/serial/setup_beamline/test_setup_beamline.py b/tests/i24/serial/setup_beamline/test_setup_beamline.py similarity index 72% rename from tests/I24/serial/setup_beamline/test_setup_beamline.py rename to tests/i24/serial/setup_beamline/test_setup_beamline.py index 0569148bf..770dfad17 100644 --- a/tests/I24/serial/setup_beamline/test_setup_beamline.py +++ b/tests/i24/serial/setup_beamline/test_setup_beamline.py @@ -4,9 +4,9 @@ from dodal.devices.i24.aperture import Aperture from dodal.devices.i24.beamstop import Beamstop from dodal.devices.i24.dual_backlight import DualBacklight -from dodal.devices.i24.I24_detector_motion import DetectorMotion +from dodal.devices.i24.i24_detector_motion import DetectorMotion -from mx_bluesky.I24.serial.setup_beamline import setup_beamline +from mx_bluesky.i24.serial.setup_beamline import setup_beamline async def test_setup_beamline_for_collection_plan( @@ -28,30 +28,30 @@ async def test_move_detector_stage_to_position_plan(detector_stage: DetectorMoti assert await detector_stage.z.user_readback.get_value() == det_dist -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caput") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caget") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caput") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caget") def test_pilatus_raises_error_if_fastchip_and_no_args_list(fake_caget, fake_caput): with pytest.raises(TypeError): setup_beamline.pilatus("fastchip") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caput") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caget") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caput") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caget") def test_pilatus_quickshot(fake_caget, fake_caput): setup_beamline.pilatus("quickshot", ["", "", 1, 0.1]) assert fake_caput.call_count == 12 assert fake_caget.call_count == 2 -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caput") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caget") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caput") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caget") def test_eiger_raises_error_if_quickshot_and_no_args_list(fake_caget, fake_caput): with pytest.raises(TypeError): setup_beamline.eiger("quickshot") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caput") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caget") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caput") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_beamline.caget") def test_eiger_quickshot(fake_caget, fake_caput): setup_beamline.eiger("quickshot", ["", "", "1", "0.1"]) assert fake_caput.call_count == 32 diff --git a/tests/I24/serial/setup_beamline/test_setup_detector.py b/tests/i24/serial/setup_beamline/test_setup_detector.py similarity index 77% rename from tests/I24/serial/setup_beamline/test_setup_detector.py rename to tests/i24/serial/setup_beamline/test_setup_detector.py index 8ca700a82..e49d4dfb4 100644 --- a/tests/I24/serial/setup_beamline/test_setup_detector.py +++ b/tests/i24/serial/setup_beamline/test_setup_detector.py @@ -3,9 +3,9 @@ import pytest from ophyd_async.core import set_mock_value -from mx_bluesky.I24.serial.parameters.constants import SSXType -from mx_bluesky.I24.serial.setup_beamline import Eiger, Pilatus -from mx_bluesky.I24.serial.setup_beamline.setup_detector import ( +from mx_bluesky.i24.serial.parameters.constants import SSXType +from mx_bluesky.i24.serial.setup_beamline import Eiger, Pilatus +from mx_bluesky.i24.serial.setup_beamline.setup_detector import ( DetRequest, _get_requested_detector, get_detector_type, @@ -25,7 +25,7 @@ def test_get_detector_type_finds_pilatus(detector_stage): assert det_type.name == "pilatus" -@patch("mx_bluesky.I24.serial.setup_beamline.setup_detector.caget") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_detector.caget") def test_get_requested_detector(fake_caget): fake_caget.return_value = "pilatus" assert _get_requested_detector("some_pv") == Pilatus.name @@ -34,15 +34,15 @@ def test_get_requested_detector(fake_caget): assert _get_requested_detector("some_pv") == Eiger.name -@patch("mx_bluesky.I24.serial.setup_beamline.setup_detector.caget") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_detector.caget") def test_get_requested_detector_raises_error_for_invalid_value(fake_caget): fake_caget.return_value = "something" with pytest.raises(ValueError): _get_requested_detector("some_pv") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_detector.setup_logging") -@patch("mx_bluesky.I24.serial.setup_beamline.setup_detector.caget") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_detector.setup_logging") +@patch("mx_bluesky.i24.serial.setup_beamline.setup_detector.caget") async def test_setup_detector_stage(fake_caget, fake_log, detector_stage, RE): fake_caget.return_value = DetRequest.eiger.value RE(setup_detector_stage(SSXType.FIXED, detector_stage)) diff --git a/tests/I24/serial/setup_beamline/test_zebra_plans.py b/tests/i24/serial/setup_beamline/test_zebra_plans.py similarity index 98% rename from tests/I24/serial/setup_beamline/test_zebra_plans.py rename to tests/i24/serial/setup_beamline/test_zebra_plans.py index 396051c53..a11ae5703 100644 --- a/tests/I24/serial/setup_beamline/test_zebra_plans.py +++ b/tests/i24/serial/setup_beamline/test_zebra_plans.py @@ -11,7 +11,7 @@ Zebra, ) -from mx_bluesky.I24.serial.setup_beamline.setup_zebra_plans import ( +from mx_bluesky.i24.serial.setup_beamline.setup_zebra_plans import ( arm_zebra, disarm_zebra, get_zebra_settings_for_extruder, diff --git a/tests/I24/serial/test_dcid.py b/tests/i24/serial/test_dcid.py similarity index 75% rename from tests/I24/serial/test_dcid.py rename to tests/i24/serial/test_dcid.py index 31897c550..e7f2ed3a4 100644 --- a/tests/I24/serial/test_dcid.py +++ b/tests/i24/serial/test_dcid.py @@ -1,17 +1,17 @@ from unittest.mock import patch -from mx_bluesky.I24.serial.dcid import get_beam_center, get_beamsize, get_resolution -from mx_bluesky.I24.serial.setup_beamline import Eiger, Pilatus +from mx_bluesky.i24.serial.dcid import get_beam_center, get_beamsize, get_resolution +from mx_bluesky.i24.serial.setup_beamline import Eiger, Pilatus -@patch("mx_bluesky.I24.serial.dcid.caget") +@patch("mx_bluesky.i24.serial.dcid.caget") def test_beamsize(fake_caget): beam_size = get_beamsize() assert type(beam_size) is tuple assert fake_caget.call_count == 2 -@patch("mx_bluesky.I24.serial.dcid.caget") +@patch("mx_bluesky.i24.serial.dcid.caget") def test_beam_center(fake_caget): beam_center = get_beam_center(Eiger()) assert type(beam_center) is tuple diff --git a/tests/I24/serial/test_log.py b/tests/i24/serial/test_log.py similarity index 78% rename from tests/I24/serial/test_log.py rename to tests/i24/serial/test_log.py index 474ad3b1a..ac53d1aa0 100644 --- a/tests/I24/serial/test_log.py +++ b/tests/i24/serial/test_log.py @@ -4,7 +4,7 @@ import pytest -from mx_bluesky.I24.serial import log +from mx_bluesky.i24.serial import log @pytest.fixture @@ -19,8 +19,8 @@ def _destroy_handlers(logger): logger.handlers.clear() -@patch("mx_bluesky.I24.serial.log.environ") -@patch("mx_bluesky.I24.serial.log.Path.mkdir") +@patch("mx_bluesky.i24.serial.log.environ") +@patch("mx_bluesky.i24.serial.log.Path.mkdir") def test_logging_file_path(mock_dir, mock_environ): mock_environ.get.return_value = None log_path = log._get_logging_file_path() @@ -28,9 +28,9 @@ def test_logging_file_path(mock_dir, mock_environ): assert log_path.as_posix() == "tmp/logs" -@patch("mx_bluesky.I24.serial.log._read_visit_directory_from_file") -@patch("mx_bluesky.I24.serial.log.environ") -@patch("mx_bluesky.I24.serial.log.Path.mkdir") +@patch("mx_bluesky.i24.serial.log._read_visit_directory_from_file") +@patch("mx_bluesky.i24.serial.log.environ") +@patch("mx_bluesky.i24.serial.log.Path.mkdir") def test_logging_file_path_on_beamline(mock_dir, mock_environ, mock_visit): mock_environ.get.return_value = "i24" mock_visit.return_value = Path("/path/to/i24/data") @@ -45,17 +45,17 @@ def test_basic_logging_config(dummy_logger): assert dummy_logger.handlers[0].level == logging.DEBUG -@patch("mx_bluesky.I24.serial.log.integrate_bluesky_and_ophyd_logging") +@patch("mx_bluesky.i24.serial.log.integrate_bluesky_and_ophyd_logging") def test_default_logging_setup_removes_dodal_stream(mock_blusky_ophyd_logs): - with patch("mx_bluesky.I24.serial.log.dodal_logger") as mock_dodal_logger: + with patch("mx_bluesky.i24.serial.log.dodal_logger") as mock_dodal_logger: log.default_logging_setup(dev_mode=True) mock_blusky_ophyd_logs.assert_called_once() assert mock_dodal_logger.addHandler.call_count == 4 mock_dodal_logger.removeHandler.assert_called_once() -@patch("mx_bluesky.I24.serial.log.Path.mkdir") -@patch("mx_bluesky.I24.serial.log.default_logging_setup") +@patch("mx_bluesky.i24.serial.log.Path.mkdir") +@patch("mx_bluesky.i24.serial.log.default_logging_setup") def test_logging_config_with_filehandler(mock_default, mock_dir, dummy_logger): # dodal handlers mocked out log.config("dummy.log", delayed=True, dev_mode=True)