Add Type Hints to MDAnalysis.analysis.rms#5179
Open
Agarwalchetan wants to merge 7 commits intoMDAnalysis:developfrom
Open
Add Type Hints to MDAnalysis.analysis.rms#5179Agarwalchetan wants to merge 7 commits intoMDAnalysis:developfrom
Agarwalchetan wants to merge 7 commits intoMDAnalysis:developfrom
Conversation
There was a problem hiding this comment.
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5179 +/- ##
===========================================
- Coverage 92.73% 92.72% -0.01%
===========================================
Files 180 180
Lines 22475 22485 +10
Branches 3190 3190
===========================================
+ Hits 20842 20850 +8
- Misses 1176 1178 +2
Partials 457 457 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
|
Hi, just a gentle follow-up on this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds comprehensive type hints to the
MDAnalysis.analysis.rmsmodule as part of the ongoing effort to improve type safety, code documentation, and developer experience in MDAnalysis.Changes Made
New Imports
typingimports:Optional,Union,List,Dict,Any,Sequence,Tuple,TYPE_CHECKINGnumpy.typing.NDArrayfor array type hintsTYPE_CHECKINGguard forAtomGroupandUniverseimports to avoid circular import issues at runtimeFunction
rmsd()a: NDArray,b: NDArray- coordinate arraysweights: Optional[NDArray]- optional weight arraycenter: bool,superposition: bool- boolean flags-> floatFunction
process_selection()selectparameter:Union[str, Tuple[str, str], Dict[str, str]]-> Dict[str, Any]Class
RMSDatomgroup,reference,groupselections,weightsweights_groupselections,tol_mass,ref_frame__init__()parameters including complex union types_prepare()and_single_frame()methods:-> Nonemypywith type inference in complex control flowClass
RMSF__init__()parameters_prepare(),_single_frame(), and_conclude()methods:-> NoneConfiguration
mypy.inito enable type checking forMDAnalysis.analysis.rmsmodulePR Checklist
package/CHANGELOGfile updated?package/AUTHORS?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--5179.org.readthedocs.build/en/5179/