From 9884052d9dfcdb32c3aba5b65e5df9801994c3c4 Mon Sep 17 00:00:00 2001 From: Ian Sullivan Date: Mon, 6 Oct 2025 22:27:51 +0200 Subject: [PATCH 1/3] Fix AlgorithmError format --- python/lsst/ip/diffim/psfMatch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/lsst/ip/diffim/psfMatch.py b/python/lsst/ip/diffim/psfMatch.py index 0cf2921af..e838f7b66 100644 --- a/python/lsst/ip/diffim/psfMatch.py +++ b/python/lsst/ip/diffim/psfMatch.py @@ -42,6 +42,8 @@ class NoKernelCandidatesError(pipeBase.AlgorithmError): """Raised if there are too few candidates to compute the PSF matching kernel. """ + + @property def metadata(self) -> dict: return {} From 225df82fe77011e067359a08fa6031259a16f16b Mon Sep 17 00:00:00 2001 From: Eric Bellm Date: Wed, 8 Oct 2025 12:19:01 -0700 Subject: [PATCH 2/3] Catch AlgorithmErrors in AlardLuptonSubtractTask Override runQuantum to wrap self.run in a try block to catch all AlgorithmErrors and reraise as AnnotatedPartialOutputsError which will return exit code 0 if requested. No annotated partial outputs are written out. For posterity, this commit was pair-coded by EricB/Yusra asynchronously. --- python/lsst/ip/diffim/subtractImages.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/lsst/ip/diffim/subtractImages.py b/python/lsst/ip/diffim/subtractImages.py index 3e4ad6e9b..073bb78c6 100644 --- a/python/lsst/ip/diffim/subtractImages.py +++ b/python/lsst/ip/diffim/subtractImages.py @@ -402,6 +402,18 @@ def _applyExternalCalibrations(self, exposure, visitSummary): return exposure + def runQuantum(self, butlerQC, inputRefs, outputRefs): + inputs = butlerQC.get(inputRefs) + + try: + results = self.run(**inputs) + except lsst.pipe.base.AlgorithmError as e: + error = lsst.pipe.base.AnnotatedPartialOutputsError.annotate(e, self, log=self.log) + # No partial outputs for butler to put + raise error from e + + butlerQC.put(results, outputRefs) + @timeMethod def run(self, template, science, sources, visitSummary=None): """PSF match, subtract, and decorrelate two images. From b4c4ff973981142cddf3339fd40161fb47aabada Mon Sep 17 00:00:00 2001 From: Eric Bellm Date: Wed, 8 Oct 2025 12:19:40 -0700 Subject: [PATCH 3/3] Fix typo --- python/lsst/ip/diffim/psfMatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/ip/diffim/psfMatch.py b/python/lsst/ip/diffim/psfMatch.py index e838f7b66..96ccb33bb 100644 --- a/python/lsst/ip/diffim/psfMatch.py +++ b/python/lsst/ip/diffim/psfMatch.py @@ -867,7 +867,7 @@ def _solve(self, kernelCellSet, basisList): allCellsEmpty = False break if allCellsEmpty: - raise NoKernelCandidatesError("All spatial cells are emtpy of candidates") + raise NoKernelCandidatesError("All spatial cells are empty of candidates") try: ksv.processKsumDistribution()