Fixes sphzone, sphlayer, cyzone, cylayer empty selections#3202
Fixes sphzone, sphlayer, cyzone, cylayer empty selections#3202lilyminium merged 12 commits intoMDAnalysis:developfrom
Conversation
…. Sphzone operating on an empty selection now returns an empty atom group.
…ection tests to fix issue_#2915.
Codecov Report
@@ Coverage Diff @@
## develop #3202 +/- ##
========================================
Coverage 92.73% 92.73%
========================================
Files 168 168
Lines 22688 22694 +6
Branches 3215 3218 +3
========================================
+ Hits 21040 21046 +6
Misses 1600 1600
Partials 48 48
Continue to review full report at Codecov.
|
|
Could someone help me understand what codecov is doing and how I can fix the error it is throwing? EDIT: nvm, it looks like it ended up passing the test! |
lilyminium
left a comment
There was a problem hiding this comment.
Thanks for looking at this, @orioncohen. LGTM. As this is your first contribution to MDAnalysis, please add yourself to AUTHORS -- please also add your username to the top of CHANGELOG :-)
|
Thanks @orioncohen. Looking more closely, though, the issue actually mentions cyzone and (in a comment lower down) sphlayer. As a more general fix could you look at those too? In fact it may be more elegant to just modify the |
…testing to confirm.
|
Hi @lilyminium. I've added a fix for cyzone, cylayer, and sphlayer too. I tried creating a new decorator to test if the selection is empty. The problem is that we need to check the contents of |
Your solution does fix the problem, but I'm surprised you can't just decorate the |
…to be more consistent.
|
Hello @orioncohen! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-04-05 19:48:03 UTC |
|
I should have taken a closer look when I was less sleepy! I implemented this with a decorator as you suggested. I added a new decorator rather than modifying |
lilyminium
left a comment
There was a problem hiding this comment.
Thanks @orioncohen, the decorator is much nicer than before! I just have some design comments. @richardjgowers you know more than I do about selections, so please weigh in if I've said anything dumb.
lilyminium
left a comment
There was a problem hiding this comment.
Other than the CHANGELOG message, LGTM!
Fixes #2915
Changes made in this Pull Request:
PR Checklist