From b183e19d199bedb8db2f69779b193dd22d5d46d9 Mon Sep 17 00:00:00 2001 From: Arun Kannawadi Date: Mon, 21 Aug 2023 20:34:52 -0700 Subject: [PATCH 1/3] Clean up documentation --- doc/lsst.meas.extensions.gaap/index.rst | 41 ------------------------- 1 file changed, 41 deletions(-) diff --git a/doc/lsst.meas.extensions.gaap/index.rst b/doc/lsst.meas.extensions.gaap/index.rst index f8b1ce3..35d4101 100644 --- a/doc/lsst.meas.extensions.gaap/index.rst +++ b/doc/lsst.meas.extensions.gaap/index.rst @@ -31,47 +31,6 @@ You can find Jira issues for this module under the `meas_extensions_gaap Date: Mon, 21 Aug 2023 17:43:00 -0700 Subject: [PATCH 2/3] Add useful error messages when assertion fails --- tests/test_gaap.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/test_gaap.py b/tests/test_gaap.py index dd0e9ed..7c1393a 100644 --- a/tests/test_gaap.py +++ b/tests/test_gaap.py @@ -361,11 +361,19 @@ def testFlags(self, sigmas=[0.4, 0.5, 0.7], scalingFactors=[1.15, 1.25, 1.4, 100 baseName = gaapConfig._getGaapResultName(scalingFactor, sigma, algName) # Give some leeway for the edge case. if targetSigma - sigma/pixelScale >= -1e-10: - self.assertTrue(record[baseName+"_flag_bigPsf"]) - self.assertTrue(record[baseName+"_flag"]) + self.assertTrue(record[baseName+"_flag_bigPsf"], + msg=f"bigPsf flag not set for {scalingFactor=} and {sigma=}", + ) + self.assertTrue(record[baseName+"_flag"], + msg=f"Flag not set for {scalingFactor=} and {sigma=}", + ) else: - self.assertFalse(record[baseName+"_flag_bigPsf"]) - self.assertFalse(record[baseName+"_flag"]) + self.assertFalse(record[baseName+"_flag_bigPsf"], + msg=f"bigPsf flag set for {scalingFactor=} and {sigma=}", + ) + self.assertFalse(record[baseName+"_flag"], + msg=f"Flag set for {scalingFactor=} and {sigma=}", + ) # Ensure that flag_bigPsf is set if OptimalShape is not large enough. if gaapConfig.doOptimalPhotometry: From 8c15dde69b7f9d52747735de4a53933bb2489a24 Mon Sep 17 00:00:00 2001 From: Arun Kannawadi Date: Mon, 21 Aug 2023 20:59:37 -0700 Subject: [PATCH 3/3] Rearranged the terms for comparison in testFlags --- tests/test_gaap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_gaap.py b/tests/test_gaap.py index 7c1393a..041ac4f 100644 --- a/tests/test_gaap.py +++ b/tests/test_gaap.py @@ -359,8 +359,9 @@ def testFlags(self, sigmas=[0.4, 0.5, 0.7], scalingFactors=[1.15, 1.25, 1.4, 100 for scalingFactor, sigma in itertools.product(gaapConfig.scalingFactors, gaapConfig.sigmas): targetSigma = scalingFactor*seeing baseName = gaapConfig._getGaapResultName(scalingFactor, sigma, algName) - # Give some leeway for the edge case. - if targetSigma - sigma/pixelScale >= -1e-10: + # Give some leeway for the edge case and compare against a small + # negative number instead of zero. + if targetSigma*pixelScale - sigma >= -2e-7: self.assertTrue(record[baseName+"_flag_bigPsf"], msg=f"bigPsf flag not set for {scalingFactor=} and {sigma=}", )