-
Notifications
You must be signed in to change notification settings - Fork 101
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
Move exceptions to new module #1845
Conversation
Again, I'm not sure this is a good idea, but if we want it it's here. |
class DegeneracyWarning(UserWarning): | ||
pass | ||
|
||
|
||
class ConvergenceFailure(ValueError): | ||
pass | ||
|
||
|
||
class MaxiterReached(ConvergenceFailure): | ||
pass | ||
|
||
|
||
class StepProblem(ConvergenceFailure): | ||
pass |
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.
Can you please add docstrings explaining what each of these exceptions mean?
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.
I don't think I necessarily can, since I didn't write them. I could probably infer some from usage but that would take a while.
I think this is a good idea, especially for avoiding circular imports and for improving readability. |
Please also add a CHANGELOG entry. |
All of the custom warnings and exceptions will be in
pint.exceptions
now. This means that are easier to find/import, and also easier to use (since you can see which are already defined).(the one exception is in
noise_model.py
, since some of the exceptions there require access to other functions defined in that module)