Skip to content

Support multi-residue molecules in template generator and improve performance#430

Merged
epretti merged 44 commits intoopenmm:mainfrom
epretti:whole-molecule
Apr 1, 2026
Merged

Support multi-residue molecules in template generator and improve performance#430
epretti merged 44 commits intoopenmm:mainfrom
epretti:whole-molecule

Conversation

@epretti
Copy link
Copy Markdown
Member

@epretti epretti commented Mar 4, 2026

Todo:

epretti and others added 30 commits December 12, 2025 14:41
Co-authored-by: Josh Horton <joshua.horton@openforcefield.org>
Co-authored-by: Jeff Wagner <jwagnerjpl@gmail.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 4, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.73%. Comparing base (0551fd1) to head (8eb86a5).
⚠️ Report is 1 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
+ Coverage   83.70%   84.73%   +1.02%     
==========================================
  Files           5        5              
  Lines         798      799       +1     
==========================================
+ Hits          668      677       +9     
+ Misses        130      122       -8     

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

@epretti epretti marked this pull request as ready for review March 9, 2026 19:12
Copy link
Copy Markdown
Contributor

@j-wags j-wags left a comment

Choose a reason for hiding this comment

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

I've been stress-testing this extensively over the past few days and haven't found any significant issues. Details of my testing are here. Other than yielding an issue with the new constraint functionality in OpenMM this behaves well in every situation I can think of. Thanks for all the hard work and attention to detail, @epretti! This is good to merge as far as I can tell.

@epretti
Copy link
Copy Markdown
Member Author

epretti commented Mar 26, 2026

Thanks for the detailed look at this. If no other concerns come up between now and our check-in tomorrow, I'll plan on merging this afterwards.

@mattwthompson
Copy link
Copy Markdown
Collaborator

No concerns from me

# Cache molecules
self._molecules.update({molecule.to_smiles(): molecule for molecule in molecules})
# Store the molecule by its formula for faster lookup
formula = tuple(sorted(collections.Counter(atom.atomic_number for atom in molecule.atoms).items()))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

toolkit molecules also have a to_hill_formula() method incase that is prefered.

Suggested change
formula = tuple(sorted(collections.Counter(atom.atomic_number for atom in molecule.atoms).items()))
formula = molecule.to_hill_formula()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah never mind you need it to be consistent with the formula method below for the openmm residue.

@epretti epretti enabled auto-merge (squash) March 27, 2026 18:22
@epretti
Copy link
Copy Markdown
Member Author

epretti commented Mar 27, 2026

This should be ready to merge.

@epretti
Copy link
Copy Markdown
Member Author

epretti commented Mar 31, 2026

As usual, I don't have the permissions to merge in this repository, so someone else will have to be responsible for pressing the approve button :)

@epretti epretti merged commit 7b765ec into openmm:main Apr 1, 2026
8 checks passed
@peastman
Copy link
Copy Markdown
Member

peastman commented Apr 1, 2026

I'm not quite sure why it doesn't let you. I tried to change the settings, and that seems to have caused it to be merged automatically. Let's see what happens on the next PR.

@epretti epretti deleted the whole-molecule branch April 1, 2026 16:19
@epretti
Copy link
Copy Markdown
Member Author

epretti commented Apr 1, 2026

OK. From what I recall in the past, the repository was set up so that PRs could not be merged without "one approving review from someone with write access". And (as makes sense when this feature is enabled) you cannot approve your own PR.

@peastman
Copy link
Copy Markdown
Member

peastman commented Apr 1, 2026

That makes sense. I'm ok with not requiring an approval if you are.

@epretti
Copy link
Copy Markdown
Member Author

epretti commented Apr 1, 2026

I think it's fine if you want to disable the check (since we don't have it on the main repository). I will always wait for approval before merging anyway; it's just that sometimes this happens in a comment or a conversation.

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

Labels

None yet

Projects

None yet

6 participants