Skip to content

Refactor SAAMR topology traversal for MDAnalysis/RDKit exporters#58

Open
joelaforet wants to merge 4 commits into
mainfrom
issue-51/shared-saamr-topology-index
Open

Refactor SAAMR topology traversal for MDAnalysis/RDKit exporters#58
joelaforet wants to merge 4 commits into
mainfrom
issue-51/shared-saamr-topology-index

Conversation

@joelaforet
Copy link
Copy Markdown
Contributor

@joelaforet joelaforet commented May 5, 2026

Summary

  • Adds shared SAAMR role topology traversal helpers under mupt.interfaces._shared.
  • Refactors MDAnalysis all-atom export to use the shared indexed traversal.
  • The previous implementation called DFS traversal multiple times for each "role-level". Rather than run DFS more than once, we instead populate a dataclass to hold the information about node data corresponding to the different roles as we iterate. This means we only call DFS once per tree.
  • Adds shared-topology tests.

Stack Position

This is PR 1 of 3 in the role-aware RDKit/SDF export stack.

Stack:

  1. This PR: shared SAAMR topology traversal.
  2. Add role-aware RDKit molecule export #59: role-aware RDKit Mol export.
  3. Add export-only MuPT SDF writer #60: export-only mupt.muptio.sdf writer.

After This Merges

After merging this PR into main:

Verification

  • python -m pytest mupt/tests/interfaces/test_shared_topology.py -q
  • python -m pytest mupt/tests/interfaces/mdanalysis/test_exporters.py -q

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 90.27778% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mupt/interfaces/_shared/topology.py 88.33% 14 Missing ⚠️

📢 Thoughts on this report? Let us know!

@joelaforet joelaforet changed the title Refactor SAAMR topology traversal for interface exporters Refactor SAAMR topology traversal for MDAnalysis/RDKit exporters May 5, 2026
Copy link
Copy Markdown
Contributor Author

@joelaforet joelaforet left a comment

Choose a reason for hiding this comment

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

No comments on this one, happy to answer any questions/confusions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant