Skip to content

Commit

Permalink
Rename CmdlineTask's entry method runDataDef
Browse files Browse the repository at this point in the history
Prepare Tasks for Gen3 PipelineTask conversion by:
* Renaming CmdlineTask's entry method to `runDataRef`.  The default
  CmdlineTask.TaskRunner now calls a Task's `runDataRef` method on the
  parsed command line inputs.
  `runDataRef` method can take any Gen2 Butler data products.
* Renaming CmdlineTasks previous core methods (e.g. assemble,
  characterize) to `run` when they exist.
  • Loading branch information
yalsayyad authored and czwa committed Aug 3, 2018
1 parent 1446d0a commit 1fba27d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions python/lsst/ap/pipe/apPipeTaskRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __call__(self, args):
Parameters
----------
args
A path to the database file, followed by arguments for Task.run().
A Butler data reference, followed by option arguments for Task.runDataRef().
Returns
-------
Expand All @@ -108,10 +108,10 @@ def __call__(self, args):
result = None # in case the task fails
exitStatus = 0 # exit status for the shell
if self.doRaise:
result = task.run(dataRef, **kwargs)
result = task.runDataRef(dataRef, **kwargs)
else:
try:
result = task.run(dataRef, **kwargs)
result = task.runDataRef(dataRef, **kwargs)
except Exception as e:
# The shell exit value will be the number of dataRefs returning
# non-zero, so the actual value used here is lost.
Expand Down
14 changes: 7 additions & 7 deletions python/lsst/ap/pipe/ap_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _copyConfig(config):
return configClass(**contents)

@pipeBase.timeMethod
def run(self, rawRef, templateIds=None, reuse=None):
def runDataRef(self, rawRef, templateIds=None, reuse=None):
"""Execute the ap_pipe pipeline on a single image.
Parameters
Expand All @@ -187,8 +187,8 @@ def run(self, rawRef, templateIds=None, reuse=None):
- l1Database : handle for accessing the final association database, conforming to
`ap_association`'s DB access API
- ccdProcessor : output of `config.ccdProcessor.run` (`lsst.pipe.base.Struct` or `None`).
- differencer : output of `config.differencer.run` (`lsst.pipe.base.Struct` or `None`).
- ccdProcessor : output of `config.ccdProcessor.runDataRef` (`lsst.pipe.base.Struct` or `None`).
- differencer : output of `config.differencer.runDataRef` (`lsst.pipe.base.Struct` or `None`).
- associator : output of `config.associator.run` (`lsst.pipe.base.Struct` or `None`).
"""
if reuse is None:
Expand Down Expand Up @@ -247,14 +247,14 @@ def runProcessCcd(self, sensorRef):
Returns
-------
result : `lsst.pipe.base.Struct`
Output of `config.ccdProcessor.run`.
Output of `config.ccdProcessor.runDataRef`.
Notes
-----
The input repository corresponding to ``sensorRef`` must already contain the refcats.
"""
self.log.info("Running ProcessCcd...")
return self.ccdProcessor.run(sensorRef)
return self.ccdProcessor.runDataRef(sensorRef)

@pipeBase.timeMethod
def runDiffIm(self, sensorRef, templateIds=None):
Expand All @@ -275,10 +275,10 @@ def runDiffIm(self, sensorRef, templateIds=None):
Returns
-------
result : `lsst.pipe.base.Struct`
Output of `config.differencer.run`.
Output of `config.differencer.runDataRef`.
"""
self.log.info("Running ImageDifference...")
return self.differencer.run(sensorRef, templateIdList=templateIds)
return self.differencer.runDataRef(sensorRef, templateIdList=templateIds)

@pipeBase.timeMethod
def runAssociation(self, sensorRef):
Expand Down

0 comments on commit 1fba27d

Please sign in to comment.