Merge remote-tracking branch 'origin/release-2021' into merge-2021-into-master
[alexxy/gromacs.git] / python_packaging / src / gmxapi / export_system.cpp
index b504ccb9e74599b62bc3af6d1c91e722ecd7b33f..39eeb91d78c3e0b5c0818aeb2e3a394b896290c0 100644 (file)
@@ -44,6 +44,7 @@
 #include "gmxapi/session.h"
 #include "gmxapi/status.h"
 #include "gmxapi/system.h"
+#include "gmxapi/version.h"
 
 #include "pycontext.h"
 #include "pysystem.h"
@@ -81,14 +82,7 @@ void export_system(py::module& m)
 
     // Export system container class
     py::class_<System, std::shared_ptr<System>> system(m, "MDSystem");
-    system.def(
-            "launch",
-            [](System* system, std::shared_ptr<PyContext> context) {
-                auto work       = gmxapi::getWork(*system->get());
-                auto newSession = context->launch(*work);
-                return newSession;
-            },
-            "Launch the configured workflow in the provided context.");
+    system.def("launch", &launch, "Launch the configured workflow in the provided context.");
 
     // Module-level function
     m.def("from_tpr",