From 2757e9e3d73f8b1daf0c2f32962c685af7338b37 Mon Sep 17 00:00:00 2001 From: Mark Smith Date: Thu, 4 Apr 2024 16:49:38 +0200 Subject: [PATCH 1/3] add smog to bkquery --- ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py b/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py index 13f4786438..e35e90c931 100644 --- a/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py +++ b/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py @@ -98,6 +98,8 @@ class BKQuery(GangaObject): schema['check_archived'] = SimpleItem(defvalue=True, typelist=['bool'], doc='Check if the data set is archived') schema['ignore_archived'] = SimpleItem(defvalue=False, typelist=['bool'], doc='Return the data set, even if all the LFNs are archived') + schema['SMOG2'] = SimpleItem(defvalue=None, typelist=['str', 'list'], + doc='Specify the state of SMOG2') _schema = Schema(Version(1, 2), schema) _category = 'query' _name = "BKQuery" From 37e1161191727a083c2d646797a92c112bf83feb Mon Sep 17 00:00:00 2001 From: Mark Smith Date: Mon, 20 May 2024 12:48:39 +0200 Subject: [PATCH 2/3] add smog option for BKQuery --- ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py | 10 +++++----- ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py b/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py index e35e90c931..188511a799 100644 --- a/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py +++ b/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py @@ -98,7 +98,7 @@ class BKQuery(GangaObject): schema['check_archived'] = SimpleItem(defvalue=True, typelist=['bool'], doc='Check if the data set is archived') schema['ignore_archived'] = SimpleItem(defvalue=False, typelist=['bool'], doc='Return the data set, even if all the LFNs are archived') - schema['SMOG2'] = SimpleItem(defvalue=None, typelist=['str', 'list'], + schema['SMOG2'] = SimpleItem(defvalue='', typelist=['str', 'list'], doc='Specify the state of SMOG2') _schema = Schema(Version(1, 2), schema) _category = 'query' @@ -126,13 +126,13 @@ def getDatasetMetadata(self): if self.selection: msg = 'selection not supported for type="%s".' % self.type raise GangaException(msg) - cmd = "getDataset('%s','%s','%s','%s','%s','%s')" % (self.path, self.dqflag, - self.type, self.startDate, self.endDate, self.selection) + cmd = "getDataset('%s','%s','%s','%s','%s','%s', '%s')" % (self.path, self.dqflag, + self.type, self.startDate, self.endDate, self.selection, self.SMOG2) from GangaCore.GPIDev.Lib.GangaList.GangaList import GangaList knownLists = [tuple, list, GangaList] if isType(self.dqflag, knownLists): - cmd = "getDataset('%s',%s,'%s','%s','%s','%s')" % (self.path, self.dqflag, - self.type, self.startDate, self.endDate, self.selection) + cmd = "getDataset('%s',%s,'%s','%s','%s','%s', '%s')" % (self.path, self.dqflag, + self.type, self.startDate, self.endDate, self.selection, self.SMOG2) try: value = get_result(cmd, 'BK query error.', credential_requirements=self.credential_requirements) diff --git a/ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py b/ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py index c76e850dfb..c2d5cf66bd 100644 --- a/ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py +++ b/ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py @@ -38,16 +38,16 @@ def bookkeepingGUI(file): @diracCommand -def getDataset(path, dqflag, this_type, start, end, sel): +def getDataset(path, dqflag, this_type, start, end, sel, smog=None): if this_type == 'Path': - result = dirac.bkQueryPath(path, dqflag) # dirac + result = dirac.bkQueryPath(path, dqflag, SMOG2=smog) # dirac elif this_type == 'RunsByDate': result = dirac.bkQueryRunsByDate(path, start, end, - dqflag, sel) # dirac + dqflag, sel, SMOG2=smog) # dirac elif this_type == 'Run': - result = dirac.bkQueryRun(path, dqflag) # dirac + result = dirac.bkQueryRun(path, dqflag, SMOG2=smog) # dirac elif this_type == 'Production': - result = dirac.bkQueryProduction(path, dqflag) # dirac + result = dirac.bkQueryProduction(path, dqflag, SMOG2=smog) # dirac else: result = {'OK': False, 'Message': 'Unsupported type!'} From 322758873ae2985c497602eeaa6659a22b92d454 Mon Sep 17 00:00:00 2001 From: Mark Smith Date: Fri, 24 May 2024 12:47:10 +0200 Subject: [PATCH 3/3] add smog --- ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py b/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py index 188511a799..6312ce76bf 100644 --- a/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py +++ b/ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py @@ -169,13 +169,13 @@ def getDataset(self, compressed=True, SE=None): if self.selection: msg = 'selection not supported for type="%s".' % self.type raise GangaException(msg) - cmd = "getDataset('%s','%s','%s','%s','%s','%s')" % (self.path, self.dqflag, - self.type, self.startDate, self.endDate, self.selection) + cmd = "getDataset('%s','%s','%s','%s','%s','%s', %s)" % (self.path, self.dqflag, + self.type, self.startDate, self.endDate, self.selection, self.SMOG2) from GangaCore.GPIDev.Lib.GangaList.GangaList import GangaList knownLists = [tuple, list, GangaList] if isType(self.dqflag, knownLists): - cmd = "getDataset('%s',%s,'%s','%s','%s','%s')" % (self.path, self.dqflag, self.type, self.startDate, - self.endDate, self.selection) + cmd = "getDataset('%s',%s,'%s','%s','%s','%s', %s)" % (self.path, self.dqflag, self.type, self.startDate, + self.endDate, self.selection, self.SMOG2) result = get_result(cmd, 'BK query error.', credential_requirements=self.credential_requirements) logger.debug("Finished Running Command") files = []