7 #include <pybind11/embed.h> 11 "from FWCore.ParameterSet.Types import makeCppPSet\n" 13 initCommand +=
fileName +
"').read())";
14 pybind11::exec(initCommand);
15 pybind11::exec(
"makeCppPSet(locals(), topPSet)");
20 command +=
"\nfrom FWCore.ParameterSet.Types import makeCppPSet\nmakeCppPSet(locals(), topPSet)";
25 namespace cmspybind11 {
42 pybind11::scoped_interpreter guard{};
44 std::unique_ptr<ParameterSet> retVal;
48 mainModule.attr(
"topPSet") = pybind11::cast(&theProcessPSet);
57 }
catch (pybind11::error_already_set
const&
e) {
60 retVal = std::make_unique<edm::ParameterSet>(
ParameterSet(theProcessPSet.
pset()));
void initializePyBind11Module()
void pythonToCppException(const std::string &iType, const std::string &error)
static void makePSetsFromString(std::string const &module)
edm::ParameterSet & pset()
std::unique_ptr< edm::ParameterSet > parameterSet() const
static void makePSetsFromFile(std::string const &fileName)
std::unique_ptr< ParameterSet > readPSetsFrom(std::string const &fileOrString)
cond::Hash import(Session &source, const cond::Hash &sourcePayloadId, const std::string &inputTypeName, const void *inputPtr, Session &destination)
std::unique_ptr< ParameterSet > readConfig(std::string const &config)
void makeParameterSets(std::string const &configtext, std::unique_ptr< ParameterSet > &main)
essentially the same as the previous method