Implementation of MLLIB::MLTrainer that dispatches training scripts through UTILSLIB::PythonRunner. More...

Go to the source code of this file.
Implementation of MLLIB::MLTrainer that dispatches training scripts through UTILSLIB::PythonRunner.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
The class is a few-line orchestrator on top of UTILSLIB::PythonRunner: run first checks that a Python interpreter is reachable (returning an error-populated UTILSLIB::PythonRunnerResult if not), then branches on whether a venvDir is configured. With a venv it calls runInVenv which creates / refreshes the virtual environment and installs the required packages before launching the script; without a venv it forwards directly to run and uses whatever interpreter the caller's configuration points at.
MLLIB::MLTrainer::checkPrerequisites iterates the caller's package list through isPackageAvailable and returns the missing ones so the UI can surface a single "install these to enable
training" message instead of failing mid-script. The whole TU is gated by WASMBUILD because QProcess is not part of Qt-for-WASM.
Definition in file ml_trainer.cpp.