Skip to content

DOC: fix doctests in universe.py for newer NumPy and optional rdkit#5297

Open
Kd1880 wants to merge 3 commits intoMDAnalysis:developfrom
Kd1880:fix/doctest-universe
Open

DOC: fix doctests in universe.py for newer NumPy and optional rdkit#5297
Kd1880 wants to merge 3 commits intoMDAnalysis:developfrom
Kd1880:fix/doctest-universe

Conversation

@Kd1880
Copy link

@Kd1880 Kd1880 commented Mar 10, 2026

Fixes part of #3925

Changes made in this Pull Request:

  • Updated expected doctest output for u.atoms.tempfactors in universe.py — newer NumPy returns array([..., shape=(3341,)) instead of array([...])
  • Added # doctest: +SKIP to all from_smiles() examples that require optional rdkit library

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes
(Claude by Anthropic was used to help identify and understand the fixes. Actual code changes were made manually.)

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added? (documentation-only change, no new tests needed)
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS?
  • LLM/AI disclosure was updated.

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--5297.org.readthedocs.build/en/5297/

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.82%. Comparing base (9531c6e) to head (afd647f).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5297   +/-   ##
========================================
  Coverage    93.82%   93.82%           
========================================
  Files          182      182           
  Lines        22483    22483           
  Branches      3195     3195           
========================================
  Hits         21095    21095           
  Misses         925      925           
  Partials       463      463           

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

Copy link
Member

@BradyAJohnston BradyAJohnston left a comment

Choose a reason for hiding this comment

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

Skipping lines isn't a solution to doctests. If it's in the docs it should be runnable code. The environment for running the tests just needs the optional packages installed.

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.

2 participants