From d3da0ed386fd44c5bf8639841ff222baca3d84fb Mon Sep 17 00:00:00 2001 From: Nick Waters Date: Tue, 11 Jun 2024 09:34:39 -0700 Subject: [PATCH 1/2] ENH: make beamline a list --- demo/db.json | 24 ++++++++++++++++++++++++ lucid/launcher.py | 10 ++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/demo/db.json b/demo/db.json index 51b333d..de66322 100644 --- a/demo/db.json +++ b/demo/db.json @@ -47,6 +47,30 @@ "invalid": true, "functional_group": "Vacuum", "location_group": "S 2" + }, + "TV5L0-VGC-1": { + "_id": "TV1L0-VGC-1", + "active": true, + "args": [], + "beamline": "DEMO_BEAMLINE", + "creation": "Tue Feb 27 10:41:25 2018", + "device_class": "ophyd.sim.SynAxis", + "kwargs": { + "name": "{{name}}" + }, + "last_edit": "Thu Apr 12 14:40:08 2018", + "macros": null, + "name": "tv1l0_vgc_1", + "parent": null, + "prefix": "TV1L0-VGC-1", + "screen": null, + "stand": "ST1", + "system": "Device", + "type": "pcdsdevices.happi.containers.LCLSItem", + "z": 1035.5, + "invalid": true, + "functional_group": "Vacuum", + "location_group": "S 3" } } diff --git a/lucid/launcher.py b/lucid/launcher.py index 79f92fd..0610b8f 100644 --- a/lucid/launcher.py +++ b/lucid/launcher.py @@ -13,6 +13,7 @@ from ophyd.signal import EpicsSignalBase from pydm import exception from qtpy import QtCore, QtWidgets +from typing import Optional, Union import lucid @@ -45,7 +46,8 @@ def get_parser(): parser.add_argument( 'beamline', help='Specify the beamline name to compose the home screen.', - type=str + type=str, + nargs='+' ) parser.add_argument( '--toolbar', @@ -103,9 +105,9 @@ def __init__(self, *args, beamline, group_keys, callbacks, **kwargs): def _load_from_happi(self, row_group_key, col_group_key): '''Fill with Data from Happi''' cli = lucid.utils.get_happi_client() - results = (cli.search(beamline=self.beamline, - active=True) - or []) + results = [] + for line in self.beamline: + results += cli.search(beamline=line, active=True) dev_groups = collections.defaultdict(list) From 75cb74bf0b08bc48afce524ead831e7e9ed55dbb Mon Sep 17 00:00:00 2001 From: Nick Waters Date: Tue, 11 Jun 2024 09:37:14 -0700 Subject: [PATCH 2/2] STY: remove unused imports --- lucid/launcher.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lucid/launcher.py b/lucid/launcher.py index 0610b8f..0b5ef3a 100644 --- a/lucid/launcher.py +++ b/lucid/launcher.py @@ -13,7 +13,6 @@ from ophyd.signal import EpicsSignalBase from pydm import exception from qtpy import QtCore, QtWidgets -from typing import Optional, Union import lucid @@ -107,7 +106,7 @@ def _load_from_happi(self, row_group_key, col_group_key): cli = lucid.utils.get_happi_client() results = [] for line in self.beamline: - results += cli.search(beamline=line, active=True) + results += cli.search(beamline=line, active=True) dev_groups = collections.defaultdict(list)