Skip to content

Commit

Permalink
Modify the signature in the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Nov 6, 2024
1 parent 747913a commit 013256c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
11 changes: 9 additions & 2 deletions tests/test_makeWarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import lsst.afw.image
from lsst.daf.butler import DataCoordinate, DimensionUniverse
from lsst.pipe.base import InMemoryDatasetHandle
from lsst.pipe.tasks.make_direct_warp import MakeDirectWarpTask
from lsst.pipe.tasks.make_direct_warp import MakeDirectWarpTask, WarpDetectorInputs
from lsst.pipe.tasks.makeWarp import (MakeWarpTask, MakeWarpConfig)
from lsst.pipe.tasks.coaddBase import makeSkyInfo
import lsst.skymap as skyMap
Expand Down Expand Up @@ -267,8 +267,15 @@ def test_compare_warps(self):
config.doSelectPreWarp = False
config.useVisitSummaryPsf = False
task = MakeDirectWarpTask(config=config)
warp_detector_inputs = {
dataRef.dataId.detector.id: WarpDetectorInputs(
exposure_or_handle=self.exposure,
data_id=dataRef.dataId,
)
for dataRef in dataRefs
}
result1 = task.run(
inputs,
warp_detector_inputs,
sky_info=self.skyInfo,
visit_summary=None
)
Expand Down
19 changes: 14 additions & 5 deletions tests/test_make_direct_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import lsst.afw.image
from lsst.daf.butler import DataCoordinate, DimensionUniverse
from lsst.pipe.base import InMemoryDatasetHandle
from lsst.pipe.tasks.make_direct_warp import (MakeDirectWarpConfig, MakeDirectWarpTask,)
from lsst.pipe.tasks.make_direct_warp import (MakeDirectWarpConfig, MakeDirectWarpTask, WarpDetectorInputs)
from lsst.pipe.tasks.coaddBase import makeSkyInfo
import lsst.skymap as skyMap
from lsst.afw.detection import GaussianPsf
Expand Down Expand Up @@ -193,9 +193,14 @@ def generate_data_id(
def test_makeWarp(self):
"""Test basic MakeDirectWarpTask."""
makeWarp = MakeDirectWarpTask(config=self.config)
inputs = {"calexp_list": [self.dataRef]}
warp_detector_inputs = {
self.dataRef.dataId.detector.id: WarpDetectorInputs(
exposure_or_handle=self.dataRef,
data_id=self.dataRef.dataId,
)
}
result = makeWarp.run(
inputs,
warp_detector_inputs,
sky_info=self.skyInfo,
visit_summary=None
)
Expand Down Expand Up @@ -231,9 +236,13 @@ def test_makeWarp(self):
It should return an empty exposure, with no PSF.
"""
makeWarp = MakeDirectWarpTask(config=self.config)
inputs = {"calexp_list": [self.dataRef]}
warp_detector_inputs = {
self.dataRef.dataId.detector.id: WarpDetectorInputs(
exposure_or_handle=self.dataRef, data_id=self.dataRef.dataId
)
}
result = makeWarp.run(
inputs,
warp_detector_inputs,
sky_info=self.skyInfo,
visit_summary=None
)
Expand Down
10 changes: 7 additions & 3 deletions tests/test_make_psf_matched_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import lsst.afw.image

from lsst.pipe.tasks.make_direct_warp import MakeDirectWarpTask
from lsst.pipe.tasks.make_direct_warp import MakeDirectWarpTask, WarpDetectorInputs
from lsst.pipe.tasks.make_psf_matched_warp import MakePsfMatchedWarpTask
import lsst.afw.cameraGeom.testUtils

Expand All @@ -45,9 +45,13 @@ def test_makeWarp(self):
"""

makeWarp = MakeDirectWarpTask(config=self.config)
inputs = {"calexp_list": [self.dataRef]}
warp_detector_inputs = {
self.dataRef.dataId.detector.id: WarpDetectorInputs(
exposure_or_handle=self.dataRef, data_id=self.dataRef.dataId
)
}
result = makeWarp.run(
inputs,
warp_detector_inputs,
sky_info=self.skyInfo,
visit_summary=None
)
Expand Down

0 comments on commit 013256c

Please sign in to comment.