-
Notifications
You must be signed in to change notification settings - Fork 745
Raised meaningful error for short peptide stretch #5163
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: develop
Are you sure you want to change the base?
Conversation
|
@orbeckst @marinegor please check this, and do I need to add extra tests for this? and also codecov is failing, so I think it would be better if I add tests right? and please tell me what to write in CHANGELOG, cause I'm confused about the format.... :-) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5163 +/- ##
===========================================
- Coverage 92.72% 92.72% -0.01%
===========================================
Files 180 180
Lines 22472 22474 +2
Branches 3188 3189 +1
===========================================
+ Hits 20837 20838 +1
Misses 1177 1177
- Partials 458 459 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
IAlibay
left a comment
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.
Please add:
- Tests that trigger the error
- Tests that check that the system passes with 6 residues (and that it returns correct results)
- Update the docstring "Raises" section
- Update relevant docs to make it clear that at least 6 residues are necessary
- Update the changelog
| n_residues = len(ag.residues) | ||
| MIN_RESIDUES = 5 | ||
| if n_residues < MIN_RESIDUES: | ||
| raise ValueError( | ||
| f"DSSP requires at least {MIN_RESIDUES} residues for secondary structure analysis, but only {n_residues} residue(s) were provided in the selection." | ||
| ) |
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.
| n_residues = len(ag.residues) | |
| MIN_RESIDUES = 5 | |
| if n_residues < MIN_RESIDUES: | |
| raise ValueError( | |
| f"DSSP requires at least {MIN_RESIDUES} residues for secondary structure analysis, but only {n_residues} residue(s) were provided in the selection." | |
| ) | |
| if len(ag.residues) < 6: | |
| raise ValueError( | |
| "DSSP requires at least 6 residues for secondary structure analysis, " | |
| f"but only {len(ag.residues)} residue(s) were provided in the selection." | |
| ) |
See the original issue "fewer than 6 residues" not 5.
Also there's no need to define one time use variables.
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.
ok, doing the changes!
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.
done
Please look at the instructions in the changelog ( Lines 6 to 13 in bbcef1b
|
ok |
Fixes #5046
Changes made in this Pull Request:
ag.residues, and just raised a simple value error message showing the minimum required residuesPR Checklist
package/CHANGELOGfile updated?package/AUTHORS? (If it is not, add it!)Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.
📚 Documentation preview 📚: https://mdanalysis--5163.org.readthedocs.build/en/5163/