Add test to ensure all functions in beamline modules are devices or fixtures#1984
Draft
Add test to ensure all functions in beamline modules are devices or fixtures#1984
Conversation
Contributor
|
This fails due to i23 def _is_i23_machine():
"""Devices using PVA can only connect from i23 machines, due to the absence of
PVA gateways at present.
"""
hostname = get_hostname()
return hostname.startswith("i23-ws") or hostname.startswith("i23-control")
@devices.factory(skip=lambda: not _is_i23_machine())
def oav_pin_tip_detection() -> PinTipDetection:
return PinTipDetection(
f"{PREFIX.beamline_prefix}-DI-OAV-01:",
"pin_tip_detection",
)So there does seem to be a use case for defining functions in the beamline module that aren't decorated. The only solution to this is to move this function and have it be imported instead dodal/devices/beamlines/i23/utils -> is_i23_machine() i23.py from dodal.devices.beamlines.i23 import is_i23_machine
@devices.factory(skip=lambda: not _is_i23_machine())
def oav_pin_tip_detection() -> PinTipDetection:
return PinTipDetection(
f"{PREFIX.beamline_prefix}-DI-OAV-01:",
"pin_tip_detection",
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1981
Instructions to reviewer on how to test:
Checks for reviewer
dodal connect ${BEAMLINE}