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-21939: Create Gen 3 AP Pipeline #86

Merged
merged 2 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions python/lsst/ap/association/diaPipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@

class DiaPipelineConnections(pipeBase.PipelineTaskConnections,
dimensions=("instrument", "visit", "detector"),
defaultTemplates={"coaddName": "deep"}):
defaultTemplates={"coaddName": "deep", "fakesType": ""}):
"""Butler connections for DiaPipelineTask.
"""
diaSourceSchema = connTypes.InitInput(
doc="Schema of the DiaSource catalog produced during image "
"differencing",
name="{coaddName}Diff_diaSrc_schema",
name="{fakesType}{coaddName}Diff_diaSrc_schema",
storageClass="SourceCatalog",
multiple=True
)
diaSourceCat = connTypes.Input(
doc="Catalog of DiaSources produced during image differencing.",
name="{coaddName}Diff_diaSrc",
name="{fakesType}{coaddName}Diff_diaSrc",
storageClass="SourceCatalog",
dimensions=("instrument", "visit", "detector"),
)
diffIm = connTypes.Input(
doc="Difference image on which the DiaSources were detected.",
name="{coaddName}Diff_differenceExp",
name="{fakesType}{coaddName}Diff_differenceExp",
storageClass="ExposureF",
dimensions=("instrument", "visit", "detector"),
)
Expand All @@ -85,7 +85,7 @@ class DiaPipelineConnections(pipeBase.PipelineTaskConnections,
doc="Marker dataset storing the configuration of the Apdb for each "
"visit/detector. Used to signal the completion of the pipeline.",
name="apdb_marker",
storageClass="",
storageClass="Config",
dimensions=("instrument", "visit", "detector"),
)

Expand Down Expand Up @@ -160,7 +160,7 @@ def __init__(self, initInputs=None, **kwargs):
afw_schemas=dict(DiaObject=make_dia_object_schema(),
DiaSource=make_dia_source_schema()))
self.makeSubtask("diaSourceDpddifier",
inputSchema=initInputs["diaSourceSchema"])
inputSchema=initInputs["diaSourceSchema"].schema)
self.makeSubtask("diaCatalogLoader")
self.makeSubtask("associator")
self.makeSubtask("diaForcedSource")
Expand Down Expand Up @@ -246,4 +246,4 @@ def run(self, diaSourceCat, diffIm, exposure, ccdExposureIdBits):
None,
ccdExposureIdBits)

return pipeBase.Struct(apdb_marker=self.config.apdb.value)
return pipeBase.Struct(apdbMarker=self.config.apdb.value)
14 changes: 9 additions & 5 deletions tests/test_diaPipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import lsst.afw.image as afwImage
import lsst.afw.table as afwTable
import lsst.pipe.base as pipeBase
from lsst.utils import getPackageDir
import lsst.utils.tests
from unittest.mock import patch, Mock, DEFAULT
Expand All @@ -50,9 +51,11 @@ def _makeDefaultConfig(cls, doPackageAlerts=False):
return config

def setUp(self):
self.srcSchema = afwTable.SourceTable.makeMinimalSchema()
self.srcSchema.addField("base_PixelFlags_flag", type="Flag")
self.srcSchema.addField("base_PixelFlags_flag_offimage", type="Flag")
# schemas are persisted in both Gen 2 and Gen 3 butler as prototypical catalogs
srcSchema = afwTable.SourceTable.makeMinimalSchema()
srcSchema.addField("base_PixelFlags_flag", type="Flag")
srcSchema.addField("base_PixelFlags_flag_offimage", type="Flag")
self.srcSchema = afwTable.SourceCatalog(srcSchema)

def tearDown(self):
pass
Expand Down Expand Up @@ -104,8 +107,9 @@ def _testRun(self, doPackageAlerts=False):
result = task.run(diaSrc, diffIm, exposure, ccdExposureIdBits)
for subtaskName in subtasksToMock:
getattr(task, subtaskName).run.assert_called_once()
self.assertEqual(result.apdb_marker.db_url, "sqlite://")
self.assertEqual(result.apdb_marker.isolation_level,
pipeBase.testUtils.assertValidOutput(task, result)
self.assertEqual(result.apdbMarker.db_url, "sqlite://")
self.assertEqual(result.apdbMarker.isolation_level,
"READ_UNCOMMITTED")


Expand Down