26#ifndef PYTHON_TEST_HELPER_H
27#define PYTHON_TEST_HELPER_H
100#define GUARD_PYTHON(available, reason) \
102 if (!(available)) { \
103 if (UTILSLIB::PythonTestHelper::isPythonRequired()) \
104 QFAIL(qPrintable(QString("HARD FAIL (MNE_REQUIRE_PYTHON=true): %1").arg(reason))); \
105 QSKIP(qPrintable(QString("SKIP: %1").arg(reason))); \
115#define GUARD_PYTHON_PACKAGE(helper, packageName) \
116 GUARD_PYTHON((helper).hasPackage(packageName), \
117 QString("Python package '%1' not available").arg(packageName))
152 bool hasPackage(
const QString& packageName)
const;
175 double evalDouble(
const QString& code,
bool* ok =
nullptr,
int timeoutMs = 30000)
const;
188 Eigen::VectorXd
evalVector(
const QString& code,
bool* ok =
nullptr,
int timeoutMs = 60000)
const;
201 Eigen::MatrixXd
evalMatrix(
const QString& code,
bool* ok =
nullptr,
int timeoutMs = 60000)
const;
214 const QStringList& args = {},
215 int timeoutMs = 120000)
const;
247 static bool writeMatrix(
const QString& filePath,
const Eigen::MatrixXd& mat);
259 static Eigen::MatrixXd
readMatrix(
const QString& filePath,
bool* ok =
nullptr);
288 const QString& outputFilePath,
290 int timeoutMs = 120000)
const;
Public umbrella header for UTILSLIB exposing the UTILSSHARED_EXPORT macro and build-info accessors.
#define UTILSSHARED_EXPORT
Embedding-free launcher that runs MNE-Python (or any user) scripts as a child process and streams the...
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
Script execution result container.
Python script launcher with logging and progress support.
Eigen::VectorXd evalVector(const QString &code, bool *ok=nullptr, int timeoutMs=60000) const
static bool writeMatrix(const QString &filePath, const Eigen::MatrixXd &mat)
double evalDouble(const QString &code, bool *ok=nullptr, int timeoutMs=30000) const
PythonRunnerResult runScript(const QString &scriptPath, const QStringList &args={}, int timeoutMs=120000) const
static QString testDataPath()
Eigen::MatrixXd evalMatrixViaFile(const QString &code, const QString &outputFilePath, bool *ok=nullptr, int timeoutMs=120000) const
bool isPythonAvailable() const
bool hasPackage(const QString &packageName) const
PythonRunnerResult eval(const QString &code, int timeoutMs=30000) const
static bool isPythonRequired()
static Eigen::MatrixXd readMatrix(const QString &filePath, bool *ok=nullptr)
Eigen::MatrixXd evalMatrix(const QString &code, bool *ok=nullptr, int timeoutMs=60000) const