-
Notifications
You must be signed in to change notification settings - Fork 412
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
lint: resolve B905 #2154
lint: resolve B905 #2154
Conversation
Sadly this is not supported before python 3.10, so we really cannot add this in the next foreseeable future. |
@matsumotosan Sorry for that. I made it as todo, did not know it was not feasible 😿 UPDATE: we can still have it would even be cool, such that we will add it as extra kwarg or define it as our own private func: def _zip(*args, **kwargs) -> ...:
kw_strict = {"strict": True} if <python 3.10+> and "strict" not in kwargs else {}
return zip(*args, **kwargs, **kw_strict) |
@matsumotosan made some adjustments; could you pls check... |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2154 +/- ##
======================================
Coverage 87% 87%
======================================
Files 293 294 +1
Lines 16417 16457 +40
======================================
+ Hits 14273 14310 +37
- Misses 2144 2147 +3 |
So there's a case where the length of items in the arguments to zip aren't equal in the call to I haven't had the time to familiarize myself with this function so wanted to see if anyone had any immediate ideas before I go deeper into the code. |
this is good finding, @SkafteNicki |
It is correct that in most cases thresholds is one value shorter than the corresponding values. That is mostly to be consistent with how scikit learn is doing it. In those cases I guess the argument would need to be |
What does this PR do?
Resolve B905: zip-without-explicit-strict
Before submitting
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--2154.org.readthedocs.build/en/2154/