MCPcopy Create free account
hub / github.com/Cantera/cantera / registerRateBuilders

Method registerRateBuilders

src/extensions/PythonExtensionManager.cpp:64–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void PythonExtensionManager::registerRateBuilders(const string& extensionName)
65{
66 // Each rate builder class is decorated with @extension, which calls the
67 // registerRateBuilder method to register that class. So all we have
68 // to do here is load the module.
69 PyObject* module_name = PyUnicode_FromString(extensionName.c_str());
70 PyObject* py_module = PyImport_Import(module_name);
71 Py_DECREF(module_name);
72 if (py_module == nullptr) {
73 throw CanteraError("PythonExtensionManager::registerRateBuilders",
74 "Problem loading module:\n{}", getPythonExceptionInfo());
75 }
76 ct_registerReactionDelegators();
77}
78
79void PythonExtensionManager::registerRateBuilder(
80 const std::string& moduleName, const std::string& className,

Callers 1

loadExtensionMethod · 0.45

Calls 2

CanteraErrorClass · 0.85
getPythonExceptionInfoFunction · 0.85

Tested by

no test coverage detected