##// END OF EJS Templates
Some added fake specro and switched to new spwc getting rid of DataFrames...
Some added fake specro and switched to new spwc getting rid of DataFrames Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1440:824c70b31e8a
r1464:dce5077d4598
Show More
python_interpreter.cpp
63 lines | 1.3 KiB | text/x-c | CppLexer
Added ultra preliminary version of python providers...
r1428 #include "python_interpreter.h"
#include <Data/DateTimeRange.h>
#include <TimeSeries.h>
#include <functional>
#include <iostream>
#include <pybind11/embed.h>
#include <pybind11/functional.h>
#include <pybind11/stl.h>
Amda, cdaweb and test python are now fully embedded in SciQLop...
r1440
Added ultra preliminary version of python providers...
r1428 namespace py = pybind11;
PYBIND11_EMBEDDED_MODULE(PythonProviders, m) {}
static pybind11::gil_scoped_release* _rel = nullptr;
PythonInterpreter::PythonInterpreter()
{
py::initialize_interpreter(false);
}
Added POC AMDA python impl and CDAWEB bits...
r1430 void PythonInterpreter::add_register_callback(
std::function<void(const std::vector<product_t>&, provider_funct_t)> callback)
Added ultra preliminary version of python providers...
r1428 {
py::module PythonProviders = py::module::import("PythonProviders");
PythonProviders.attr("register_product") = callback;
}
PythonInterpreter::~PythonInterpreter()
{
if (_rel)
delete _rel;
py::finalize_interpreter();
}
void PythonInterpreter::eval(const std::string& file)
{
try
{
py::eval_file(file);
}
catch (py::error_already_set const& pythonErr)
{
std::cout << pythonErr.what();
}
Some more progress on Python Providers side, works with a simple request on CDAWeb....
r1429 }
Amda, cdaweb and test python are now fully embedded in SciQLop...
r1440 void PythonInterpreter::eval_str(const std::string& content)
{
try
{
py::eval<py::eval_statements>(content);
}
catch (py::error_already_set const& pythonErr)
{
std::cout << pythonErr.what();
}
}
Some more progress on Python Providers side, works with a simple request on CDAWeb....
r1429 void PythonInterpreter::release()
{
Added ultra preliminary version of python providers...
r1428 _rel = new py::gil_scoped_release();
}