-
Notifications
You must be signed in to change notification settings - Fork 13
Refactor montepy.errors -> montepy.exceptions #778
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
Conversation
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.
You make a good argument for using an IDE.
Also you have missing coverage in |
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.
The changelog needs adjusting. I think the missed patch coverage is my fault, and it's just showing up for you due to the rename.
I like how this page is present, but not easy to get to: https://montepy--778.org.readthedocs.build/en/778/api/montepy.errors.html Should we exclude it via |
Co-authored-by: Micah Gale <[email protected]>
Today I learned about the |
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.
Lgtm.
Pull Request Checklist for MontePy
Description
DeprecationWarning
every timemontepy.errors.something
is used.Closes #764
General Checklist
black
version 25.Additional Notes for Reviewers
Ensure that:
Discussion
I think that the warning should be raised for any
montepy.errors.SomeException
and not at the module level.The alternative way to deprecate was to make the warning module-level. I did it this way because either:
import montepy.errors
in __init__.py and get the warning there, ormontepy.errors.SomeException
will be brokenThe warning in __init__.py cannot be silenced with
with warnings.catch_warnings(...)
, or else it will be caught everywhere because of how Python imports work. Doing it only at the module level would not raise a warning if a user specifically doesimport montepy.errors
orfrom montepy.errors import
.📚 Documentation preview 📚: https://montepy--778.org.readthedocs.build/en/778/