Skip to content

Commit

Permalink
Fix bug in test code.
Browse files Browse the repository at this point in the history
Since the string literal "id" is never equal to an integer, these
tests were definitely not working as intended before.
  • Loading branch information
TallJimbo committed Jan 9, 2025
1 parent 950d093 commit 3473492
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_astrometryFail.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ def testVisitCoordsAreNanForFailedAstrom(self):
self.assertTrue(np.all(np.isfinite(visitTable["ra"])))

visitSummary = self.butler.get("visitSummary", self.calexpMinimalDataId)
self.assertTrue(np.isfinite(visitSummary["id" == self.detector]["astromOffsetMean"]))
self.assertTrue(np.isfinite(visitSummary["id" == self.detector]["astromOffsetStd"]))
self.assertTrue(np.all(np.isnan(visitSummary["id" == 1]["raCorners"])))
self.assertTrue(np.all(np.isnan(visitSummary["id" == 1]["decCorners"])))
row = visitSummary.find(self.detector)
self.assertTrue(np.isfinite(row["astromOffsetMean"]))
self.assertTrue(np.isfinite(row["astromOffsetStd"]))
self.assertTrue(np.all(np.isnan(row["raCorners"])))
self.assertTrue(np.all(np.isnan(row["decCorners"])))

def testMetadataForFailedAstrom(self):
"""Test that the metadata for a failed astrometic fit is set properly.
Expand Down

0 comments on commit 3473492

Please sign in to comment.