-
Notifications
You must be signed in to change notification settings - Fork 413
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
experimenting with error improvements #2431
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2431 +/- ##
======================================
Coverage 69% 69%
======================================
Files 307 307
Lines 17410 17412 +2
======================================
+ Hits 11991 11993 +2
Misses 5419 5419 |
02de6c7
to
28978c8
Compare
bff1d98
to
791cf0d
Compare
@@ -6,3 +6,4 @@ packaging >17.1 | |||
torch >=1.10.0, <2.3.0 | |||
typing-extensions; python_version < '3.9' | |||
lightning-utilities >=0.8.0, <0.12.0 | |||
pretty-errors ==1.2.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we can relax this version constraint in the future?
@@ -14,6 +14,9 @@ | |||
_PACKAGE_ROOT = os.path.dirname(__file__) | |||
_PROJECT_ROOT = os.path.dirname(_PACKAGE_ROOT) | |||
|
|||
if package_available("pretty_errors"): | |||
import pretty_errors # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like importing torchmetrics now has the effect of changing error messages for all other code. This seems undesirable. Couldn't this be left up to the user? Or the dependency made optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also seems unmaintained: onelivesleft/PrettyErrors#57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, check #2527
What does this PR do?
taking inspiration from https://bigl.es/tooling-tuesday-pretty-errors/ and https://towardsdatascience.com/one-line-of-code-to-say-goodbye-to-confusing-python-error-messages-8090ee6dd046
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--2431.org.readthedocs.build/en/2431/