Skip to content
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

Atomnames methods should handle empty group #2879 #4528

Conversation

kainszs
Copy link
Contributor

@kainszs kainszs commented Mar 24, 2024

Fixes #2879

Changes made in this Pull Request:

  • the methods psi_selections(), omega_selections(), chi1_selections() can handle empty groups

NOTE: Since the methods return by default a list of atom groups, the methods will also return an empty list in the case of empty residues instead of an empty residue group ask in the issue. If you accept the code for the change, I will add comments, the tests and update the CHANGELOG.

Update:

I just realized that I accidentally formatted with black when saving. Should I just push the file again that only contains my changes and reopen the PR?

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Developers certificate of origin


📚 Documentation preview 📚: https://mdanalysis--4528.org.readthedocs.build/en/4528/

@pep8speaks
Copy link

Hello @kainszs! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 402:80: E501 line too long (85 > 79 characters)
Line 417:80: E501 line too long (80 > 79 characters)
Line 477:80: E501 line too long (85 > 79 characters)
Line 648:80: E501 line too long (84 > 79 characters)
Line 929:80: E501 line too long (83 > 79 characters)
Line 1120:80: E501 line too long (83 > 79 characters)
Line 1232:80: E501 line too long (85 > 79 characters)
Line 1234:80: E501 line too long (81 > 79 characters)
Line 1252:80: E501 line too long (83 > 79 characters)
Line 1299:80: E501 line too long (84 > 79 characters)
Line 1486:80: E501 line too long (85 > 79 characters)
Line 1494:80: E501 line too long (84 > 79 characters)
Line 1717:80: E501 line too long (83 > 79 characters)
Line 1719:80: E501 line too long (80 > 79 characters)
Line 1786:80: E501 line too long (84 > 79 characters)
Line 1848:80: E501 line too long (83 > 79 characters)
Line 1881:80: E501 line too long (83 > 79 characters)
Line 1982:80: E501 line too long (83 > 79 characters)
Line 2066:80: E501 line too long (81 > 79 characters)
Line 2074:80: E501 line too long (84 > 79 characters)
Line 2169:80: E501 line too long (88 > 79 characters)
Line 2213:80: E501 line too long (88 > 79 characters)
Line 2279:80: E501 line too long (87 > 79 characters)
Line 2305:80: E501 line too long (88 > 79 characters)
Line 2389:80: E501 line too long (88 > 79 characters)
Line 2391:80: E501 line too long (85 > 79 characters)
Line 2484:80: E501 line too long (87 > 79 characters)
Line 2528:80: E501 line too long (81 > 79 characters)
Line 2926:80: E501 line too long (84 > 79 characters)
Line 2989:80: E501 line too long (84 > 79 characters)
Line 3053:80: E501 line too long (88 > 79 characters)
Line 3057:80: E501 line too long (84 > 79 characters)
Line 3137:80: E501 line too long (82 > 79 characters)
Line 3156:80: E501 line too long (84 > 79 characters)
Line 3251:80: E501 line too long (82 > 79 characters)
Line 3326:80: E501 line too long (85 > 79 characters)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS as part of this PR.

Copy link

Linter Bot Results:

Hi @kainszs! Thanks for making this PR. We linted your code and found the following:

Some issues were found with the formatting of your code.

Code Location Outcome
main package ⚠️ Possible failure
testsuite ✅ Passed

Please have a look at the darker-main-code and darker-test-code steps here for more details: https://github.com/MDAnalysis/mdanalysis/actions/runs/8409848854/job/23027625925


Please note: The black linter is purely informational, you can safely ignore these outcomes if there are no flake8 failures!

Copy link

codecov bot commented Mar 24, 2024

Codecov Report

Attention: Patch coverage is 96.96970% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 93.60%. Comparing base (0582265) to head (030798c).

Files Patch % Lines
package/MDAnalysis/core/topologyattrs.py 96.96% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4528      +/-   ##
===========================================
- Coverage    93.65%   93.60%   -0.05%     
===========================================
  Files          168      180      +12     
  Lines        21215    22300    +1085     
  Branches      3908     3911       +3     
===========================================
+ Hits         19869    20875    +1006     
- Misses         888      964      +76     
- Partials       458      461       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RMeli
Copy link
Member

RMeli commented Mar 24, 2024

Hi @kainszs, thank you for your contribution.

I just realized that I accidentally formatted with black when saving. Should I just push the file again that only contains my changes and reopen the PR?

Yes please. There is an ongoing discussion to format with black (see #2450), but for PR we require to only format the lines you change, otherwise a review is nearly impossible (too many unrelated changes).

@kainszs kainszs closed this Mar 25, 2024
@kainszs kainszs deleted the atomname-methods-can-handle-empty-groups branch March 25, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Atomnames methods should handle empty group
3 participants