Skip to content

make ambertools optional - #462

Open
mikemhenry wants to merge 14 commits into
openmm:mainfrom
mikemhenry:feat/make-ambertools-optional
Open

mikemhenry wants to merge 14 commits into
openmm:mainfrom
mikemhenry:feat/make-ambertools-optional

Conversation

@mikemhenry

@mikemhenry mikemhenry commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

This PR makes ambertools optional for using openmmforcefields to apply a Open Force Field Initiative force field and is only needed when using a GAFF force field.

It also updates the Open Force Field Initiative force field tests to use nagl for charges instead of am1bcc.

@mikemhenry
mikemhenry requested a review from epretti November 20, 2026 20:06
@mikemhenry
mikemhenry marked this pull request as ready for review November 20, 2026 20:06
…ing if `AmberToolsToolkitWrapper.is_available()`
@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

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

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.52%. Comparing base (0edd3bb) to head (d844354).

Files with missing lines Patch % Lines
...penmmforcefields/generators/template_generators.py 90.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #462      +/-   ##
==========================================
+ Coverage   84.48%   84.52%   +0.04%     
==========================================
  Files           5        5              
  Lines         799      808       +9     
==========================================
+ Hits          675      683       +8     
- Misses        124      125       +1     

☔ View full report in Codecov by Harness.
📢 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.

if exc.name != "parmed":
raise
raise RuntimeError(
"ParmEd is required for GAFF parameter assignment. Install it with: pip install parmed"

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.

I'm not sure about the explicit recommendation to install with pip here, since users might still install OpenMMForceFields with conda (in which case it is probably better to avoid creating an environment in which packages have been installed with both conda and pip).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My thinking here is that if the package is installed with conda, then they will have parmed and ambertools, if the install it via pip, then they could be missing parmed but have ambertools in their path, so it felt like the only edge case here is solved with a pip install.


# Should not point to any valid force field
with pytest.raises(ValueError, match="Can't load or parse specified SMIRNOFF"):
SMIRNOFFTemplateGenerator(forcefield="openff_unconstrained-2.0.0")

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.

Should this and two more below be changed to 2.3.0 (just for consistency's sake even though none of these are being used for parameterization)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good idea! It just has be invalid so we can make it still be invalid but look more consistent

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.

3 participants