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

iou_type: correct type hints #2966

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adamjstewart
Copy link
Contributor

@adamjstewart adamjstewart commented Feb 23, 2025

What does this PR do?

Corrects a few issues with the type hints for iou_type:

  • We sometimes use str and other times use Literal["bbox", "segm"]
  • tuple[foo] means a tuple of length 1, use ... to make it a variadic tuple

Note that there are several other examples of the latter issue in the codebase, I only fixed iou_type.

Alternatively, we could force it to be a tuple of length 2.

Before submitting
  • Was this discussed/agreed 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?
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 🙃


📚 Documentation preview 📚: https://torchmetrics--2966.org.readthedocs.build/en/2966/

Copy link

codecov bot commented Feb 23, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 36%. Comparing base (dec80a5) to head (28b4362).

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #2966     +/-   ##
========================================
- Coverage      69%     36%    -34%     
========================================
  Files         332     332             
  Lines       19011   19011             
========================================
- Hits        13154    6773   -6381     
- Misses       5857   12238   +6381     

@mergify mergify bot added the ready label Feb 24, 2025
@SkafteNicki SkafteNicki added this to the v1.5.x milestone Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants