Skip to content

Add fix for charge assignment fallback and test#1262

Draft
j-wags wants to merge 2 commits intomainfrom
fix-charge-assignment-fallbacks
Draft

Add fix for charge assignment fallback and test#1262
j-wags wants to merge 2 commits intomainfrom
fix-charge-assignment-fallbacks

Conversation

@j-wags
Copy link
Copy Markdown
Member

@j-wags j-wags commented Jul 16, 2025

Description

Provide a brief description of the PR's purpose here.

Checklist

  • Add tests
  • Lint
  • Update docstrings

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 16, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 93.80%. Comparing base (bb3b948) to head (d938e9a).

Files with missing lines Patch % Lines
openff/interchange/smirnoff/_nonbonded.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1262      +/-   ##
==========================================
- Coverage   93.86%   93.80%   -0.06%     
==========================================
  Files          72       72              
  Lines        6240     6246       +6     
==========================================
+ Hits         5857     5859       +2     
- Misses        383      387       +4     

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

@j-wags
Copy link
Copy Markdown
Member Author

j-wags commented Aug 2, 2025

I forgot this PR existed and made another push at this here: #1206 (comment)

@j-wags j-wags mentioned this pull request Aug 2, 2025
mattwthompson added a commit that referenced this pull request Aug 19, 2025
* initial implementation of NAGLChargesHandler

* have testing env use naglcharges toolkit branch

* adding a bunch of tests, some todos remain

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* I guess valueerror is fine

* update vsite charge test

* Apply suggestions from code review

Co-authored-by: Matt Thompson <mattwthompson@protonmail.com>

* Replace usages of Interchange.from_smirnoff with ForceField.create_interchange

* remove repeated nagl FF creation and replace with new fixture

* add check that charge_from_molecules takes precedence over NAGLCharges

* Tighten all total charge tolerances in new tests down to 1e-10

* add test for NAGL charge assignment failure falling back to lower precedence charge model that CAN assign charges

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Implement correct(er) error handling/reporting behavior for NAGLCharges

* test new error handling logic

* test with new openff-nagl-models

* remove fallback behavior test since it's being handled separately in #1262

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* use a more recent nagl model in host-gues example in case that helps prevent fetch?

* don't monkeypatch get_release_metadata (since it doesn't exist any more)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add fail fast and strip down test matrix

* try getting openff-nagl-models from main branch

* better check for NAGL wrapper in registry

* add tests for naglcharges being superseded by charge_from_molecules

* rename existing sage_with_nagl fixture in charge assignment logging tests to sage_with_nagl_chargeincrements to differentiate from new NAGLChargesHandler

* add naglcharges speed tests

* add charge assignment logging tests and update strings with NAGL behavior and tests

* improve test documentation and consolidate invalid model name tests

* implement dangerous logic for charge method fallback handling and error output, and test

* remove dangerously broad charge handler fallback and mark tests as xfail

* Lint and various cleanups/import rearrangement

* restore testing matrix

* relax performance test runtime

* add link to charge fallback test skip reasoning

* revert unrelated changes

* update openff-nagl-models branch used for test envs

* try not installing from branches in docs env

* have docs env fetch dev branches of toolkit and nagl-models

* Increase allowed execution time on nagl runtime tests

* route all charge assignment through cached _compute_partial_charges method

* remove toolkitam1bcc from sage_with_nagl_charges test fixture

* rename sage_with_nagl_charges test fixture to sage_nagl

* remove unnecessary ToolkitAM1BCCHandler registration+deregistration from CIMH test

* point to main branch of nagl-models now that PR is merged

* Drop development versions

* clean up pre-merge

* update releasehistory

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matt Thompson <mattwthompson@protonmail.com>
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.

1 participant