Skip to content

Commit

Permalink
(DiamondLightSource/hyperion#1017) Add ispyb robot load to instantiat…
Browse files Browse the repository at this point in the history
…ed callbacks
  • Loading branch information
DominicOram committed Apr 4, 2024
1 parent 91417ea commit ee66021
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/hyperion/experiment_plans/experiment_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from hyperion.external_interaction.callbacks.common.callback_util import (
CallbacksFactory,
create_gridscan_callbacks,
create_robot_load_and_centre_callbacks,
create_rotation_callbacks,
)
from hyperion.parameters.plan_specific.grid_scan_with_edge_detect_params import (
Expand Down Expand Up @@ -101,7 +102,7 @@ class ExperimentRegistryEntry(TypedDict):
"setup": robot_load_then_centre_plan.create_devices,
"internal_param_type": RobotLoadThenCentreInternalParameters,
"experiment_param_type": RobotLoadThenCentreParams,
"callbacks_factory": create_gridscan_callbacks,
"callbacks_factory": create_robot_load_and_centre_callbacks,
},
}
EXPERIMENT_NAMES = list(PLAN_REGISTRY.keys())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

from bluesky.callbacks import CallbackBase

from hyperion.external_interaction.callbacks.robot_load.ispyb_callback import (
RobotLoadISPyBCallback,
)
from hyperion.external_interaction.callbacks.rotation.ispyb_callback import (
RotationISPyBCallback,
)
Expand All @@ -16,7 +19,17 @@
)
from hyperion.external_interaction.callbacks.zocalo_callback import ZocaloCallback

CallbacksFactory = Callable[[], Tuple[CallbackBase, CallbackBase]]
CallbacksFactory = Callable[[], Tuple[CallbackBase, ...]]


def create_robot_load_and_centre_callbacks() -> (
Tuple[GridscanNexusFileCallback, GridscanISPyBCallback, RobotLoadISPyBCallback]
):
return (
GridscanNexusFileCallback(),
GridscanISPyBCallback(emit=ZocaloCallback()),
RobotLoadISPyBCallback(),
)


def create_gridscan_callbacks() -> (
Expand Down

0 comments on commit ee66021

Please sign in to comment.