-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate p38 to i22 #862
base: main
Are you sure you want to change the base?
migrate p38 to i22 #862
Conversation
@pytest.fixture(scope="function")
def module_and_devices_for_beamline(request):
beamline = request.param
with patch.dict(os.environ, {"BEAMLINE": beamline}, clear=True):
bl_mod = importlib.import_module("dodal.beamlines." + beamline)
importlib.reload(bl_mod)
mock_beamline_module_filepaths(beamline, bl_mod)
devices, _ = make_all_devices(
bl_mod,
include_skipped=True,
fake_with_ophyd_sim=True,
)
yield (bl_mod, devices)
beamline_utils.clear_devices()
del bl_mod
the conftest is very opinionated and overriding it 'from the other file' seems impossible, the quick and easy way to fix is it to use another conftest, or add some param to the fixture to skip the os environ patch if it's a lab beamline @DominicOram , @callumforrester please share your perspectives |
e9fed56
to
6e611f2
Compare
f"/dls/${'p38' if IS_LAB else 'i22'}/data/2024/cm37271-2/bluesky" | ||
) | ||
API_URL: str = f"http://{'p38' if IS_LAB else 'i22'}-control:8088/api" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should: I think BL
contains p38
or i22
string can't we use that rather than the if statement here?
Sorry, I'm not sure I understand. You can override the On a side-note I would be careful about merging this until we have fixed #864 as it could be masking errors. |
@@ -25,10 +25,18 @@ | |||
from dodal.utils import BeamlinePrefix, get_beamline_name | |||
|
|||
BL = get_beamline_name("i22") | |||
IS_LAB = BL == "p38" | |||
LINKAM_IS_IN_LAB = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should: Our current design for beamlines where some equipment may or may not be there is to try to initialise every device, report the failures and move on, so we should always try to connect the linkam.
Fixes #502
Instructions to reviewer on how to test:
BEAMLINE=p38 dodal connect i22
Checks for reviewer
dodal connect ${BEAMLINE}