28 #include <opm/input/eclipse/Schedule/SummaryState.hpp> 29 #include <opm/input/eclipse/Schedule/Action/PyAction.hpp> 32 #ifdef EMBEDDED_PYTHON 34 #include <pybind11/embed.h> 35 namespace py = pybind11;
42 #ifdef EMBEDDED_PYTHON 47 class __attribute__ ((visibility("hidden"))) PythonInterp {
49 explicit PythonInterp(
bool enable);
50 bool exec(
const std::string& python_code);
51 bool exec(
const std::string& python_code,
const Parser& parser, Deck& deck);
52 static bool supported() {
return true; };
53 explicit operator bool()
const {
return bool(this->guard); }
55 void load_module(
const std::string& python_file);
56 bool exec(
const std::string& python_code, py::module& context);
58 std::unique_ptr<py::scoped_interpreter> guard;
74 bool exec(
const std::string&) {
78 bool exec(
const std::string&,
const Parser&,
Deck&) {
86 static bool supported() {
return false; };
87 explicit operator bool()
const {
return false; }
89 bool fail() {
throw std::logic_error(
"The current opm code has been built without Python support;"); }
Definition: PythonInterp.hpp:67
Definition: Schedule.hpp:100
The hub of the parsing process.
Definition: Parser.hpp:61
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: EclipseState.hpp:66
Definition: PyAction.hpp:39
Definition: SummaryState.hpp:72