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

(DiamondLightSource/dodal#271) Move beamline_parameters.py and associ… #1057

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
xarray
doct
databroker
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@4bd322f38f2719352cc6049b268b0688d8ae9b73
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@12bbf4cd438456186f8ca694789b20b0708063f8
pydantic<2.0 # See https://github.com/DiamondLightSource/hyperion/issues/774
scipy

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import json

import bluesky.plan_stubs as bps
from dodal.beamlines.beamline_parameters import (
GDABeamlineParameters,
)
from dodal.devices.DCM import DCM, fixed_offset_from_beamline_params
from dodal.devices.focusing_mirror import (
FocusingMirror,
Expand All @@ -13,9 +16,6 @@
)

from hyperion.log import LOGGER
from hyperion.parameters.beamline_parameters import (
GDABeamlineParameters,
)

MIRROR_VOLTAGE_GROUP = "MIRROR_VOLTAGE_GROUP"
DCM_GROUP = "DCM_GROUP"
Expand Down
6 changes: 4 additions & 2 deletions src/hyperion/experiment_plans/stepped_grid_scan_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
from blueapi.core import BlueskyContext, MsgGenerator
from bluesky.run_engine import RunEngine
from bluesky.utils import ProgressBarManager
from dodal.beamlines.beamline_parameters import (
BEAMLINE_PARAMETER_PATHS,
GDABeamlineParameters,
)
from dodal.devices.smargon import Smargon
from dodal.utils import get_beamline_name

from hyperion.log import LOGGER
from hyperion.parameters import external_parameters
from hyperion.parameters.beamline_parameters import GDABeamlineParameters
from hyperion.parameters.constants import (
BEAMLINE_PARAMETER_PATHS,
GRIDSCAN_MAIN_PLAN,
SIM_BEAMLINE,
)
Expand Down
93 changes: 0 additions & 93 deletions src/hyperion/parameters/beamline_parameters.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/hyperion/parameters/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
ISPYB_HARDWARE_READ_PLAN = "ispyb_reading_hardware"
ISPYB_TRANSMISSION_FLUX_READ_PLAN = "ispyb_update_transmission_flux"
SIM_ZOCALO_ENV = "dev_artemis"
BEAMLINE_PARAMETER_PATHS = {
"i03": "/dls_sw/i03/software/daq_configuration/domain/beamlineParameters",
"i04": "/dls_sw/i04/software/gda_versions/gda_9_29/workspace_git/gda-mx.git/configurations/i04-config/scripts/beamlineParameters",
"s03": "tests/test_data/test_beamline_parameters.txt",
}

# this one is for reading
SIM_ISPYB_CONFIG = "tests/test_data/test_config.cfg"
Expand Down
3 changes: 1 addition & 2 deletions src/hyperion/utils/aperturescatterguard.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from dodal.beamlines.beamline_parameters import get_beamline_parameters
from dodal.devices.aperturescatterguard import AperturePositions, ApertureScatterguard

from hyperion.parameters.beamline_parameters import get_beamline_parameters


def load_default_aperture_scatterguard_positions_if_unset(
aperture_scatterguard: ApertureScatterguard,
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from bluesky.run_engine import RunEngine
from bluesky.utils import Msg
from dodal.beamlines import beamline_utils, i03
from dodal.beamlines.beamline_parameters import GDABeamlineParameters
from dodal.devices.aperturescatterguard import AperturePositions
from dodal.devices.attenuator import Attenuator
from dodal.devices.backlight import Backlight
Expand Down Expand Up @@ -39,7 +40,6 @@
NEXUS_LOGGER,
set_up_logging_handlers,
)
from hyperion.parameters.beamline_parameters import GDABeamlineParameters
from hyperion.parameters.external_parameters import from_file as raw_params_from_file
from hyperion.parameters.plan_specific.grid_scan_with_edge_detect_params import (
GridScanWithEdgeDetectInternalParameters,
Expand Down Expand Up @@ -582,7 +582,8 @@ def mock_message_generator(
) -> Callable[..., Generator[Msg, object, object]]:
"""Returns a callable that returns a generator yielding a Msg object recording the call arguments.
This can be used to mock methods returning a bluesky plan or portion thereof, call it from within a unit test
using the RunEngineSimulator, and then perform asserts on the message to verify in-order execution of the plan"""
using the RunEngineSimulator, and then perform asserts on the message to verify in-order execution of the plan
"""

def mock_method(*args, **kwargs):
yield Msg(function_name, None, *args, **kwargs)
Expand Down
7 changes: 5 additions & 2 deletions tests/system_tests/experiment_plans/test_fgs_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import pytest
from bluesky.run_engine import RunEngine
from dodal.beamlines import i03
from dodal.beamlines.beamline_parameters import (
BEAMLINE_PARAMETER_PATHS,
GDABeamlineParameters,
)
from dodal.devices.aperturescatterguard import AperturePositions
from ophyd.status import Status

Expand All @@ -24,9 +28,8 @@
XrayCentreCallbackCollection,
)
from hyperion.external_interaction.ispyb.store_datacollection_in_ispyb import IspybIds
from hyperion.parameters.beamline_parameters import GDABeamlineParameters
from hyperion.parameters.constants import BEAMLINE_PARAMETER_PATHS, SIM_BEAMLINE
from hyperion.parameters.constants import DEV_ISPYB_DATABASE_CFG as ISPYB_CONFIG
from hyperion.parameters.constants import SIM_BEAMLINE
from hyperion.parameters.external_parameters import from_file as default_raw_params
from hyperion.parameters.plan_specific.gridscan_internal_params import (
GridscanInternalParameters,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import pytest
from dodal.beamlines.beamline_parameters import (
BEAMLINE_PARAMETER_PATHS,
GDABeamlineParameters,
)
from dodal.devices.aperturescatterguard import AperturePositions, ApertureScatterguard

from hyperion.parameters.beamline_parameters import GDABeamlineParameters
from hyperion.parameters.constants import BEAMLINE_PARAMETER_PATHS


@pytest.fixture
def ap_sg():
Expand Down
3 changes: 0 additions & 3 deletions tests/test_data/bad_beamlineParameters

This file was deleted.

Loading
Loading