| 62 | } |
| 63 | |
| 64 | void 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 | |
| 79 | void PythonExtensionManager::registerRateBuilder( |
| 80 | const std::string& moduleName, const std::string& className, |
no test coverage detected