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-34768: Loosen fgcmcal chebyshev test tolerance #83

Merged
merged 1 commit into from
May 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_chebyshev.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_chebyshev_evaluate(self, seed=1000):
field = afwMath.ChebyshevBoundedField(bbox, self.pars)
fieldValues = field.evaluate(xPos, yPos)

self.assertFloatsAlmostEqual(fieldValues, fgcmValues, rtol=5e-15)
self.assertFloatsAlmostEqual(fieldValues, fgcmValues, rtol=1e-14)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is three uses enough for this to be a file constant?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They only need to be the same if we think a change in one tolerance should be reflected in the others. The number of uses is irrelevant in and of itself if the reused constant merely happens to be the same.


def test_chebyshev_fit(self, seed=1000):
"""
Expand Down Expand Up @@ -138,16 +138,16 @@ def test_chebyshev_fit(self, seed=1000):
# The tolerance here must be looser than the application, I believe
# because of rounding errors in the fit implementations. But the
# good news is that a tolerance of 1e-9 in parameters in these
# tests yields a recovered tolerance of < 5e-15.
# tests yields a recovered tolerance of < 1e-14.
self.assertFloatsAlmostEqual(fgcmField.pars, field.getCoefficients(),
rtol=1e-9)

# And compare the input and output
fgcmValues2 = fgcmField.evaluate(xPos, yPos)
fieldValues2 = field.evaluate(xPos, yPos)

self.assertFloatsAlmostEqual(fgcmValues, fgcmValues2, rtol=5e-15)
self.assertFloatsAlmostEqual(fgcmValues2, fieldValues2, rtol=5e-15)
self.assertFloatsAlmostEqual(fgcmValues, fgcmValues2, rtol=1e-14)
self.assertFloatsAlmostEqual(fgcmValues2, fieldValues2, rtol=1e-14)


class TestMemory(lsst.utils.tests.MemoryTestCase):
Expand Down