-
Notifications
You must be signed in to change notification settings - Fork 46
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
Replace asserts by errors or warnings #365
Conversation
Reviewer's Guide by SourceryThis pull request replaces the use of File-Level Changes
Tips
|
Here's the code health analysis summary for commits Analysis Summary
|
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.
Hey @tovrstra - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 17 issues found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
The 7 deepsource issues already exists. This PR actually fixes 37 issues detected by deepsource and touched code related to those 7 other ones. |
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 took a very fast look and it seems Ok to me.
Thanks for checking Paul! Merging... |
An item on the list of cleanups in #204. This PR builds on the error and warning features added in the course of fixing #191.
The bad practice of using
assert
outside unit tests is removed. Such asserts are ignored by Python when running in optimized mode, meaning that possible errors when loading or dumping files go unnoticed. Eachassert
was checked and one of the following changes was made (roughly in order of decreasing prevalence):Other related changes:
tools/harmonics.py
to a separate file.I will YOLO-merge this on Wednesday, July 10, unless reviewed earlier.
Summary by Sourcery
This pull request replaces
assert
statements with appropriate error or warning raises to ensure proper error handling in optimized mode. It also includes improvements to error messages and checks in the Molekel format, extends some docstrings, and moves tests fortools/harmonics.py
to a separate file.assert
statements with error or warning raises to ensure proper error handling in optimized mode.tools/harmonics.py
to a separate filetools/test_harmonics.py
.