v2.0.0
Loading...
Searching...
No Matches
ml_trainer.cpp File Reference

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

#include "ml_trainer.h"
#include <QDebug>
Include dependency graph for ml_trainer.cpp:

Go to the source code of this file.

Detailed Description

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

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.0
Date
April 2026

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.