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

Warning on wrong call order #164

Merged
merged 18 commits into from
May 3, 2021
Merged

Warning on wrong call order #164

merged 18 commits into from
May 3, 2021

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Apr 7, 2021

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Warn user if compute is called before update as most metrics are meaningless or will produce errors if their states have not been updated. Will return 0.0 in this case.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Apr 7, 2021

Hello @SkafteNicki! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-05-03 17:14:55 UTC

@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #164 (323ae54) into master (07eeca2) will increase coverage by 0.00%.
The diff coverage is 83.33%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #164   +/-   ##
=======================================
  Coverage   79.67%   79.68%           
=======================================
  Files          90       90           
  Lines        2874     2879    +5     
=======================================
+ Hits         2290     2294    +4     
- Misses        584      585    +1     
Flag Coverage Δ
Linux 79.68% <83.33%> (+<0.01%) ⬆️
Windows 79.68% <83.33%> (+<0.01%) ⬆️
cpu 79.68% <83.33%> (+<0.01%) ⬆️
macOS 79.68% <83.33%> (+<0.01%) ⬆️
pytest 79.68% <83.33%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
torchmetrics/metric.py 56.22% <83.33%> (+0.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07eeca2...323ae54. Read the comment docs.

tests/bases/test_metric.py Outdated Show resolved Hide resolved
torchmetrics/metric.py Outdated Show resolved Hide resolved
@Borda Borda added the bug / fix Something isn't working label Apr 8, 2021
@Borda Borda self-requested a review April 13, 2021 17:36
@Borda
Copy link
Member

Borda commented Apr 18, 2021

@SkafteNicki is this ready to go?

@Borda
Copy link
Member

Borda commented Apr 28, 2021

@maximsch2 mind check comments/questions from @SkafteNicki?

@Borda Borda enabled auto-merge (squash) April 30, 2021 13:40
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

Cool =)

@maximsch2
Copy link
Contributor

LGTM with the warning.

@Borda Borda disabled auto-merge May 3, 2021 17:22
@Borda Borda merged commit 8284657 into master May 3, 2021
@Borda Borda deleted the update_compute_order branch May 3, 2021 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants