XiaojuanHu / ffaffurr-dev

Framework For Adjusting Force Fields Using Regularized Regression (FFAFFURR)
0 stars 1 forks source link

Update imports for latest openmm version #1

Open shudipto-amin opened 2 years ago

shudipto-amin commented 2 years ago

The problem

Using newer version of openmm installed according to this page, running python ffaffurr.py results in the following error:

Warning: importing 'simtk.openmm' is deprecated.  Import 'openmm' instead.
Traceback (most recent call last):
File "ffaffurr.py", line 15, in <module>
from simtk.openmm.app.internal import *
ModuleNotFoundError: No module named 'simtk.openmm.app.internal' 

It appears that the import error is due to using deprecated code.

Suggested solution

XiaojuanHu commented 2 years ago

Which version of openmm are you using? I'm using 7.4.2 and didn't see this error came out.

shudipto-amin commented 2 years ago

Which version of openmm are you using? I'm using 7.4.2 and didn't see this error came out.

The version I get when I install it is 7.7. It is possible that when you update an older version, it only updates to the latest backward compatible version.

shudipto-amin commented 2 years ago

It is possible to avoid the problem by installing an older version of openmm (< 7.5), but it takes a few extra steps:

conda --prepend channels omnia
conda install -c omnia openmm=7.4.2

But openmm has moved away from using omnia channel, and they have replaced all documentation for older versions with newer ones. A user not familiar with the older version (or even users who are) will be lost. Also, as omnia version gets older, it will become more and more depracated probably.

I also ran into some issues with numpy installation after doing it this way - so we would have to provide instructions on installing all packages in the right order. I would very much prefer to use the newer version.