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

Fix metrics bug when 0 sources #754

Merged
merged 1 commit into from
May 10, 2023
Merged

Fix metrics bug when 0 sources #754

merged 1 commit into from
May 10, 2023

Conversation

aakashdp6548
Copy link
Collaborator

Fixes #752. Metrics didn't correctly handle the case when either the number of true or estimated sources in a batch was 0, and would raise an exception. Now we manually check before calling match_by_locs and increment false positives / false negatives accordingly. I don't think there's any good way of measuring "average distance" in this case since there are no matches to compute the distance between, so that only gets updated in batches that have both true and estimated sources.

Also added test_no_sources in test_metrics that checks this functionality.

@aakashdp6548 aakashdp6548 added the bug Something isn't working label May 10, 2023
@aakashdp6548 aakashdp6548 linked an issue May 10, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Merging #754 (b2f5c46) into master (74da903) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #754      +/-   ##
==========================================
+ Coverage   88.41%   88.48%   +0.06%     
==========================================
  Files          14       14              
  Lines        1252     1259       +7     
==========================================
+ Hits         1107     1114       +7     
  Misses        145      145              
Flag Coverage Δ
unittests 88.48% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
bliss/metrics.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@jeff-regier jeff-regier left a comment

Choose a reason for hiding this comment

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

Makes sense & looks good

@aakashdp6548 aakashdp6548 merged commit fb845d9 into master May 10, 2023
@aakashdp6548 aakashdp6548 deleted the 752-fix-metrics-bug branch May 10, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix metrics behavior when either true_locs or est_locs is empty
2 participants