From 013256c28975b53c4470b9cb5a173e03c1602e98 Mon Sep 17 00:00:00 2001 From: Arun Kannawadi Date: Tue, 5 Nov 2024 16:13:00 -0500 Subject: [PATCH] Modify the signature in the unit tests --- tests/test_makeWarp.py | 11 +++++++++-- tests/test_make_direct_warp.py | 19 ++++++++++++++----- tests/test_make_psf_matched_warp.py | 10 +++++++--- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/tests/test_makeWarp.py b/tests/test_makeWarp.py index 82d2161d1..7c8eddb3e 100644 --- a/tests/test_makeWarp.py +++ b/tests/test_makeWarp.py @@ -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 @@ -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 ) diff --git a/tests/test_make_direct_warp.py b/tests/test_make_direct_warp.py index c6ab36039..2edb67686 100644 --- a/tests/test_make_direct_warp.py +++ b/tests/test_make_direct_warp.py @@ -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 @@ -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 ) @@ -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 ) diff --git a/tests/test_make_psf_matched_warp.py b/tests/test_make_psf_matched_warp.py index c15baff65..825498861 100644 --- a/tests/test_make_psf_matched_warp.py +++ b/tests/test_make_psf_matched_warp.py @@ -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 @@ -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 )