From ea8891e57ec37eeb758cc8cff2b390536aa48acd Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Fri, 26 Jul 2024 11:39:11 +0100 Subject: [PATCH 01/16] b01-1 draft --- src/dodal/beamlines/b01-1.py | 98 ++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/dodal/beamlines/b01-1.py diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py new file mode 100644 index 0000000000..51702b1984 --- /dev/null +++ b/src/dodal/beamlines/b01-1.py @@ -0,0 +1,98 @@ +from ophyd_async.epics.areadetector import AravisDetector + +from dodal.common.beamlines.beamline_utils import ( + device_instantiation, + set_directory_provider, +) +from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline +from dodal.common.udc_directory_provider import PandASubdirectoryProvider +from dodal.devices.webcam import Webcam +from dodal.log import set_beamline as set_log_beamline +from dodal.utils import BeamlinePrefix, get_beamline_name +from ophyd_async.core import StaticDirectoryProvider + +BL = get_beamline_name("BL01C") +set_log_beamline(BL) +set_utils_beamline(BL) + + +static_directory_provider = StaticDirectoryProvider("/tmp/bluesky_test_static") +# set_directory_provider(PandASubdirectoryProvider()) + + + +# def panda_fast_grid_scan( +# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +# ) -> PandAFastGridScan: +# """Get the i03 panda_fast_grid_scan device, instantiate it if it hasn't already been. +# If this is called when already instantiated in i03, it will return the existing object. +# This is used instead of the zebra_fast_grid_scan device when using the PandA. +# """ +# return device_instantiation( +# device_factory=PandAFastGridScan, +# name="panda_fast_grid_scan", +# prefix="-MO-SGON-01:", +# wait=wait_for_connection, +# fake=fake_with_ophyd_sim, +# ) + + +# @skip_device(lambda: BL == "s03") +# def synchrotron( +# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +# ) -> Synchrotron: +# """Get the i03 synchrotron device, instantiate it if it hasn't already been. +# If this is called when already instantiated in i03, it will return the existing object. +# """ +# return device_instantiation( +# Synchrotron, +# "synchrotron", +# "", +# wait_for_connection, +# fake_with_ophyd_sim, +# bl_prefix=False, +# ) + +# def panda( +# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +# ) -> HDFPanda: +# """Get the i03 panda device, instantiate it if it hasn't already been. +# If this is called when already instantiated in i03, it will return the existing object. +# """ +# return device_instantiation( +# HDFPanda, +# "panda", +# "-EA-PANDA-01:", +# wait_for_connection, +# fake_with_ophyd_sim, +# directory_provider=get_directory_provider(), +# ) + + +def webcam( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> Webcam: + """Get the i03 webcam, instantiate it if it hasn't already been. + If this is called when already instantiated in i03, it will return the existing object. + """ + return device_instantiation( + Webcam, + "webcam", + "", + wait_for_connection, + fake_with_ophyd_sim, + url="http://i03-webcam1/axis-cgi/jpg/image.cgi", + ) + + +# def manta( +# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +# ) -> AravisDetector: +# return device_instantiation( +# AravisDetector, +# "manta", +# "-DI-DCAM-02:", +# wait_for_connection, +# fake_with_ophyd_sim, +# directory_provider=static_directory_provider, +# ) From 5d67bab54d8bd35fe5dca4a676958967c994d809 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Fri, 26 Jul 2024 11:45:43 +0100 Subject: [PATCH 02/16] trying to conntect a panda --- src/dodal/beamlines/b01-1.py | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index 51702b1984..10b59dacf6 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -1,17 +1,16 @@ -from ophyd_async.epics.areadetector import AravisDetector +from ophyd_async.core import StaticDirectoryProvider +from ophyd_async.panda import HDFPanda from dodal.common.beamlines.beamline_utils import ( device_instantiation, - set_directory_provider, ) from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline -from dodal.common.udc_directory_provider import PandASubdirectoryProvider from dodal.devices.webcam import Webcam from dodal.log import set_beamline as set_log_beamline -from dodal.utils import BeamlinePrefix, get_beamline_name -from ophyd_async.core import StaticDirectoryProvider +from dodal.utils import get_beamline_name -BL = get_beamline_name("BL01C") +# BL = get_beamline_name("BL01C") +BL = "c01" set_log_beamline(BL) set_utils_beamline(BL) @@ -21,20 +20,21 @@ -# def panda_fast_grid_scan( -# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -# ) -> PandAFastGridScan: -# """Get the i03 panda_fast_grid_scan device, instantiate it if it hasn't already been. -# If this is called when already instantiated in i03, it will return the existing object. -# This is used instead of the zebra_fast_grid_scan device when using the PandA. -# """ -# return device_instantiation( -# device_factory=PandAFastGridScan, -# name="panda_fast_grid_scan", -# prefix="-MO-SGON-01:", -# wait=wait_for_connection, -# fake=fake_with_ophyd_sim, -# ) +def panda( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> HDFPanda: + """Get the i03 panda_fast_grid_scan device, instantiate it if it hasn't already been. + If this is called when already instantiated in i03, it will return the existing object. + This is used instead of the zebra_fast_grid_scan device when using the PandA. + """ + return device_instantiation( + device_factory=HDFPanda, + name="panda", + prefix="-EA-PANDA-01-0:", + wait=wait_for_connection, + fake=fake_with_ophyd_sim, + directory_provider=static_directory_provider, + ) # @skip_device(lambda: BL == "s03") From f568d3bdf67a208d90d04ef7d7ad6c242b71b437 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Fri, 26 Jul 2024 13:51:52 +0100 Subject: [PATCH 03/16] fix pv value --- src/dodal/beamlines/b01-1.py | 37 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index 10b59dacf6..0e9aa3606e 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -30,7 +30,8 @@ def panda( return device_instantiation( device_factory=HDFPanda, name="panda", - prefix="-EA-PANDA-01-0:", + prefix="-EA-PANDA-01", + # prefix="-EA-PANDA-01:CLOCK:PVI_PV", wait=wait_for_connection, fake=fake_with_ophyd_sim, directory_provider=static_directory_provider, @@ -53,37 +54,23 @@ def panda( # bl_prefix=False, # ) -# def panda( + +# todo this should use the right URL +# def webcam( # wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -# ) -> HDFPanda: -# """Get the i03 panda device, instantiate it if it hasn't already been. +# ) -> Webcam: +# """Get the i03 webcam, instantiate it if it hasn't already been. # If this is called when already instantiated in i03, it will return the existing object. # """ # return device_instantiation( -# HDFPanda, -# "panda", -# "-EA-PANDA-01:", +# Webcam, +# "webcam", +# "", # wait_for_connection, # fake_with_ophyd_sim, -# directory_provider=get_directory_provider(), +# url="http://i03-webcam1/axis-cgi/jpg/image.cgi", # ) - - -def webcam( - wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -) -> Webcam: - """Get the i03 webcam, instantiate it if it hasn't already been. - If this is called when already instantiated in i03, it will return the existing object. - """ - return device_instantiation( - Webcam, - "webcam", - "", - wait_for_connection, - fake_with_ophyd_sim, - url="http://i03-webcam1/axis-cgi/jpg/image.cgi", - ) - +# # def manta( # wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False From 62b2171782c048f768acc244ed63d009f30d3875 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Fri, 26 Jul 2024 14:22:02 +0100 Subject: [PATCH 04/16] delete panda2 --- src/dodal/beamlines/b01-1.py | 38 +++++++++++------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index 0e9aa3606e..8d6e82cb83 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -55,31 +55,15 @@ def panda( # ) -# todo this should use the right URL -# def webcam( -# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -# ) -> Webcam: -# """Get the i03 webcam, instantiate it if it hasn't already been. -# If this is called when already instantiated in i03, it will return the existing object. -# """ -# return device_instantiation( -# Webcam, -# "webcam", -# "", -# wait_for_connection, -# fake_with_ophyd_sim, -# url="http://i03-webcam1/axis-cgi/jpg/image.cgi", -# ) -# +def manta( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False + ) -> AravisDetector: + return device_instantiation( + AravisDetector, + "manta", + "-DI-DCAM-02:", + wait_for_connection, + fake_with_ophyd_sim, + directory_provider=static_directory_provider, + ) -# def manta( -# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -# ) -> AravisDetector: -# return device_instantiation( -# AravisDetector, -# "manta", -# "-DI-DCAM-02:", -# wait_for_connection, -# fake_with_ophyd_sim, -# directory_provider=static_directory_provider, -# ) From ea8fa75e6a15aa73dd1510fa4b7cbf3432e6291b Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Thu, 1 Aug 2024 16:05:41 +0100 Subject: [PATCH 05/16] fix the values --- src/dodal/beamlines/b01-1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index 8d6e82cb83..df78972462 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -1,5 +1,6 @@ from ophyd_async.core import StaticDirectoryProvider from ophyd_async.panda import HDFPanda +from ophyd_async.epics.areadetector import AravisDetector from dodal.common.beamlines.beamline_utils import ( device_instantiation, @@ -65,5 +66,7 @@ def manta( wait_for_connection, fake_with_ophyd_sim, directory_provider=static_directory_provider, + drv_suffix="CAM:", + hdf_suffix="HDF5:", ) From 14bb31e312bc82c4c94c92832e21cc38586b7c9b Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Thu, 1 Aug 2024 16:09:22 +0100 Subject: [PATCH 06/16] fix panda missing colon --- src/dodal/beamlines/b01-1.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index df78972462..2ed608fdf0 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -31,8 +31,7 @@ def panda( return device_instantiation( device_factory=HDFPanda, name="panda", - prefix="-EA-PANDA-01", - # prefix="-EA-PANDA-01:CLOCK:PVI_PV", + prefix="-EA-PANDA-01:", wait=wait_for_connection, fake=fake_with_ophyd_sim, directory_provider=static_directory_provider, From ad4560d43a14fc407db04db4e258d697ed87b331 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Fri, 16 Aug 2024 11:13:37 +0100 Subject: [PATCH 07/16] fix ruff --- src/dodal/beamlines/b01-1.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index 2ed608fdf0..88692764ca 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -1,14 +1,12 @@ from ophyd_async.core import StaticDirectoryProvider -from ophyd_async.panda import HDFPanda from ophyd_async.epics.areadetector import AravisDetector +from ophyd_async.panda import HDFPanda from dodal.common.beamlines.beamline_utils import ( device_instantiation, ) from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline -from dodal.devices.webcam import Webcam from dodal.log import set_beamline as set_log_beamline -from dodal.utils import get_beamline_name # BL = get_beamline_name("BL01C") BL = "c01" From e79326938cbd2b0840cfdcc57c8fb5ae319b8c00 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Fri, 16 Aug 2024 11:16:40 +0100 Subject: [PATCH 08/16] another ruff change --- src/dodal/beamlines/b01-1.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index 88692764ca..d2b29084e7 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -18,7 +18,6 @@ # set_directory_provider(PandASubdirectoryProvider()) - def panda( wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False ) -> HDFPanda: @@ -54,16 +53,15 @@ def panda( def manta( - wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False - ) -> AravisDetector: - return device_instantiation( - AravisDetector, - "manta", - "-DI-DCAM-02:", - wait_for_connection, - fake_with_ophyd_sim, - directory_provider=static_directory_provider, - drv_suffix="CAM:", - hdf_suffix="HDF5:", - ) - + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> AravisDetector: + return device_instantiation( + AravisDetector, + "manta", + "-DI-DCAM-02:", + wait_for_connection, + fake_with_ophyd_sim, + directory_provider=static_directory_provider, + drv_suffix="CAM:", + hdf_suffix="HDF5:", + ) From 27cb4e10777977ee6212912b9515ebccea0eb48a Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Tue, 27 Aug 2024 10:14:59 +0000 Subject: [PATCH 09/16] respond to PR feedback --- src/dodal/beamlines/b01-1.py | 37 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01-1.py index d2b29084e7..958451a0cb 100644 --- a/src/dodal/beamlines/b01-1.py +++ b/src/dodal/beamlines/b01-1.py @@ -6,25 +6,22 @@ device_instantiation, ) from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline +from dodal.devices.synchrotron import Synchrotron from dodal.log import set_beamline as set_log_beamline +from dodal.utils import get_beamline_name -# BL = get_beamline_name("BL01C") -BL = "c01" +BL = get_beamline_name("c01") # noqa: F821 set_log_beamline(BL) set_utils_beamline(BL) static_directory_provider = StaticDirectoryProvider("/tmp/bluesky_test_static") -# set_directory_provider(PandASubdirectoryProvider()) +# set_directory_provider(StaticDirectoryProvider("/dls/b01-1/data/")) def panda( wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False ) -> HDFPanda: - """Get the i03 panda_fast_grid_scan device, instantiate it if it hasn't already been. - If this is called when already instantiated in i03, it will return the existing object. - This is used instead of the zebra_fast_grid_scan device when using the PandA. - """ return device_instantiation( device_factory=HDFPanda, name="panda", @@ -35,21 +32,17 @@ def panda( ) -# @skip_device(lambda: BL == "s03") -# def synchrotron( -# wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False -# ) -> Synchrotron: -# """Get the i03 synchrotron device, instantiate it if it hasn't already been. -# If this is called when already instantiated in i03, it will return the existing object. -# """ -# return device_instantiation( -# Synchrotron, -# "synchrotron", -# "", -# wait_for_connection, -# fake_with_ophyd_sim, -# bl_prefix=False, -# ) +def synchrotron( + wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False +) -> Synchrotron: + return device_instantiation( + Synchrotron, + "synchrotron", + "", + wait_for_connection, + fake_with_ophyd_sim, + bl_prefix=False, + ) def manta( From 94be03e4023e1e433268400d2003869bbd77942f Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 9 Sep 2024 11:21:32 +0100 Subject: [PATCH 10/16] switch up the module name to be valid Python --- src/dodal/beamlines/{b01-1.py => b01_1.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/dodal/beamlines/{b01-1.py => b01_1.py} (100%) diff --git a/src/dodal/beamlines/b01-1.py b/src/dodal/beamlines/b01_1.py similarity index 100% rename from src/dodal/beamlines/b01-1.py rename to src/dodal/beamlines/b01_1.py From f0e1cdac54fd8965cdc8fbcef368636c8f786be7 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Thu, 12 Sep 2024 13:34:16 +0100 Subject: [PATCH 11/16] respond to the ophyd-async changes --- src/dodal/beamlines/b01_1.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/dodal/beamlines/b01_1.py b/src/dodal/beamlines/b01_1.py index 958451a0cb..c99b97db08 100644 --- a/src/dodal/beamlines/b01_1.py +++ b/src/dodal/beamlines/b01_1.py @@ -1,11 +1,17 @@ -from ophyd_async.core import StaticDirectoryProvider +from pathlib import Path + +from ophyd_async.epics.adaravis import AravisDetector from ophyd_async.epics.areadetector import AravisDetector +from ophyd_async.fastcs.panda import HDFPanda from ophyd_async.panda import HDFPanda from dodal.common.beamlines.beamline_utils import ( device_instantiation, + get_path_provider, + set_path_provider, ) from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline +from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider from dodal.devices.synchrotron import Synchrotron from dodal.log import set_beamline as set_log_beamline from dodal.utils import get_beamline_name @@ -14,9 +20,13 @@ set_log_beamline(BL) set_utils_beamline(BL) - -static_directory_provider = StaticDirectoryProvider("/tmp/bluesky_test_static") -# set_directory_provider(StaticDirectoryProvider("/dls/b01-1/data/")) +set_path_provider( + StaticVisitPathProvider( + BL, + Path("/dls/b01-1/data/"), + client=LocalDirectoryServiceClient(), + ) +) def panda( @@ -28,7 +38,7 @@ def panda( prefix="-EA-PANDA-01:", wait=wait_for_connection, fake=fake_with_ophyd_sim, - directory_provider=static_directory_provider, + path_provider=get_path_provider(), ) @@ -54,7 +64,7 @@ def manta( "-DI-DCAM-02:", wait_for_connection, fake_with_ophyd_sim, - directory_provider=static_directory_provider, + path_provider=get_path_provider(), drv_suffix="CAM:", hdf_suffix="HDF5:", ) From d43a2999b49d2f1622fd9f275bfbc5ae429bf349 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Fri, 13 Sep 2024 08:35:44 +0000 Subject: [PATCH 12/16] fix imports --- src/dodal/beamlines/b01_1.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/dodal/beamlines/b01_1.py b/src/dodal/beamlines/b01_1.py index c99b97db08..8439a418c7 100644 --- a/src/dodal/beamlines/b01_1.py +++ b/src/dodal/beamlines/b01_1.py @@ -1,9 +1,7 @@ from pathlib import Path from ophyd_async.epics.adaravis import AravisDetector -from ophyd_async.epics.areadetector import AravisDetector from ophyd_async.fastcs.panda import HDFPanda -from ophyd_async.panda import HDFPanda from dodal.common.beamlines.beamline_utils import ( device_instantiation, From 39d8841e26f8384c0e38be60c57574419cf4ab21 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 16 Sep 2024 13:18:17 +0100 Subject: [PATCH 13/16] for visr allow overriding the pv --- src/dodal/beamlines/b01_1.py | 2 +- src/dodal/utils.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dodal/beamlines/b01_1.py b/src/dodal/beamlines/b01_1.py index 8439a418c7..7fdfbec732 100644 --- a/src/dodal/beamlines/b01_1.py +++ b/src/dodal/beamlines/b01_1.py @@ -14,7 +14,7 @@ from dodal.log import set_beamline as set_log_beamline from dodal.utils import get_beamline_name -BL = get_beamline_name("c01") # noqa: F821 +BL = get_beamline_name("c01", force_default=True) # noqa: F821 set_log_beamline(BL) set_utils_beamline(BL) diff --git a/src/dodal/utils.py b/src/dodal/utils.py index e11b8f2ca5..e660b9b7bc 100644 --- a/src/dodal/utils.py +++ b/src/dodal/utils.py @@ -68,7 +68,9 @@ AnyDeviceFactory: TypeAlias = V1DeviceFactory | V2DeviceFactory -def get_beamline_name(default: str) -> str: +def get_beamline_name(default: str, force_default: bool = False) -> str: + if force_default: + return default return environ.get("BEAMLINE") or default @@ -149,6 +151,7 @@ def make_all_devices( """ if isinstance(module, str) or module is None: module = import_module(module or __name__) + print(module.BL) factories = collect_factories(module, include_skipped) devices: tuple[dict[str, AnyDevice], dict[str, Exception]] = invoke_factories( factories, **kwargs From 6b4a7f1e01520da892f161235f6898a56de3a18e Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Wed, 18 Sep 2024 16:54:29 +0100 Subject: [PATCH 14/16] remove print --- src/dodal/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dodal/utils.py b/src/dodal/utils.py index e660b9b7bc..d26a6de8d6 100644 --- a/src/dodal/utils.py +++ b/src/dodal/utils.py @@ -151,7 +151,6 @@ def make_all_devices( """ if isinstance(module, str) or module is None: module = import_module(module or __name__) - print(module.BL) factories = collect_factories(module, include_skipped) devices: tuple[dict[str, AnyDevice], dict[str, Exception]] = invoke_factories( factories, **kwargs From 2f742136e4c220514671485f3e68a14c028cc6df Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Mon, 30 Sep 2024 11:28:39 +0100 Subject: [PATCH 15/16] directly set the beamline name --- src/dodal/beamlines/b01_1.py | 3 +-- src/dodal/utils.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/dodal/beamlines/b01_1.py b/src/dodal/beamlines/b01_1.py index 7fdfbec732..2bc399d0dc 100644 --- a/src/dodal/beamlines/b01_1.py +++ b/src/dodal/beamlines/b01_1.py @@ -12,9 +12,8 @@ from dodal.common.visit import LocalDirectoryServiceClient, StaticVisitPathProvider from dodal.devices.synchrotron import Synchrotron from dodal.log import set_beamline as set_log_beamline -from dodal.utils import get_beamline_name -BL = get_beamline_name("c01", force_default=True) # noqa: F821 +BL = "c01" set_log_beamline(BL) set_utils_beamline(BL) diff --git a/src/dodal/utils.py b/src/dodal/utils.py index d26a6de8d6..e11b8f2ca5 100644 --- a/src/dodal/utils.py +++ b/src/dodal/utils.py @@ -68,9 +68,7 @@ AnyDeviceFactory: TypeAlias = V1DeviceFactory | V2DeviceFactory -def get_beamline_name(default: str, force_default: bool = False) -> str: - if force_default: - return default +def get_beamline_name(default: str) -> str: return environ.get("BEAMLINE") or default From f0d3dfc5114d2d5e85924f82f86145368134c0d8 Mon Sep 17 00:00:00 2001 From: Stanislaw Malinowski Date: Tue, 1 Oct 2024 10:07:00 +0100 Subject: [PATCH 16/16] note explaining connection only on the bl network --- src/dodal/beamlines/b01_1.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dodal/beamlines/b01_1.py b/src/dodal/beamlines/b01_1.py index 2bc399d0dc..abc4e91b27 100644 --- a/src/dodal/beamlines/b01_1.py +++ b/src/dodal/beamlines/b01_1.py @@ -25,6 +25,16 @@ ) ) +""" +NOTE: Due to ArgoCD and the k8s cluster configuration those PVs are not available remotely. +You need to be on the beamline-local network to access them. +The simplest way to do this is to `ssh b01-1-ws001` and run `dodal connect b01_1` from there. +remember about the underscore in the beamline name. + +See the IOC status here: +https://argocd.diamond.ac.uk/applications?showFavorites=false&proj=&sync=&autoSync=&health=&namespace=&cluster=&labels= +""" + def panda( wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False