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

experimenting with error improvements #2431

Merged
merged 22 commits into from
Apr 17, 2024
Merged

experimenting with error improvements #2431

merged 22 commits into from
Apr 17, 2024

Conversation

Borda
Copy link
Member

@Borda Borda commented Mar 5, 2024

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

@Borda Borda added the enhancement New feature or request label Mar 5, 2024
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Merging #2431 (1b30064) into master (822dba2) will increase coverage by 0%.
The diff coverage is 100%.

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           

@mergify mergify bot removed the ready label Mar 25, 2024
@mergify mergify bot added the ready label Mar 27, 2024
@Borda Borda requested a review from a team March 28, 2024 21:23
@mergify mergify bot removed the ready label Apr 15, 2024
@mergify mergify bot added the ready label Apr 15, 2024
@mergify mergify bot added has conflicts and removed ready labels Apr 16, 2024
@mergify mergify bot removed the has conflicts label Apr 16, 2024
@Borda Borda merged commit df32eb7 into master Apr 17, 2024
70 checks passed
@Borda Borda deleted the use-pretty_errors branch April 17, 2024 09:22
@@ -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
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, check #2527

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants