Skip to content

Add add_library_charges_to_forcefield fn#71

Merged
fjclark merged 3 commits into
mainfrom
feature-custom-charges-functionality
Jul 13, 2026
Merged

Add add_library_charges_to_forcefield fn#71
fjclark merged 3 commits into
mainfrom
feature-custom-charges-functionality

Conversation

@fjclark

@fjclark fjclark commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Add add_library_charges_to_forcefield convenience function for writing partial charges from a Molecule to library charges. Recommended over https://github.com/openforcefield/openff-toolkit/blob/120f71473a4b87cb314bd7acc706ce7e9ffdeda4/openff/toolkit/typing/engines/smirnoff/parameters.py#L3009 because it uses the MergeQueryHs trick to ensure fast matching.

Addresses #64.

Status

  • Ready to go

@fjclark

fjclark commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

@jthorton, if you're still interested in this, does this seem like a reasonable solution? I'm keen to keep everything in the force field as I think this is cleaner, rather than using the partial charges in a Molecule directly. This means a fit can be reproduced from the force field file and presto settings file. Avoiding using the partial charges directly seems in keeping with the argument in openforcefield/openff-toolkit#806 (comment). Thanks.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.85%. Comparing base (28483fb) to head (a20b527).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
+ Coverage   92.77%   92.85%   +0.08%     
==========================================
  Files          26       26              
  Lines        2810     2843      +33     
==========================================
+ Hits         2607     2640      +33     
  Misses        203      203              

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

@fjclark fjclark merged commit 43cd405 into main Jul 13, 2026
7 checks passed
@fjclark fjclark deleted the feature-custom-charges-functionality branch July 13, 2026 12:17
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