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-40463-v24: Fix the failing test on macOS Ventura 13.5 #34

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions tests/test_gaap.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def testFlags(self, sigmas=[0.4, 0.5, 0.7], scalingFactors=[1.15, 1.25, 1.4, 100
# Measurement must fail (i.e., flag_bigPsf and flag must be set) if
# sigma < scalingFactor * seeing
# Ensure that there is at least one combination of parameters that fail
if not(min(gaapConfig.sigmas)/pixelScale < seeing*max(gaapConfig.scalingFactors)):
if not (min(gaapConfig.sigmas)/pixelScale < seeing*max(gaapConfig.scalingFactors)):
raise InvalidParameterError("The config parameters do not trigger a measurement failure. "
"Consider including lower values in ``sigmas`` and/or larger values "
"for ``scalingFactors``")
Expand All @@ -359,13 +359,22 @@ 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:
self.assertTrue(record[baseName+"_flag_bigPsf"])
self.assertTrue(record[baseName+"_flag"])
# 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=}",
)
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:
Expand Down