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-32819: 'verifyFlatStatistics' returns "RXX_S00 SUCCESS" when listing failures #16

Merged
merged 2 commits into from
May 3, 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: 5 additions & 3 deletions python/lsst/cp/verify/mergeResults.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ def run(self, inputStats, camera, inputDims):
success = False
# See if the detector failed
if 'DET' in detStats['VERIFY']:
for testName, testResult in detStats['VERIFY']['DET'].items():
if testResult is False:
calcStats['FAILURES'].append(testName)
detSuccess = detStats['VERIFY']['DET'].pop('SUCCESS', False)
if not detSuccess:
Copy link

Choose a reason for hiding this comment

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

It seems like any dict with a truthy SUCCESS value will pass here, including {'SUCCESS': [], 'FAIL': False}. I gather this is meant to short-circuit checking if all tests passed, but it seems unnecessarily error-prone if it's just for optimization. Is there any other purpose to the SUCCESS value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I believe the intent is to keep all the logic of what constitutes a failure in the subclasses and to have this merge code just handle collating the results. I'm pinging @czwa ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

Yeah fair enough, if there's an underlying issue it should be fixed on that ticket, but I'd still like to know if the existing design is working as intended before this PR is merged.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The goal of SUCCESS is to save the merge code from having to decide if it should create/append to a list of failures. Some optional tests are excluded from that check, and are calculated to help debugging larger issues.

for testName, testResult in detStats['VERIFY']['DET'].items():
if testResult is False:
calcStats['FAILURES'].append(testName)
# See if the catalog failed
if 'CATALOG' in detStats['VERIFY']:
for testName, testResult in detStats['VERIFY']['CATALOG'].items():
Expand Down