Skip to content

Fix time unit label in the RMSD example - #464

Open
qiaobochi040726-source wants to merge 3 commits into
MDAnalysis:developfrom
qiaobochi040726-source:20261122-rmsd-time-unit
Open

qiaobochi040726-source wants to merge 3 commits into
MDAnalysis:developfrom
qiaobochi040726-source:20261122-rmsd-time-unit

Conversation

@qiaobochi040726-source

@qiaobochi040726-source qiaobochi040726-source commented Nov 22, 2026 •

Copy link
Copy Markdown

The example builds its results DataFrame with a Time (ns) column, but R.results.rmsd reports picoseconds, so the table and plots were labelled wrong. Renamed the column to Time (ps) in the four cells that build a DataFrame from it, and in the saved output table, so the rendered page is right too.

Didn't rerun the notebook, the numbers and alignment of the printed table are untouched. Closes #438.


📚 Documentation preview 📚: https://mdanalysisuserguide--464.org.readthedocs.build/en/464/

@review-notebook-app

Copy link
Copy Markdown

Review Notebooks

Notebooks changed:

  • rmsd.ipynb in doc/source/examples/analysis/alignment_and_rms

Review visual diffs and comment on any notebook cell. All comments sync back to this PR.


Powered by ReviewNB

@orbeckst orbeckst left a comment •

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.

The unit change is good. Could you please also change the code so that the plots are done over time (with properly labeled axes) instead over frame? Thanks.

Also add yourself to doc/sources/AUTHORS at the end.

@orbeckst orbeckst self-assigned this Nov 28, 2026
@qiaobochi040726-source

Copy link
Copy Markdown
Author

Thank you for the review! I have addressed both points:

  • The four RMSD plots in rmsd.ipynb now plot over time instead of frame: each df.plot(...) call uses x='Time (ps)', with an explicit set_xlabel('Time (ps)') so the axes are properly labeled. I re-executed the notebook so the saved outputs match the updated code.
  • I added myself to doc/source/AUTHORS (2026 section) — I used doc/source/ as that is where the AUTHORS file lives in the repository; please let me know if you meant a different file.

Please take another look when you have a moment. Thanks again!

@orbeckst orbeckst left a comment

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.

Thanks for the updates. On review I found a few more issues. Could you please address the following?

Please also manually check the generated version on RTD https://mdanalysisuserguide--464.org.readthedocs.build/en/464/index.html and proof-read yourself. If something does not look right to you, please fix it.

Thanks!

invalid escape sequence '\A'

Looking at the rendered notebook I see the warning

<>:6: SyntaxWarning: invalid escape sequence '\A'
<>:6: SyntaxWarning: invalid escape sequence '\A'
/tmp/ipykernel_6388/2630904717.py:6: SyntaxWarning: invalid escape sequence '\A'
  ax.set_ylabel('RMSD ($\AA$)')

Can you fix this, e.g. by using a utf-8 "Å" character or making the string a Python raw string?

section Custom weights not consistent

I read the Custom weights section and the text does not describe code and graphs. The text says we're doing non-sensical resid weighting but the code does charge weighting. I think the charge-weighting makes slightly more sense. Can you rewrite the text along the lines of

  • To show how to use other less commonly used weights, we will use charges.
  • Weights have to be non-negative, so we always use np.abs(ag.charges)
  • Use these as weights instead of ag.resids.

update metadata at top

Unless the notebook automatically updates the Last updated: December 2022 with MDAnalysis 2.4.0-dev0 line please change it accordingly.

This branch has not been deployed

No deployments
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.

Incorrect time unit in RMSD example

2 participants