23 __all__ = [
'PairedVisitTaskRunner', ]
29 """Subclass of TaskRunner for handling intrinsically paired visits. 31 This transforms the processed arguments generated by the ArgumentParser 32 into the arguments expected by tasks which take visit pairs for their 35 Such tasks' run() methods tend to take two arguments, 36 one of which is the dataRef (as usual), and the other is the list 37 of visit-pairs, in the form of a list of tuples. 38 This list is supplied on the command line as documented, 39 and this class parses that, and passes the parsed version 42 See pipeBase.TaskRunner for more information. 47 """Parse the visit list and pass through explicitly.""" 49 for visitStringPair
in parsedCmd.visitPairs:
50 visitStrings = visitStringPair.split(
",")
51 if len(visitStrings) != 2:
52 raise RuntimeError(
"Found {} visits in {} instead of 2".format(len(visitStrings),
55 visits = [int(visit)
for visit
in visitStrings]
57 raise RuntimeError(
"Could not parse {} as two integer visit numbers".format(visitStringPair))
58 visitPairs.append(visits)
60 return pipeBase.TaskRunner.getTargetList(parsedCmd, visitPairs=visitPairs, **kwargs)
def getTargetList(parsedCmd, kwargs)