Restore gmxapi._gmxapi.add_mdmodule() Python functionality.
Some functionality was orphaned and forgotten in the last-minute changes to core gmxapi infrastructure as the Python package was merged to GROMACS 2020. Issue #3145 remains to be addressed, but we should restore some of the gmxapi 0.0.7 functionality that was lost in gmxapi 0.1.
A logic error was introduced as
gmxapi::System was deprecated, in which
IRestraintPotential providers added to the system are not attached to the simulation that is launched. This was possible because of some confusing redundancy that was introduced, in which a container was duplicated in the
gmxpy::PyContext proxy, but roles were not completely updated.
A working updated protocol is demonstrated in the C++ tests, illustrated in the following sequence diagram.
It took an extra few years to enable automated testing of Python code in the GROMACS CI pipelines, during which time development and test coverage languished.
The broken protocol is illustrated in the following sequence diagram.
- Make minimal changes to the gmxapi interfaces related to
gmxapi::Contextat this time.
- Update the
gmxapi._gmxapi.add_mdmodule()function in the Python bindings to allow the target of the plugin
bind()behavior to target the correct instance of the container.
- Add a test to
python_packaging/sample_restraintto confirm that IRestraintPotental code is actually called in GROMACS 2020+ / gmxapi 0.1+.
- Follow up in issue #4079 to migrate to using a
SimulationContextinterface, and remove
The proposed patch for GROMACS 2020, 2021, and 2022 is illustrated in the following sequence diagram.