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

DM-12549: ap_pipe must call AssociationTask in a reproducible order #121

Merged
merged 1 commit into from
Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions python/lsst/ap/verify/pipeline_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import lsst.log
from lsst.utils import getPackageDir
import lsst.pipe.base as pipeBase
import lsst.ctrl.mpexec.execFixupDataId # not part of lsst.ctrl.mpexec
import lsst.ctrl.mpexec.cli.pipetask
import lsst.ap.pipe as apPipe
from lsst.ap.pipe.make_apdb import makeApdb
Expand Down Expand Up @@ -170,6 +171,7 @@ def runApPipeGen3(workspace, parsedCmdLine, processes=1):
pipelineArgs.extend(["--data-query", singleId])
pipelineArgs.extend(["--processes", str(processes)])
pipelineArgs.extend(["--register-dataset-types"])
pipelineArgs.extend(["--graph-fixup", "lsst.ap.verify.pipeline_driver._getExecOrder"])

if not parsedCmdLine.skip_pipeline:
# CliRunner is an unsafe workaround for DM-26239
Expand All @@ -186,6 +188,28 @@ def runApPipeGen3(workspace, parsedCmdLine, processes=1):
log.info('Skipping AP pipeline entirely.')


def _getExecOrder():
"""Return any constraints on the Gen 3 execution order.

The current constraints are that executions of DiaPipelineTask must be
ordered by visit ID, but this is subject to change.

Returns
-------
order : `lsst.ctrl.mpexec.ExecutionGraphFixup`
An object encoding the desired execution order as an algorithm for
modifying inter-quantum dependencies.

Notes
-----
This function must be importable, but need not be public.
"""
# Source association algorithm is not time-symmetric. Force execution of
# association (through DiaPipelineTask) in order of ascending visit number.
return lsst.ctrl.mpexec.execFixupDataId.ExecFixupDataId(
taskLabel="diaPipe", dimensions=["visit", ], reverse=False)


def _getApdbArguments(workspace, parsed):
"""Return the config options for running make_apdb.py on this workspace,
as command-line arguments.
Expand Down