openmm / openmmforcefields

CHARMM and AMBER forcefields for OpenMM (with small molecule support)
http://openmm.org
Other
254 stars 80 forks source link

Plugin architecture? #275

Open jchodera opened 1 year ago

jchodera commented 1 year ago

Could we refactor openmmforcefields to use a plugin architecture?

mikemhenry commented 1 year ago

A user should be able to package an openff forcefield as a small python package (pyproject.toml + openff.xml) that can be discovered by openmmforcefields

mattwthompson commented 1 year ago

What sort of plugin is being proposed here? Something that inherits classes from this package or something that discovers SMIRNOFF force fields and shoves them into this package's machinery? The toolkit already finds force fields wired up with its entry point.

For example, I can grab this package and the toolkit knows about its OFFXMLs:

In [1]: from openff.toolkit.typing.engines.smirnoff.forcefield import get_available_force_fields

In [2]: assert "de-force-1.0.0.offxml" in get_available_force_fields()

openmmforcefields should, by extension, not need to bend over backwards to support this