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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getitem for metric collection when prefix/postfix is set #2430

Merged
merged 17 commits into from
Apr 17, 2024

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Mar 5, 2024

What does this PR do?

Fixes #2399

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--2430.org.readthedocs.build/en/2430/

@SkafteNicki SkafteNicki added the bug / fix Something isn't working label Mar 5, 2024
@SkafteNicki SkafteNicki added this to the v1.3.x milestone Mar 5, 2024
src/torchmetrics/collections.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Merging #2430 (60fe120) into master (e5b1135) will decrease coverage by 0%.
Report is 1 commits behind head on master.
The diff coverage is 0%.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #2430   +/-   ##
======================================
- Coverage      69%     69%   -0%     
======================================
  Files         307     307           
  Lines       17396   17400    +4     
======================================
  Hits        11981   11981           
- Misses       5415    5419    +4     

@Borda
Copy link
Member

Borda commented Mar 7, 2024

seems like PT 1.13 does not like it :)

FAILED unittests/bases/test_collections.py::test_metric_collection_prefix_postfix_args[None-None] - AttributeError: 'str' object has no attribute 'removeprefix'
FAILED unittests/bases/test_collections.py::test_metric_collection_prefix_postfix_args[prefix_-None] - AttributeError: 'str' object has no attribute 'removeprefix'
FAILED unittests/bases/test_collections.py::test_metric_collection_prefix_postfix_args[None-_postfix] - AttributeError: 'str' object has no attribute 'removeprefix'
FAILED unittests/bases/test_collections.py::test_metric_collection_prefix_postfix_args[prefix_-_postfix] - AttributeError: 'str' object has no attribute 'removeprefix'

@mergify mergify bot added ready and removed ready labels Mar 19, 2024
@mergify mergify bot added the ready label Mar 24, 2024
@mergify mergify bot removed the ready label Mar 25, 2024
@mergify mergify bot added the ready label Mar 28, 2024
@Borda Borda merged commit 9acf6ba into master Apr 17, 2024
62 checks passed
@Borda Borda deleted the bugfix/collection_getitem branch April 17, 2024 09:25
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.

Can't access metrics in a MetricCollection via keys returned in MetricCollection.keys
2 participants