Skip to content

Comments

added type annotations to most common oublic methods for Bio/Align, A…#5057

Closed
dimi1729 wants to merge 2 commits intobiopython:masterfrom
dimi1729:type-annotations
Closed

added type annotations to most common oublic methods for Bio/Align, A…#5057
dimi1729 wants to merge 2 commits intobiopython:masterfrom
dimi1729:type-annotations

Conversation

@dimi1729
Copy link
Contributor

@dimi1729 dimi1729 commented Sep 5, 2025

…lignIO, Graphics, HMM, KEGG, and PDB

  • 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.)

Addresses #2236

Added type annotations to most getter functions in Align, AlignIO, Graphics, HMM, KEGG, and PDB modules. While this is not a completed effort, it will hopefully be useful to people who use these modules and like type hints. Since no added functionality was added and very little actual logic was changed, no additional tests were created, but all existing tests were ran.

@peterjc
Copy link
Member

peterjc commented Sep 11, 2025

Looks like there are still 3 mypy errors?

"""
self.alignment = alignment
self.ic_vector = []
self.ic_vector: list[float] = []
Copy link
Member

Choose a reason for hiding this comment

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

Should this be broader than just list? Arrays? (I don't know)

@peterjc
Copy link
Member

peterjc commented Sep 11, 2025

It would have been easier to review this in chunks, especially when multiple code owners are involed.


seq = seq if strand == ref_first_strand else seq.reverse_complement()
if strand != ref_first_strand:
sequence = Seq(sequence.reverse_complement())
Copy link
Member

Choose a reason for hiding this comment

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

This is a change from just using the method - why?

@peterjc
Copy link
Member

peterjc commented Oct 26, 2025

I'm going to close this, but encourage you to resubmit this in smaller chunks like just Graphics, just HMM, just KEGG, etc - once the automated checks are all passing for you locally. This will be easier to review - and easier to assign for review. Thank you.

@peterjc peterjc closed this Oct 26, 2025
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.

3 participants