-
Notifications
You must be signed in to change notification settings - Fork 143
Make exceptions less verbose by default #1330
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
base: main
Are you sure you want to change the base?
Conversation
21f4232
to
9e376ef
Compare
The |
9e376ef
to
ff479ac
Compare
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.
Pull Request Overview
This PR simplifies PyTensor exception messages by reducing their verbosity by default, making it easier for users to find the actual error message. The changes introduce a new "low" verbosity level that shows minimal information with a hint to increase verbosity for more details.
- Adds a new "low" exception verbosity level as the default
- Simplifies error message formatting in function calls
- Provides hints to users about how to get more detailed error information
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
pytensor/link/utils.py | Adds hint message for low verbosity exceptions |
pytensor/configdefaults.py | Updates exception verbosity config to include new "medium" level and simplified description |
pytensor/compile/function/types.py | Refactors exception handling to use cleaner messages and respect verbosity settings |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ff479ac
to
8002918
Compare
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.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
8002918
to
f575025
Compare
f575025
to
11376ac
Compare
Failing jax test addressed in #1646 |
PyTensor exceptions are very verbose by default. Users often struggle to even find the actual error message.
This PR makes exceptions more minimal with a hint to set the relevant flag
exception_verbosity
tomedium
(the oldlow
orhigh
) for more details.The type error in the following snippet:
Now looks like:
Whereas with the old default looked like
A runtime error:
Now looks like this
Whereas before it looked like
📚 Documentation preview 📚: https://pytensor--1330.org.readthedocs.build/en/1330/