mx-bluesky 1.5.5__py3-none-any.whl → 1.5.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mx_bluesky/_version.py +2 -2
- mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py +25 -2
- mx_bluesky/common/parameters/components.py +1 -0
- mx_bluesky/hyperion/__main__.py +16 -3
- mx_bluesky/hyperion/baton_handler.py +39 -9
- mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +19 -8
- mx_bluesky/hyperion/external_interaction/agamemnon.py +6 -2
- mx_bluesky/hyperion/parameters/constants.py +1 -0
- mx_bluesky/hyperion/plan_runner.py +2 -4
- mx_bluesky/hyperion/plan_runner_api.py +43 -0
- {mx_bluesky-1.5.5.dist-info → mx_bluesky-1.5.6.dist-info}/METADATA +2 -2
- {mx_bluesky-1.5.5.dist-info → mx_bluesky-1.5.6.dist-info}/RECORD +16 -15
- {mx_bluesky-1.5.5.dist-info → mx_bluesky-1.5.6.dist-info}/WHEEL +0 -0
- {mx_bluesky-1.5.5.dist-info → mx_bluesky-1.5.6.dist-info}/entry_points.txt +0 -0
- {mx_bluesky-1.5.5.dist-info → mx_bluesky-1.5.6.dist-info}/licenses/LICENSE +0 -0
- {mx_bluesky-1.5.5.dist-info → mx_bluesky-1.5.6.dist-info}/top_level.txt +0 -0
mx_bluesky/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '1.5.
|
|
32
|
-
__version_tuple__ = version_tuple = (1, 5,
|
|
31
|
+
__version__ = version = '1.5.6'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 5, 6)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -9,6 +9,7 @@ import bluesky.preprocessors as bpp
|
|
|
9
9
|
import numpy as np
|
|
10
10
|
from bluesky.protocols import Readable
|
|
11
11
|
from bluesky.utils import MsgGenerator
|
|
12
|
+
from dodal.common.beamlines.commissioning_mode import read_commissioning_mode
|
|
12
13
|
from dodal.devices.fast_grid_scan import (
|
|
13
14
|
FastGridScanCommon,
|
|
14
15
|
)
|
|
@@ -226,11 +227,33 @@ def _fetch_xrc_results_from_zocalo(
|
|
|
226
227
|
for xr in filtered_results
|
|
227
228
|
]
|
|
228
229
|
else:
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
commissioning_mode = yield from read_commissioning_mode()
|
|
231
|
+
if commissioning_mode:
|
|
232
|
+
LOGGER.info("Commissioning mode enabled, returning dummy result")
|
|
233
|
+
flyscan_results = [_generate_dummy_xrc_result(parameters)]
|
|
234
|
+
else:
|
|
235
|
+
LOGGER.warning("No X-ray centre received")
|
|
236
|
+
raise CrystalNotFoundException()
|
|
231
237
|
yield from _fire_xray_centre_result_event(flyscan_results)
|
|
232
238
|
|
|
233
239
|
|
|
240
|
+
def _generate_dummy_xrc_result(params: SpecifiedThreeDGridScan) -> XRayCentreResult:
|
|
241
|
+
com = [params.x_steps / 2, params.y_steps / 2, params.z_steps / 2]
|
|
242
|
+
max_voxel = [round(p) for p in com]
|
|
243
|
+
return _xrc_result_in_boxes_to_result_in_mm(
|
|
244
|
+
XrcResult(
|
|
245
|
+
centre_of_mass=com,
|
|
246
|
+
max_voxel=max_voxel,
|
|
247
|
+
bounding_box=[max_voxel, [p + 1 for p in max_voxel]],
|
|
248
|
+
n_voxels=1,
|
|
249
|
+
max_count=10000,
|
|
250
|
+
total_count=100000,
|
|
251
|
+
sample_id=params.sample_id,
|
|
252
|
+
),
|
|
253
|
+
params,
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
|
|
234
257
|
@bpp.set_run_key_decorator(PlanNameConstants.GRIDSCAN_MAIN)
|
|
235
258
|
@bpp.run_decorator(md={"subplan_name": PlanNameConstants.GRIDSCAN_MAIN})
|
|
236
259
|
def run_gridscan(
|
mx_bluesky/hyperion/__main__.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import signal
|
|
2
3
|
import threading
|
|
3
4
|
from dataclasses import asdict
|
|
4
5
|
from sys import argv
|
|
@@ -32,9 +33,10 @@ from mx_bluesky.hyperion.parameters.cli import (
|
|
|
32
33
|
HyperionMode,
|
|
33
34
|
parse_cli_args,
|
|
34
35
|
)
|
|
35
|
-
from mx_bluesky.hyperion.parameters.constants import CONST
|
|
36
|
+
from mx_bluesky.hyperion.parameters.constants import CONST, HyperionConstants
|
|
36
37
|
from mx_bluesky.hyperion.parameters.load_centre_collect import LoadCentreCollect
|
|
37
38
|
from mx_bluesky.hyperion.plan_runner import PlanRunner
|
|
39
|
+
from mx_bluesky.hyperion.plan_runner_api import create_server_for_udc
|
|
38
40
|
from mx_bluesky.hyperion.runner import (
|
|
39
41
|
GDARunner,
|
|
40
42
|
StatusAndMessage,
|
|
@@ -170,7 +172,7 @@ def main():
|
|
|
170
172
|
"""Main application entry point."""
|
|
171
173
|
args = parse_cli_args()
|
|
172
174
|
initialise_globals(args)
|
|
173
|
-
hyperion_port =
|
|
175
|
+
hyperion_port = HyperionConstants.HYPERION_PORT
|
|
174
176
|
context = setup_context(dev_mode=args.dev_mode)
|
|
175
177
|
|
|
176
178
|
if args.mode == HyperionMode.GDA:
|
|
@@ -188,7 +190,18 @@ def main():
|
|
|
188
190
|
)
|
|
189
191
|
runner.wait_on_queue()
|
|
190
192
|
else:
|
|
191
|
-
|
|
193
|
+
plan_runner = PlanRunner(context, args.dev_mode)
|
|
194
|
+
create_server_for_udc(plan_runner)
|
|
195
|
+
_register_sigterm_handler(plan_runner)
|
|
196
|
+
run_forever(plan_runner)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def _register_sigterm_handler(runner: PlanRunner):
|
|
200
|
+
def shutdown_on_sigterm(sig_num, frame):
|
|
201
|
+
LOGGER.info("Received SIGTERM, shutting down...")
|
|
202
|
+
runner.shutdown()
|
|
203
|
+
|
|
204
|
+
signal.signal(signal.SIGTERM, shutdown_on_sigterm)
|
|
192
205
|
|
|
193
206
|
|
|
194
207
|
if __name__ == "__main__":
|
|
@@ -6,8 +6,14 @@ from blueapi.core.context import BlueskyContext
|
|
|
6
6
|
from bluesky import plan_stubs as bps
|
|
7
7
|
from bluesky import preprocessors as bpp
|
|
8
8
|
from bluesky.utils import MsgGenerator, RunEngineInterrupted
|
|
9
|
+
from dodal.common.beamlines.commissioning_mode import set_commissioning_signal
|
|
10
|
+
from dodal.devices.aperturescatterguard import ApertureScatterguard
|
|
9
11
|
from dodal.devices.baton import Baton
|
|
12
|
+
from dodal.devices.motors import XYZStage
|
|
13
|
+
from dodal.devices.robot import BartRobot
|
|
14
|
+
from dodal.devices.smargon import Smargon
|
|
10
15
|
|
|
16
|
+
from mx_bluesky.common.device_setup_plans.robot_load_unload import robot_unload
|
|
11
17
|
from mx_bluesky.common.experiment_plans.inner_plans.udc_default_state import (
|
|
12
18
|
UDCDefaultDevices,
|
|
13
19
|
move_to_udc_default_state,
|
|
@@ -77,6 +83,7 @@ def run_udc_when_requested(context: BlueskyContext, runner: PlanRunner):
|
|
|
77
83
|
|
|
78
84
|
def acquire_baton() -> MsgGenerator:
|
|
79
85
|
yield from _wait_for_hyperion_requested(baton)
|
|
86
|
+
LOGGER.debug("Hyperion is now current baton holder.")
|
|
80
87
|
yield from bps.abs_set(baton.current_user, HYPERION_USER)
|
|
81
88
|
|
|
82
89
|
def collect() -> MsgGenerator:
|
|
@@ -96,14 +103,20 @@ def run_udc_when_requested(context: BlueskyContext, runner: PlanRunner):
|
|
|
96
103
|
|
|
97
104
|
# re-fetch the baton because the device has been reinstantiated
|
|
98
105
|
baton = _get_baton(context)
|
|
106
|
+
current_visit: str | None = None
|
|
99
107
|
while (yield from _is_requesting_baton(baton)):
|
|
100
|
-
yield from _fetch_and_process_agamemnon_instruction(
|
|
108
|
+
current_visit = yield from _fetch_and_process_agamemnon_instruction(
|
|
109
|
+
baton, runner, current_visit
|
|
110
|
+
)
|
|
111
|
+
if current_visit:
|
|
112
|
+
yield from _perform_robot_unload(runner.context, current_visit)
|
|
101
113
|
|
|
102
114
|
def release_baton() -> MsgGenerator:
|
|
103
115
|
# If hyperion has given up the baton itself we need to also release requested
|
|
104
116
|
# user so that hyperion doesn't think we're requested again
|
|
105
117
|
baton = _get_baton(context)
|
|
106
|
-
previous_requested_user = yield from
|
|
118
|
+
previous_requested_user = yield from _unrequest_baton(baton)
|
|
119
|
+
LOGGER.debug("Hyperion no longer current baton holder.")
|
|
107
120
|
yield from bps.abs_set(baton.current_user, NO_USER, wait=True)
|
|
108
121
|
_raise_baton_released_alert(get_alerting_service(), previous_requested_user)
|
|
109
122
|
|
|
@@ -111,11 +124,11 @@ def run_udc_when_requested(context: BlueskyContext, runner: PlanRunner):
|
|
|
111
124
|
yield from bpp.contingency_wrapper(collect(), final_plan=release_baton)
|
|
112
125
|
|
|
113
126
|
context.run_engine(acquire_baton())
|
|
114
|
-
_initialise_udc(context)
|
|
127
|
+
_initialise_udc(context, runner.is_dev_mode)
|
|
115
128
|
context.run_engine(collect_then_release())
|
|
116
129
|
|
|
117
130
|
|
|
118
|
-
def _initialise_udc(context: BlueskyContext):
|
|
131
|
+
def _initialise_udc(context: BlueskyContext, dev_mode: bool):
|
|
119
132
|
"""
|
|
120
133
|
Perform all initialisation that happens at the start of UDC just after the
|
|
121
134
|
baton is acquired, but before we execute any plans or move hardware.
|
|
@@ -125,21 +138,25 @@ def _initialise_udc(context: BlueskyContext):
|
|
|
125
138
|
"""
|
|
126
139
|
LOGGER.info("Initialising mx-bluesky for UDC start...")
|
|
127
140
|
clear_all_device_caches(context)
|
|
128
|
-
|
|
141
|
+
LOGGER.debug("Reinitialising beamline devices")
|
|
142
|
+
setup_devices(context, dev_mode)
|
|
143
|
+
set_commissioning_signal(_get_baton(context).commissioning)
|
|
129
144
|
|
|
130
145
|
|
|
131
146
|
def _wait_for_hyperion_requested(baton: Baton):
|
|
147
|
+
LOGGER.debug("Hyperion waiting for baton...")
|
|
132
148
|
SLEEP_PER_CHECK = 0.1
|
|
133
149
|
while True:
|
|
134
150
|
requested_user = yield from bps.rd(baton.requested_user)
|
|
135
151
|
if requested_user == HYPERION_USER:
|
|
152
|
+
LOGGER.debug("Baton requested for Hyperion")
|
|
136
153
|
break
|
|
137
154
|
yield from bps.sleep(SLEEP_PER_CHECK)
|
|
138
155
|
|
|
139
156
|
|
|
140
157
|
def _fetch_and_process_agamemnon_instruction(
|
|
141
|
-
baton: Baton, runner: PlanRunner
|
|
142
|
-
) -> MsgGenerator:
|
|
158
|
+
baton: Baton, runner: PlanRunner, current_visit: str | None
|
|
159
|
+
) -> MsgGenerator[str | None]:
|
|
143
160
|
parameter_list: Sequence[MxBlueskyParameters] = create_parameters_from_agamemnon()
|
|
144
161
|
if parameter_list:
|
|
145
162
|
for parameters in parameter_list:
|
|
@@ -148,6 +165,7 @@ def _fetch_and_process_agamemnon_instruction(
|
|
|
148
165
|
)
|
|
149
166
|
match parameters:
|
|
150
167
|
case LoadCentreCollect():
|
|
168
|
+
current_visit = parameters.visit
|
|
151
169
|
devices: Any = create_devices(runner.context)
|
|
152
170
|
yield from runner.execute_plan(
|
|
153
171
|
partial(load_centre_collect_full, devices, parameters)
|
|
@@ -161,7 +179,8 @@ def _fetch_and_process_agamemnon_instruction(
|
|
|
161
179
|
else:
|
|
162
180
|
_raise_udc_completed_alert(get_alerting_service())
|
|
163
181
|
# Release the baton for orderly exit from the instruction loop
|
|
164
|
-
yield from
|
|
182
|
+
yield from _unrequest_baton(baton)
|
|
183
|
+
return current_visit
|
|
165
184
|
|
|
166
185
|
|
|
167
186
|
def _raise_udc_start_alert(alert_service: AlertService):
|
|
@@ -205,7 +224,7 @@ def _get_baton(context: BlueskyContext) -> Baton:
|
|
|
205
224
|
return find_device_in_context(context, "baton", Baton)
|
|
206
225
|
|
|
207
226
|
|
|
208
|
-
def
|
|
227
|
+
def _unrequest_baton(baton: Baton) -> MsgGenerator[str]:
|
|
209
228
|
"""Relinquish the requested user of the baton if it is not already requested
|
|
210
229
|
by another user.
|
|
211
230
|
|
|
@@ -214,6 +233,17 @@ def _safely_release_baton(baton: Baton) -> MsgGenerator[str]:
|
|
|
214
233
|
"""
|
|
215
234
|
requested_user = yield from bps.rd(baton.requested_user)
|
|
216
235
|
if requested_user == HYPERION_USER:
|
|
236
|
+
LOGGER.debug("Hyperion no longer requesting baton")
|
|
217
237
|
yield from bps.abs_set(baton.requested_user, NO_USER)
|
|
218
238
|
return NO_USER
|
|
219
239
|
return requested_user
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def _perform_robot_unload(context: BlueskyContext, visit: str) -> MsgGenerator:
|
|
243
|
+
robot = find_device_in_context(context, "robot", BartRobot)
|
|
244
|
+
smargon = find_device_in_context(context, "smargon", Smargon)
|
|
245
|
+
aperture_scatterguard = find_device_in_context(
|
|
246
|
+
context, "aperture_scatterguard", ApertureScatterguard
|
|
247
|
+
)
|
|
248
|
+
lower_gonio = find_device_in_context(context, "lower_gonio", XYZStage)
|
|
249
|
+
yield from robot_unload(robot, smargon, aperture_scatterguard, lower_gonio, visit)
|
|
@@ -8,11 +8,13 @@ import pydantic
|
|
|
8
8
|
from blueapi.core import BlueskyContext
|
|
9
9
|
from bluesky.preprocessors import run_decorator, set_run_key_decorator, subs_wrapper
|
|
10
10
|
from bluesky.utils import MsgGenerator
|
|
11
|
+
from dodal.devices.baton import Baton
|
|
11
12
|
from dodal.devices.oav.oav_parameters import OAVParameters
|
|
12
13
|
|
|
13
14
|
import mx_bluesky.common.xrc_result as flyscan_result
|
|
14
15
|
from mx_bluesky.common.parameters.components import WithSnapshot
|
|
15
16
|
from mx_bluesky.common.utils.context import device_composite_from_context
|
|
17
|
+
from mx_bluesky.common.utils.exceptions import CrystalNotFoundException
|
|
16
18
|
from mx_bluesky.common.utils.log import LOGGER
|
|
17
19
|
from mx_bluesky.common.xrc_result import XRayCentreEventHandler
|
|
18
20
|
from mx_bluesky.hyperion.experiment_plans.robot_load_then_centre_plan import (
|
|
@@ -36,6 +38,8 @@ from mx_bluesky.hyperion.parameters.rotation import RotationScanPerSweep
|
|
|
36
38
|
class LoadCentreCollectComposite(RobotLoadThenCentreComposite, RotationScanComposite):
|
|
37
39
|
"""Composite that provides access to the required devices."""
|
|
38
40
|
|
|
41
|
+
baton: Baton
|
|
42
|
+
|
|
39
43
|
|
|
40
44
|
def create_devices(context: BlueskyContext) -> LoadCentreCollectComposite:
|
|
41
45
|
"""Create the necessary devices for the plan."""
|
|
@@ -51,8 +55,9 @@ def load_centre_collect_full(
|
|
|
51
55
|
* Load the sample if necessary
|
|
52
56
|
* Move to the specified goniometer start angles
|
|
53
57
|
* Perform optical centring, then X-ray centring
|
|
54
|
-
* If X-ray centring finds
|
|
55
|
-
|
|
58
|
+
* If X-ray centring finds one or more diffracting centres then for each centre
|
|
59
|
+
that satisfies the chosen selection function,
|
|
60
|
+
move to that centre and do a collection with the specified parameters.
|
|
56
61
|
"""
|
|
57
62
|
|
|
58
63
|
get_hyperion_config_client().refresh_cache()
|
|
@@ -81,12 +86,18 @@ def load_centre_collect_full(
|
|
|
81
86
|
)
|
|
82
87
|
def plan_with_callback_subs():
|
|
83
88
|
flyscan_event_handler = XRayCentreEventHandler()
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
try:
|
|
90
|
+
yield from subs_wrapper(
|
|
91
|
+
robot_load_then_xray_centre(
|
|
92
|
+
composite, parameters.robot_load_then_centre, oav_config_file
|
|
93
|
+
),
|
|
94
|
+
flyscan_event_handler,
|
|
95
|
+
)
|
|
96
|
+
except CrystalNotFoundException:
|
|
97
|
+
if parameters.select_centres.ignore_xtal_not_found:
|
|
98
|
+
LOGGER.info("Ignoring crystal not found due to parameter settings.")
|
|
99
|
+
else:
|
|
100
|
+
raise
|
|
90
101
|
|
|
91
102
|
locations_to_collect_um: list[np.ndarray]
|
|
92
103
|
samples_to_collect: list[int]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dataclasses
|
|
2
2
|
import json
|
|
3
|
+
import os
|
|
3
4
|
import re
|
|
4
5
|
import traceback
|
|
5
6
|
from collections.abc import Sequence
|
|
@@ -27,7 +28,6 @@ from mx_bluesky.hyperion.parameters.components import Wait
|
|
|
27
28
|
from mx_bluesky.hyperion.parameters.load_centre_collect import LoadCentreCollect
|
|
28
29
|
|
|
29
30
|
T = TypeVar("T", bound=WithVisit)
|
|
30
|
-
AGAMEMNON_URL = "http://agamemnon.diamond.ac.uk/"
|
|
31
31
|
MULTIPIN_PREFIX = "multipin"
|
|
32
32
|
MULTIPIN_FORMAT_DESC = "Expected multipin format is multipin_{number_of_wells}x{well_size}+{distance_between_tip_and_first_well}"
|
|
33
33
|
MULTIPIN_REGEX = rf"^{MULTIPIN_PREFIX}_(\d+)x(\d+(?:\.\d+)?)\+(\d+(?:\.\d+)?)$"
|
|
@@ -191,7 +191,11 @@ def _get_pin_type_from_agamemnon_collect_parameters(
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
def _get_next_instruction(beamline: str) -> dict:
|
|
194
|
-
return _get_parameters_from_url(
|
|
194
|
+
return _get_parameters_from_url(get_agamemnon_url() + f"getnextcollect/{beamline}")
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def get_agamemnon_url() -> str:
|
|
198
|
+
return os.environ.get("AGAMEMNON_URL", "http://agamemnon.diamond.ac.uk/")
|
|
195
199
|
|
|
196
200
|
|
|
197
201
|
def _get_withvisit_parameters_from_agamemnon(parameters: dict) -> tuple:
|
|
@@ -56,6 +56,7 @@ class HyperionConstants:
|
|
|
56
56
|
PARAM = ExperimentParamConstants()
|
|
57
57
|
PLAN = PlanNameConstants()
|
|
58
58
|
WAIT = PlanGroupCheckpointConstants()
|
|
59
|
+
HYPERION_PORT = 5005
|
|
59
60
|
CALLBACK_0MQ_PROXY_PORTS = (5577, 5578)
|
|
60
61
|
DESCRIPTORS = DocDescriptorNames()
|
|
61
62
|
CONFIG_SERVER_URL = (
|
|
@@ -19,12 +19,10 @@ class PlanException(Exception):
|
|
|
19
19
|
class PlanRunner(BaseRunner):
|
|
20
20
|
"""Runner that executes experiments from inside a running Bluesky plan"""
|
|
21
21
|
|
|
22
|
-
def __init__(
|
|
23
|
-
self,
|
|
24
|
-
context: BlueskyContext,
|
|
25
|
-
) -> None:
|
|
22
|
+
def __init__(self, context: BlueskyContext, dev_mode: bool) -> None:
|
|
26
23
|
super().__init__(context)
|
|
27
24
|
self.current_status: Status = Status.IDLE
|
|
25
|
+
self.is_dev_mode = dev_mode
|
|
28
26
|
|
|
29
27
|
def execute_plan(
|
|
30
28
|
self,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from threading import Thread
|
|
2
|
+
|
|
3
|
+
from flask import Flask
|
|
4
|
+
from flask_restful import Api, Resource
|
|
5
|
+
|
|
6
|
+
from mx_bluesky.common.utils.log import LOGGER
|
|
7
|
+
from mx_bluesky.hyperion.parameters.constants import HyperionConstants
|
|
8
|
+
from mx_bluesky.hyperion.plan_runner import PlanRunner
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Ignore this function for code coverage as there is no way to shut down
|
|
12
|
+
# a server once it is started.
|
|
13
|
+
def create_server_for_udc(runner: PlanRunner) -> Thread: # pragma: no cover
|
|
14
|
+
"""Create a minimal API for Hyperion UDC mode"""
|
|
15
|
+
app = create_app_for_udc(runner)
|
|
16
|
+
|
|
17
|
+
flask_thread = Thread(
|
|
18
|
+
target=app.run,
|
|
19
|
+
kwargs={"host": "0.0.0.0", "port": HyperionConstants.HYPERION_PORT},
|
|
20
|
+
daemon=True,
|
|
21
|
+
)
|
|
22
|
+
flask_thread.start()
|
|
23
|
+
LOGGER.info(f"Hyperion now listening on {HyperionConstants.HYPERION_PORT}")
|
|
24
|
+
return flask_thread
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def create_app_for_udc(runner):
|
|
28
|
+
app = Flask(__name__)
|
|
29
|
+
api = Api(app)
|
|
30
|
+
api.add_resource(StatusResource, "/status", resource_class_args=[runner])
|
|
31
|
+
return app
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class StatusResource(Resource):
|
|
35
|
+
"""Status endpoint, used by k8s healthcheck probe"""
|
|
36
|
+
|
|
37
|
+
def __init__(self, runner: PlanRunner):
|
|
38
|
+
super().__init__()
|
|
39
|
+
self._runner = runner
|
|
40
|
+
|
|
41
|
+
def get(self):
|
|
42
|
+
status = self._runner.current_status
|
|
43
|
+
return {"status": status.value}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mx-bluesky
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.6
|
|
4
4
|
Summary: Bluesky tools for MX Beamlines at DLS
|
|
5
5
|
Author-email: Dominic Oram <dominic.oram@diamond.ac.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -241,7 +241,7 @@ Requires-Dist: blueapi>=0.15.0
|
|
|
241
241
|
Requires-Dist: ophyd>=1.10.5
|
|
242
242
|
Requires-Dist: ophyd-async>=0.10.0a2
|
|
243
243
|
Requires-Dist: bluesky>=1.13.1
|
|
244
|
-
Requires-Dist: dls-dodal==1.
|
|
244
|
+
Requires-Dist: dls-dodal==1.58.0
|
|
245
245
|
Provides-Extra: dev
|
|
246
246
|
Requires-Dist: black; extra == "dev"
|
|
247
247
|
Requires-Dist: build; extra == "dev"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
mx_bluesky/__init__.py,sha256=Ksms_WJF8LTkbm38gEpm1jBpGqcQ8NGvmb2ZJlOE1j8,198
|
|
2
2
|
mx_bluesky/__main__.py,sha256=RVqPnxDisFMIn_aoEi0drlThNHgKTJULnSrotouIKI0,480
|
|
3
|
-
mx_bluesky/_version.py,sha256
|
|
3
|
+
mx_bluesky/_version.py,sha256=QQqZfw9NtNbGfDbRcotOwsSjnkPxoC0YK5p72XSvf_s,704
|
|
4
4
|
mx_bluesky/definitions.py,sha256=ULpEYAUzdQiEbBoTgYTMxfUf3DDDjhYtvDxofs7Qxqw,168
|
|
5
5
|
mx_bluesky/jupyter_example.ipynb,sha256=wpwvPrBvwtRMS5AIFk8F54cIlUoD0o4ji8tKK5cZHA4,1672
|
|
6
6
|
mx_bluesky/beamlines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -79,7 +79,7 @@ mx_bluesky/common/device_setup_plans/utils.py,sha256=S_Us1KfLkyaRzWxmqnoVxHj2Suq
|
|
|
79
79
|
mx_bluesky/common/device_setup_plans/xbpm_feedback.py,sha256=WsUMdeOZBgbj-bFp7x66aHp2oWffQmjyp61-qmtQAmI,2153
|
|
80
80
|
mx_bluesky/common/experiment_plans/__init__.py,sha256=FMA-4VN1TJCPcyURKF0qPIQ8uo8YBbtHPRdJokVF4MA,129
|
|
81
81
|
mx_bluesky/common/experiment_plans/change_aperture_then_move_plan.py,sha256=407E9rp0yGWWIU1fJrgqK_hC19mVwRK-Und7fMlGNDc,3062
|
|
82
|
-
mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py,sha256=
|
|
82
|
+
mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py,sha256=h-RBnmzkgCtWyMVLOwPqKjNH-zu3mWzVP5IHze7mzpw,14146
|
|
83
83
|
mx_bluesky/common/experiment_plans/common_grid_detect_then_xray_centre_plan.py,sha256=jspOKPc3uxvG-a5-LXs7Yfwy8HTvGXBj4snke9j5gYE,7033
|
|
84
84
|
mx_bluesky/common/experiment_plans/oav_grid_detection_plan.py,sha256=gkRpRb3USUx7xDJk-1GghV-sxPp7wy5clubwhlx1v80,7162
|
|
85
85
|
mx_bluesky/common/experiment_plans/oav_snapshot_plan.py,sha256=8TRAvHG2W9bn1xb06bYZTWkfhT2q1EtfyxyiMMKmWcw,3623
|
|
@@ -117,7 +117,7 @@ mx_bluesky/common/external_interaction/nexus/__init__.py,sha256=47DEQpj8HBSa-_TI
|
|
|
117
117
|
mx_bluesky/common/external_interaction/nexus/nexus_utils.py,sha256=n97KHJJd_C59SOVJHcJ3RbNkvxkoUrF6fIJx3jXBuI0,5580
|
|
118
118
|
mx_bluesky/common/external_interaction/nexus/write_nexus.py,sha256=s8xT05_Fn_s64KbPOnR5cm-AooklMKRj2cXxLstl7e0,4067
|
|
119
119
|
mx_bluesky/common/parameters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
120
|
-
mx_bluesky/common/parameters/components.py,sha256=
|
|
120
|
+
mx_bluesky/common/parameters/components.py,sha256=wyejnv6DxSOrGzcMVRHZVHnund3pj6cTxTMU5v7JW5Q,8576
|
|
121
121
|
mx_bluesky/common/parameters/constants.py,sha256=iNv55VTv4QPu96z58pbnMiAE1RGsFKsTs4wahrlGihw,5139
|
|
122
122
|
mx_bluesky/common/parameters/device_composites.py,sha256=F_msgzMTzwIYXufkBwRCg47f5-Z4sJlQVbsWnUqjXSw,2253
|
|
123
123
|
mx_bluesky/common/parameters/gridscan.py,sha256=zTSFnOI6skbj2aX8YnbcbEYk67MnOWIaaukIST5KkBk,7048
|
|
@@ -132,9 +132,10 @@ mx_bluesky/common/utils/log.py,sha256=CepibF7U5GnN-ICl4bmhbEwqRzWsSFyfNtBDJejK0e
|
|
|
132
132
|
mx_bluesky/common/utils/tracing.py,sha256=stnBZIvPuKiAm2wVc8lFr3ns7V5C52rUigULi9V-IFs,1171
|
|
133
133
|
mx_bluesky/common/utils/utils.py,sha256=q2uCaK1E8zLVk1BFmj7qlTnQf3JRKjCjyadIVnL1-4M,1180
|
|
134
134
|
mx_bluesky/hyperion/__init__.py,sha256=f4E8wInL1Ll4eeFtAiyKmipOBTPlUtKmVK-m_LOQG4M,35
|
|
135
|
-
mx_bluesky/hyperion/__main__.py,sha256=
|
|
136
|
-
mx_bluesky/hyperion/baton_handler.py,sha256=
|
|
137
|
-
mx_bluesky/hyperion/plan_runner.py,sha256=
|
|
135
|
+
mx_bluesky/hyperion/__main__.py,sha256=NUgwa6xhs0LYx7ZJRQ6kcf0ju8oWTthMaGYi5Zzdm6M,7249
|
|
136
|
+
mx_bluesky/hyperion/baton_handler.py,sha256=vs_vwflSGSQwqyPFJxIDenURwL44Uu7mea_wA_fv7pM,9883
|
|
137
|
+
mx_bluesky/hyperion/plan_runner.py,sha256=YfhIgnrLFWl_Ls0wtgGaOrX29GhRXP9SAshTtCj2JjM,2828
|
|
138
|
+
mx_bluesky/hyperion/plan_runner_api.py,sha256=Kq-UyaI6q8eU98odTLBk2RoTiEJ9s7OqYo73k_ep9w4,1296
|
|
138
139
|
mx_bluesky/hyperion/runner.py,sha256=x683wuzL-XO1Ws4N2fpPO__TLhlep0br_-8ubml1qG0,7073
|
|
139
140
|
mx_bluesky/hyperion/device_setup_plans/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
140
141
|
mx_bluesky/hyperion/device_setup_plans/dcm_pitch_roll_mirror_adjuster.py,sha256=ciNdz_r9XGvghehpejdziL-aMw60oUsIJdVR3yz3nOo,5010
|
|
@@ -146,7 +147,7 @@ mx_bluesky/hyperion/experiment_plans/__init__.py,sha256=dJjwLk0EQP-1hKhbs8aRxTF_
|
|
|
146
147
|
mx_bluesky/hyperion/experiment_plans/experiment_registry.py,sha256=bGp2c3nKutqHMnDxuqjp6yCF-JKykSzX-IUfxk3oVlM,1701
|
|
147
148
|
mx_bluesky/hyperion/experiment_plans/hyperion_flyscan_xray_centre_plan.py,sha256=aaDnO_fWOesB7IUMtedinBaJUdliWZe47wxq9ECFoFY,6036
|
|
148
149
|
mx_bluesky/hyperion/experiment_plans/hyperion_grid_detect_then_xray_centre_plan.py,sha256=e4w4226ONSGQF2dnXzxOfcJ9i57CZIJrqQ1YCLlaBNo,2153
|
|
149
|
-
mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py,sha256=
|
|
150
|
+
mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py,sha256=obUMizdLRGt-uCLnEzwiCGHn8wqHt0OVo1uvVvivWr4,7675
|
|
150
151
|
mx_bluesky/hyperion/experiment_plans/optimise_attenuation_plan.py,sha256=5ZAH17F5T1YyVgA2ML0NEf4ufrD1G0jPRU0_5pINdTg,16195
|
|
151
152
|
mx_bluesky/hyperion/experiment_plans/pin_centre_then_xray_centre_plan.py,sha256=oErbq4ffTZVNR_LeiSJP8_q4cwdZWB-bdbrO3ZwKg20,5397
|
|
152
153
|
mx_bluesky/hyperion/experiment_plans/pin_tip_centring_plan.py,sha256=1g3vs2hSgEYGhwDoqB8VsWTZ4q_Hd37493n_csoLnI8,6248
|
|
@@ -155,7 +156,7 @@ mx_bluesky/hyperion/experiment_plans/robot_load_then_centre_plan.py,sha256=II-4v
|
|
|
155
156
|
mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py,sha256=jyJMN9atG99hmYG0i3lgrBK9Jx1SR4QVPFhZgA6Dl8s,15886
|
|
156
157
|
mx_bluesky/hyperion/experiment_plans/set_energy_plan.py,sha256=8FAqN-aJgRwZSiCX-hNdeGmaijt0l8owdShVBwNchfE,2643
|
|
157
158
|
mx_bluesky/hyperion/external_interaction/__init__.py,sha256=95DwXDmKsx36RgAL-AtLZl2LQoLPKbzeYdlkkP_4Coc,559
|
|
158
|
-
mx_bluesky/hyperion/external_interaction/agamemnon.py,sha256=
|
|
159
|
+
mx_bluesky/hyperion/external_interaction/agamemnon.py,sha256=B2Q7NR1VSRoCGg4hlCiZDrh2Fa0s4B4ZIws1H7oBfOk,12020
|
|
159
160
|
mx_bluesky/hyperion/external_interaction/config_server.py,sha256=UpxjOH0U3vm0R_RTPt00uYfQ2HiALGWRZgs8EHJO2os,491
|
|
160
161
|
mx_bluesky/hyperion/external_interaction/alerting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
161
162
|
mx_bluesky/hyperion/external_interaction/alerting/constants.py,sha256=8wE_MDF8vOqomQ6SBiwZKb1W4NRO_hmrBLVfLVnKdSg,170
|
|
@@ -171,7 +172,7 @@ mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py,sh
|
|
|
171
172
|
mx_bluesky/hyperion/parameters/__init__.py,sha256=kf2wfcILBUBpT0tJ8-W39BywQUkn67yxl9IVsfrr1LE,115
|
|
172
173
|
mx_bluesky/hyperion/parameters/cli.py,sha256=I-NY3Kt3la5HNUB4qRA6NtuxbJSr78yx-sM_cRx_pY4,1514
|
|
173
174
|
mx_bluesky/hyperion/parameters/components.py,sha256=eIUEcFNqcEad21IThSDatoX-NRa9GdfBOwt6ZUwb88U,292
|
|
174
|
-
mx_bluesky/hyperion/parameters/constants.py,sha256=
|
|
175
|
+
mx_bluesky/hyperion/parameters/constants.py,sha256=aCACWCp670o9U3AKfON-ntqkxIH-99gWNZvEN1G2rPc,2265
|
|
175
176
|
mx_bluesky/hyperion/parameters/device_composites.py,sha256=wXr0VH66Qm5xT0WBBy4hmXjONrAxieP3aAFdt0rM6kY,2139
|
|
176
177
|
mx_bluesky/hyperion/parameters/gridscan.py,sha256=DTHIo75xE2vU4iP0eXymGKoQARA1fd9fp2apKFU4C_I,3886
|
|
177
178
|
mx_bluesky/hyperion/parameters/load_centre_collect.py,sha256=8dlKwb7WmgDeohQ9QsdMWQMMM73EaC2cZ0wKg6vOP60,3727
|
|
@@ -183,9 +184,9 @@ mx_bluesky/hyperion/utils/context.py,sha256=yxMYn3YFET6SanFZ4YWXDmZDdp3WkaXhDc3y
|
|
|
183
184
|
mx_bluesky/phase1_zebra/__init__.py,sha256=Edhhn2L9MVXnjJhyD5_yKQVUDo7XW98rvuT7dlzIn58,132
|
|
184
185
|
mx_bluesky/phase1_zebra/device_setup_plans/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
185
186
|
mx_bluesky/phase1_zebra/device_setup_plans/setup_zebra.py,sha256=zfEnDvh5Rh9cPmg_Q_0EnJOZNIwIGmHeIDiJ9kg9Z4c,4129
|
|
186
|
-
mx_bluesky-1.5.
|
|
187
|
-
mx_bluesky-1.5.
|
|
188
|
-
mx_bluesky-1.5.
|
|
189
|
-
mx_bluesky-1.5.
|
|
190
|
-
mx_bluesky-1.5.
|
|
191
|
-
mx_bluesky-1.5.
|
|
187
|
+
mx_bluesky-1.5.6.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
188
|
+
mx_bluesky-1.5.6.dist-info/METADATA,sha256=abbn2o2DA2OC_X7U6waizV3uWFveQGglTtvZiSzpqOg,17424
|
|
189
|
+
mx_bluesky-1.5.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
190
|
+
mx_bluesky-1.5.6.dist-info/entry_points.txt,sha256=HgVtwgWoMRn9-X6rxCcSY3Jz_paspJTIlc-t2NFzWpo,409
|
|
191
|
+
mx_bluesky-1.5.6.dist-info/top_level.txt,sha256=S4rrzXIUef58ulf_04wn01XGZ3xeJjXs4LPEJ_xoF-I,11
|
|
192
|
+
mx_bluesky-1.5.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|