Skip to content
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

PEP8 fixes for PR #2342 (smog_bk) by autopep8 #2343

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
import os
import datetime
# \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
from GangaCore.Core.exceptions import GangaException
from GangaCore.GPIDev.Schema import Schema, Version, SimpleItem, ComponentItem
from GangaCore.GPIDev.Base import GangaObject
from GangaCore.GPIDev.Base.Proxy import isType, stripProxy, addProxy
from GangaCore.GPIDev.Base.Proxy import isType, addProxy
from GangaCore.GPIDev.Credentials import require_credential
from GangaDirac.Lib.Credentials.DiracProxy import DiracProxy
from GangaDirac.Lib.Backends.DiracUtils import get_result
from GangaDirac.Lib.Utilities.DiracUtilities import GangaDiracError
from GangaDirac.Lib.Files.DiracFile import DiracFile
from GangaCore.Utility.logging import getLogger
from GangaLHCb.Lib.LHCbDataset import LHCbDataset, LHCbCompressedDataset
from GangaLHCb.Lib.Backends.Dirac import filterLFNsBySE
logger = getLogger()
#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
# \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#


class BKQuery(GangaObject):
Expand Down Expand Up @@ -124,13 +121,13 @@
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)
Expand Down Expand Up @@ -167,13 +164,13 @@
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 = []
Expand Down Expand Up @@ -218,10 +215,14 @@
break
if all_archived and not self.ignore_archived:
raise GangaDiracError(
"All the files are only available on archive SEs. It is likely the data set has been archived. Contact data management to request that it be staged")
"All the files are only available on archive SEs.

Check failure on line 218 in ganga/GangaLHCb/Lib/LHCbDataset/BKQuery.py

View workflow job for this annotation

GitHub Actions / Linting

E999 SyntaxError: unterminated string literal (detected at line 218)
It is likely the data set has been archived.
Contact data management to request that it be staged")
elif all_archived:
logger.warning(
"All the files are only available on archive SEs. It is likely the data set has been archived. Contact data management to request that it be staged")
"All the files are only available on archive SEs.
It is likely the data set has been archived.
Contact data management to request that it be staged")

if compressed:
ds = LHCbCompressedDataset(files)
Expand All @@ -239,7 +240,7 @@

return addProxy(ds)

#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
# \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#


class BKQueryDict(GangaObject):
Expand Down Expand Up @@ -293,7 +294,7 @@
cmd = 'bkQueryDict(%s)' % self.dict
try:
value = get_result(cmd, 'BK query error.', credential_requirements=self.credential_requirements)
except GangaDiracError as err:
except GangaDiracError:
return {'OK': False, 'Value': {}}

files = []
Expand Down Expand Up @@ -329,4 +330,4 @@

return addProxy(ds)

#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
# \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
4 changes: 2 additions & 2 deletions ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
# DiracLHCb commands
# /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

#def getRootVersions(): output( dirac.getRootVersions() )
# def getRootVersions(): output( dirac.getRootVersions() )

#def getSoftwareVersions(): output( dirac.getSoftwareVersions() )
# def getSoftwareVersions(): output( dirac.getSoftwareVersions() )


@diracCommand

Check warning on line 10 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'diracCommand'
def bkQueryDict(dict):
return dirac.bkQuery(dict)

Check warning on line 12 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'dirac'


@diracCommand

Check warning on line 15 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'diracCommand'
def checkSites():
return dirac.checkSites()

Check warning on line 17 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'dirac'


@diracCommand

Check warning on line 20 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'diracCommand'
def bkMetaData(files):
return dirac.bkMetadata(files)

Check warning on line 22 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'dirac'


@diracCommand

Check warning on line 25 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'diracCommand'
def getLHCbInputDataCatalog(lfns, depth, site, xml_file):
if depth > 0:
result = dirac.getBKAncestors(lfns, depth)

Check warning on line 28 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'dirac'
if not result or not result.get('OK', False):
output(result)

Check warning on line 30 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'output'
return
lfns = result['Value']
return dirac.getInputDataCatalog(lfns, site, xml_file)

Check warning on line 33 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

F821 undefined name 'dirac'


def bookkeepingGUI(file):
Expand All @@ -56,7 +56,7 @@

@diracCommand
def getAccessURL(lfn, SE, protocol=''):
''' Return the access URL for the given LFN, storage element and protocol. If 'root' or 'xroot' specified then request both as per LHCbDirac from which this is taken. '''

Check failure on line 59 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

E501 line too long (174 > 127 characters)
if protocol == '':
protocol = ['xroot', 'root']
elif 'root' in protocol and 'xroot' not in protocol:
Expand Down Expand Up @@ -84,7 +84,7 @@

@diracCommand
def getDBtagsFromLFN(lfn):
''' returns the DDDB and CONDDB tags for a given LFN. Uses the latest production step unless it is a merge, in which case the parent is used '''

Check failure on line 87 in ganga/GangaLHCb/Lib/Server/DiracLHCbCommands.py

View workflow job for this annotation

GitHub Actions / Linting

E501 line too long (148 > 127 characters)
from LHCbDIRAC.BookkeepingSystem.Client.BookkeepingClient import BookkeepingClient
from LHCbDIRAC.TransformationSystem.Client.TransformationClient import TransformationClient
import types
Expand Down
Loading