Skip to content

Commit

Permalink
Zocalo results multiple sources (#445)
Browse files Browse the repository at this point in the history
* Use warning instead of warn to get green ticks

* Add parameter to toggle zocalo GPU results

* Better spelling

---------

Co-authored-by: Dominic Oram <dominic.oram@diamond.ac.uk>
  • Loading branch information
olliesilvester and DominicOram committed Sep 23, 2024
1 parent 7e3eac5 commit d18abf7
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies = [
"ophyd == 1.9.0",
"ophyd-async >= 0.3a5",
"bluesky >= 1.13.0a4",
"dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@3f59ce090dd5c5f94f761b4b80a61cbd34d90564",
"dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@ff848a6984050b7c21cbf4b351cacb88a88cfbb1",
]


Expand Down
4 changes: 3 additions & 1 deletion src/mx_bluesky/hyperion/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ def get(self, **kwargs):
action = kwargs.get("action")
status_and_message = StatusAndMessage(Status.FAILED, f"{action} not understood")
if action == Actions.STATUS.value:
LOGGER.debug("Runner recieved status request")
LOGGER.debug(
f"Runner received status request - state of the runner object is: {self.runner.__dict__} - state of the RE is: {self.runner.RE.__dict__}"
)
status_and_message = self.runner.current_status
return asdict(status_and_message)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def flyscan_xray_centre(
parameters.features.update_self_from_server()
composite.eiger.set_detector_parameters(parameters.detector_params)
composite.zocalo.zocalo_environment = parameters.zocalo_environment
composite.zocalo.use_cpu_and_gpu = parameters.use_cpu_and_gpu_zocalo

feature_controlled = _get_feature_controlled(composite, parameters)

Expand Down Expand Up @@ -202,14 +203,14 @@ def run_gridscan_and_move(
)
else:
xray_centre = initial_xyz
LOGGER.warning("No X-ray centre recieved")
LOGGER.warning("No X-ray centre received")
if bbox_size is not None:
with TRACER.start_span("change_aperture"):
yield from set_aperture_for_bbox_size(
fgs_composite.aperture_scatterguard, bbox_size
)
else:
LOGGER.warning("No bounding box size recieved")
LOGGER.warning("No bounding box size received")

# once we have the results, go to the appropriate position
LOGGER.info("Moving to centre of mass.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def wait_for_threads_forever(threads: Sequence[Thread]):
sleep(LIVENESS_POLL_SECONDS)
alive = [t.is_alive() for t in threads]
except KeyboardInterrupt:
log_info("Main thread recieved interrupt - exiting.")
log_info("Main thread received interrupt - exiting.")
else:
log_info("Proxy or dispatcher thread ended - exiting.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def activity_gated_event(self, doc: Event) -> Event:
case _:
return self._tag_doc(doc)
self.ispyb_ids = self.ispyb.update_deposition(self.ispyb_ids, scan_data_infos)
ISPYB_LOGGER.info(f"Recieved ISPYB IDs: {self.ispyb_ids}")
ISPYB_LOGGER.info(f"Received ISPYB IDs: {self.ispyb_ids}")
return self._tag_doc(doc)

def _handle_ispyb_hardware_read(self, doc) -> Sequence[ScanDataInfo]:
Expand Down
1 change: 1 addition & 0 deletions src/mx_bluesky/hyperion/parameters/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class I03Constants:
USE_PANDA_FOR_GRIDSCAN = False
USE_GPU_FOR_GRIDSCAN_ANALYSIS = False
THAWING_TIME = 20
USE_CPU_AND_GPU_ZOCALO = False


@dataclass(frozen=True)
Expand Down
1 change: 1 addition & 0 deletions src/mx_bluesky/hyperion/parameters/gridscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class GridCommon(
)
use_panda: bool = Field(default=CONST.I03.USE_PANDA_FOR_GRIDSCAN)
use_gpu: bool = Field(default=CONST.I03.USE_GPU_FOR_GRIDSCAN_ANALYSIS)
use_cpu_and_gpu_zocalo: bool = Field(default=CONST.I03.USE_CPU_AND_GPU_ZOCALO)
ispyb_experiment_type: IspybExperimentType = Field(
default=IspybExperimentType.GRIDSCAN_3D
)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def assert_doc(
matches_fields: dict[str, Any] = {}, # noqa
does_exist: bool = True,
):
"""Assert that a matching doc has been recieved by the sim,
"""Assert that a matching doc has been received by the sim,
and returns the first match if it is meant to exist"""
matches = DocumentCapturer.get_matches(docs, name, has_fields, matches_fields)
if does_exist:
Expand Down

0 comments on commit d18abf7

Please sign in to comment.