Skip to content

Prevent side-effect in SeqRecord._per_letter_annotations - #5031

Merged
peterjc merged 2 commits into
biopython:masterfrom
michaelfm1211:fix-_per_letter_annotations
Jul 24, 2025
Merged

peterjc merged 2 commits into
biopython:masterfrom
michaelfm1211:fix-_per_letter_annotations

Conversation

@michaelfm1211

Copy link
Copy Markdown
Contributor

Implements @mdehoon's suggestion to fix #5015.

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run pre-commit
    locally, and understand that continuous integration checks will be used to
    confirm the Biopython unit tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

Closes #5015

@codecov

codecov Bot commented Jul 18, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.34%. Comparing base (66ad0a0) to head (be7382c).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5031      +/-   ##
==========================================
+ Coverage   85.45%   86.34%   +0.89%     
==========================================
  Files         286      286              
  Lines       59851    59853       +2     
==========================================
+ Hits        51144    51680     +536     
+ Misses       8707     8173     -534     

☔ 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.

Comment thread Bio/SeqRecord.py Outdated

# _per_letter_annotations is lazily initialized when
# letter_annotations is accessed, so do nothing if uninitialized.
# See issue #5015

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would drop this comment line - we have git blame, and the comment and test alone are clear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I just pushed another commit which does that.

@michaelfm1211
michaelfm1211 force-pushed the fix-_per_letter_annotations branch from 04bfcb3 to 9edecd4 Compare July 18, 2025 23:05
@michaelfm1211

Copy link
Copy Markdown
Contributor Author

@peterjc Is this ready for merge?

Comment thread Tests/test_SeqRecord.py Resolved
@peterjc

peterjc commented Jul 24, 2025

Copy link
Copy Markdown
Member

OK @mdehoon?

@peterjc
peterjc enabled auto-merge (rebase) July 24, 2025 16:59
@peterjc
peterjc merged commit 6851cd8 into biopython:master Jul 24, 2025
@manulera

manulera commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

Thanks for the fix! Really appreciated

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.

SeqRecord.reverse_complement() edits parent sequence in place

4 participants