Skip to content

Conversation

@epretti
Copy link
Member

@epretti epretti commented Jul 21, 2025

A few items from the issue list:

I found that some areas of the generator code could use some cleaning up. Some areas I would appreciate any input on:

  • The DummySystemGenerator feature was broken in multiple ways; it's unclear that it ever worked. Now fixed with a very basic test case added. Is/was there any actual use for this?
  • All template generators now take template_generator_kwargs as an init parameter. This is only used by espaloma (note: it's not actually a **kwargs, just a single keyword argument!), but the other generators previously took and ignored **kwargs, silently swallowing misspelled parameters.

Some minor changes:

  • Removed some duplicated code present in helper methods for test cases
  • Consolidated custom classproperty implementations into one
  • Fixed improper_atom_ordering argument of OpenMMSystemMixin.convert_system_to_ffxml() being silently ignored
  • Removed some unused local variables
  • Fixed an OpenFF units import for compatibility with an older openff-toolkit version that is able to be installed with espaloma 0.3.2
  • Bump OpenMM versions in CI now that 8.3.1 packages are up on conda-forge
  • Fixed formatting, out-of-order parameters, inaccurate types and descriptions, and minor errors in docstrings

Though espaloma testing isn't set up in CI, I've checked the espaloma tests locally.

epretti added 12 commits July 16, 2025 17:11
* Remove residue_atoms argument of generate_residue_template() methods: fixes openmm#379

* OpenMMSystemMixin.convert_system_to_ffxml improper_atom_ordering was silently ignored

* Removal of unused kwargs that could cause misspelled parameters to be silently ignored

* Removal of some unused local variables

* DummySystemGenerator: was broken due to early return

* Consolidate custom classproperty implementation

* Docstrings: parameters out of order, errors, formatting
* Use common logic for checking user-specified partial charges sum to
  total formal charge, and raising a warning if so

* GAFFTemplateGenerator no longer silently adjusts user-specified
  partial charges if they don't sum to the formal charge: fixes openmm#373
* Consolidate propagate_dynamics() implementations into
  TemplateGeneratorBaseCase

* Remove charges_from_system(), charges_are_equal(), compute_energy(),
  and compare_energies() from TestGAFFTemplateGenerator since identical
  implementations are available in TemplateGeneratorBaseCase
* Ensure warnings are raised / not raised as appropriate (GAFF, SMIRNOFF)

* SMIRNOFF should accept user charges not matching once we warn about it
@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2025

⚠️ 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.14%. Comparing base (6f372f0) to head (20a7d94).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #391      +/-   ##
==========================================
+ Coverage   83.16%   84.14%   +0.98%     
==========================================
  Files           5        5              
  Lines         802      776      -26     
==========================================
- Hits          667      653      -14     
+ Misses        135      123      -12     

☔ 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 July 21, 2025 22:04
@mikemhenry
Copy link
Collaborator

This looks great! No idea what DummySystemGenerator was used for

@epretti
Copy link
Member Author

epretti commented Jul 30, 2025

Thanks for taking a look. Once the espaloma tests are working, I can try merging that into here to verify that they pass.

@mikemhenry mikemhenry mentioned this pull request Jul 30, 2025
@epretti
Copy link
Member Author

epretti commented Aug 4, 2025

Looks like espaloma tests are running and passing on Python 3.11 and 3.12.

Copy link
Collaborator

@mattwthompson mattwthompson left a comment

Choose a reason for hiding this comment

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

I spent about 15 minutes going through this and found only style suggestions and things that could be major changes but would cause all tests1 to fail if they were genuine issues. I did not look closely at the entire diff, if you feel like that is needed I will find the time.

Nice work - I can tell you're looking into things with detail.

Footnotes

  1. I'm putting my trust in CodeCov here

@epretti
Copy link
Member Author

epretti commented Aug 4, 2025

I spent about 15 minutes going through this and found only style suggestions and things that could be major changes but would cause all tests to fail if they were genuine issues. I did not look closely at the entire diff, if you feel like that is needed I will find the time.

@mattwthompson Thanks for taking a look. If you do have time to look through other parts, and if you do have enough familiarity with them to review them, that could be very helpful. If not, no worries at all!

@ anybody... See my comments above on DummySystemGenerator, which appeared to me to have never been a working feature. Going only on what I can guess about its history, I would think it might be removable altogether, but anyone who knows more about its provenance and if it retains any useful purpose currently: please let me know otherwise. For now in this PR, I am not removing it, just getting it working again.

@mikemhenry
Copy link
Collaborator

@epretti Is this good to squash and merge?

@epretti epretti merged commit 301dad9 into openmm:main Aug 6, 2025
14 checks passed
@epretti epretti deleted the template-generator-fixes branch August 6, 2025 19:38
@epretti epretti mentioned this pull request Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants