Docs: Fix doctest failures in align.py#5207
Open
IAyaanHere wants to merge 1 commit intoMDAnalysis:developfrom
Open
Docs: Fix doctest failures in align.py#5207IAyaanHere wants to merge 1 commit intoMDAnalysis:developfrom
IAyaanHere wants to merge 1 commit intoMDAnalysis:developfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5207 +/- ##
========================================
Coverage 92.72% 92.72%
========================================
Files 180 180
Lines 22475 22475
Branches 3190 3190
========================================
Hits 20841 20841
Misses 1177 1177
Partials 457 457 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Docs: Fix failing doctests in MDAnalysis.analysis.align
Fixed failing doctests in
package/MDAnalysis/analysis/align.pycaused by NumPy scalar types and non-deterministic memory addresses.Details:
NumPy Scalars & Mixed Types:
Functions like
rmsd()andalignto()are now returningnp.float64(or a mixed tuple ofnp.float64andfloat) instead of just plain floats. I updated the docstrings to match the actual output.Before (Failing):
Memory Address (RAM) Issue: The AlignTraj example was failing because the object print includes a memory address (e.g., 0x00...), which changes on every run. The standard ellipsis ... wasn't catching it properly on my environment.
Before (Failing):
Expected:
<MDAnalysis.analysis.align.AlignTraj object at ...>
Got:
<MDAnalysis.analysis.align.AlignTraj object at 0x000001D789C0F770>
After: Suppressed the output using _ = ... to make the test deterministic.
Verification: Ran tests locally:
pytest --doctest-modules package/MDAnalysis/analysis/align.pyResult: 2 passed (All warnings unrelated to changes).LLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no
PR Checklist
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--5207.org.readthedocs.build/en/5207/