Skip to content

Refactor residue-name matching logic in selection.py#5294

Merged
BradyAJohnston merged 8 commits intoMDAnalysis:developfrom
ParthUppal523:refactor-resname-selection
Mar 9, 2026
Merged

Refactor residue-name matching logic in selection.py#5294
BradyAJohnston merged 8 commits intoMDAnalysis:developfrom
ParthUppal523:refactor-resname-selection

Conversation

@ParthUppal523
Copy link
Copy Markdown
Contributor

@ParthUppal523 ParthUppal523 commented Mar 8, 2026

Fixes #5247

Changes made in this Pull Request:

  • Introduced a helper function Selection._apply_match_by_resnames() to centralize residue-name matching logic.
  • Refactored various classes to use the new helper method instead of implementing similar logic independently.
  • Removed duplicated code related to residue-name matching from these selection classes.
  • Verified that existing tests pass to ensure no change in behavior.

This refactor improves code maintainability by reducing duplication and providing a reusable utility for selections that operate on residue names.

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added? (NA)
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS?
  • LLM/AI disclosure was updated.

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--5294.org.readthedocs.build/en/5294/

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.82%. Comparing base (6e837a4) to head (baff88f).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5294      +/-   ##
===========================================
- Coverage    93.83%   93.82%   -0.01%     
===========================================
  Files          182      182              
  Lines        22501    22483      -18     
  Branches      3195     3195              
===========================================
- Hits         21114    21095      -19     
- Misses         924      925       +1     
  Partials       463      463              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BradyAJohnston
Copy link
Copy Markdown
Member

On initial inspection this looks fine - but you need to update your branch from develop as this PR is currently attempting to delete some lines from AUTHORS and CHANGELOG

@BradyAJohnston BradyAJohnston self-assigned this Mar 8, 2026
@ParthUppal523
Copy link
Copy Markdown
Contributor Author

@BradyAJohnston , thank you for your feedback. I have updated the branch as you suggested.

Comment thread package/CHANGELOG Outdated
@BradyAJohnston BradyAJohnston merged commit 9531c6e into MDAnalysis:develop Mar 9, 2026
23 of 24 checks passed
@ParthUppal523
Copy link
Copy Markdown
Contributor Author

Thank you @BradyAJohnston for approving the changes and merging the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code refactoring for token selection in selection.py‎

3 participants