openmmforcefields icon indicating copy to clipboard operation
openmmforcefields copied to clipboard

Problem with Espaloma template generator

Open mallanos opened this issue 4 months ago • 2 comments

Hi everyone, After updating to OpenMM (8.3.1) and openmmforcefields (0.15.0), I got this error when trying to use the Espaloma template generator:

File "~/micromamba/envs/myenv/lib/python3.12/site-packages/openmmforcefields/generators/template_generators.py", line 1131, in convert_system_to_ffxml raise ForceException(f"Custom forces not supported. Found force of type {force_name}.") openmmforcefields.generators.template_generators.ForceException: Custom forces not supported. Found force of type CMMotionRemover.

I've been using this Template Generator before without problems. It seems like the CMMotionRemover force is being added by default to the OpenMM system. I wrote this quick fix, which has been working for me: https://github.com/openmm/openmmforcefields/commit/9e99a3d842472aa657a13e499ddd458e63c5aa38

If you think this is the right way to do it I can open a PR, or if there's a better way to solve it, let me know

Thanks!

mallanos avatar Sep 02 '25 20:09 mallanos

I'm surprised to see that error as I thought it should have been fixed for Espaloma by this commit: https://github.com/openmm/openmmforcefields/commit/722c2f61b61b35974e4ac5d363f0a006d31ad342. If you have a self-contained example that reproduces the problem, I can take a look and see what's happening.

epretti avatar Sep 02 '25 21:09 epretti

I suspect something other than the released version (via a conda package) is being imported. (This is easy to have happen accidentally!) The line numbers don't match up between the traceback and the source

mattwthompson avatar Sep 02 '25 22:09 mattwthompson