openforcefield / openff-toolkit

The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
http://openforcefield.org
MIT License
311 stars 90 forks source link

Add supported charge methods to API #1834

Closed mattwthompson closed 6 months ago

mattwthompson commented 6 months ago

Implements #1830

In [1]: from openff.toolkit.utils import *

In [2]: for _class in GLOBAL_TOOLKIT_REGISTRY.registered_toolkits:
   ...:     print(_class.__class__.__name__, _class.supported_charge_methods)
   ...:
OpenEyeToolkitWrapper ['am1bcc', 'am1-mulliken', 'gasteiger', 'mmff94', 'am1bccnosymspt', 'am1elf10', 'am1bccelf10']
RDKitToolkitWrapper ['mmff94', 'gasteiger']
AmberToolsToolkitWrapper ['am1bcc', 'am1-mulliken', 'gasteiger']
BuiltInToolkitWrapper ['zeros', 'formal_charge']

In [3]: from openff.toolkit import Molecule

In [4]: molecule = Molecule.from_smiles("CCO")

In [5]: molecule.get_available_charge_methods()
Out[5]:
['am1elf10',
 'am1bccelf10',
 'zeros',
 'am1bcc',
 'gasteiger',
 'am1-mulliken',
 'am1bccnosymspt',
 'formal_charge',
 'mmff94']

In [6]: from openff.toolkit.utils.nagl_wrapper import NAGLToolkitWrapper

In [7]: NAGLToolkitWrapper().supported_charge_methods
Out[7]: ['openff-gnn-am1bcc-0.0.1-alpha.1.pt', 'openff-gnn-am1bcc-0.1.0-rc.1.pt']
codecov[bot] commented 6 months ago

Codecov Report

Merging #1834 (d9cd9b0) into main (858d55e) will decrease coverage by 0.01%. The diff coverage is 96.15%.

:exclamation: Current head d9cd9b0 differs from pull request most recent head 81e14e0. Consider uploading reports for the commit 81e14e0 to get more accurate results

Additional details and impacted files