Ensing-Laboratory / FABULOUS

Ferry, Alberto, and Bernd's Ultimate Learning Of Useful Slow-coordinates
GNU Lesser General Public License v3.0
7 stars 2 forks source link

Refactor main.py for CLI and reusability #3

Closed dwhswenson closed 3 years ago

dwhswenson commented 3 years ago

This refactors main.py in the AD example so that parts of it can more easily be moved into the package and thus reused by client code/turned into a CLI. A couple of comments in the main() function highlight the parts that would be different for OPS — otherwise, the outline of that function will be pretty much the same for the OPS CLI. (Already up to the concatenated cv_data and md_data in https://github.com/dwhswenson/fabulous-paths/pull/6.)

The design goal has been to keep the overall interface small (few functions that need to be called by the CLI code), while also using FABULOUS to handle as much as possible, so the user experience is similar in either case.

Most of the ML parameters have been moved to a configuration file. The config file I created matches the example, but anything that also matches defaults could be removed from the config file. I currently put keep_atoms in the config file, but I think I have a better way of handling that on the way.

This adds the requirement of the pyyaml package (imported under yaml, pip/conda install pyyaml) to parse the configuration file.

It seems to still work (at least, I started a second gen on my laptop before I stopped it).