You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AFAIK the only way to add a Python module to PluginPlay is via a pattern like:
# Redundant import is issuefrompluginplayimportpluginplayfromcppyy.gbl.stdimportmake_sharedclassMyModule(pluginplay.ModuleBase):
def__init__(self):
super().__init__(self)
# rest of ctordefrun_(self, inputs, submods):
# rest of bodymm=pluginplay.ModuleManager()
mm.add_module("module key", make_shared[MyModule]())
# Ideal solution# (currently doesn't work see #269)# mm.add_module("module key", MyModule())#Also fine #(currently doesn't work leads to double free or corruption error)# mm.add_module[MyModule]("module key")# Alternatively could expose a Python free function to wrap# calling shared_ptr from Python, e.g.#pluginplay.add_module(mm, MyModule)#
Relying on std::shared_ptr is very non-Pythonic and I would suspect users would prefer one of the three suggestions over dealing with std::shared_ptr
The text was updated successfully, but these errors were encountered:
AFAIK the only way to add a Python module to PluginPlay is via a pattern like:
Relying on
std::shared_ptr
is very non-Pythonic and I would suspect users would prefer one of the three suggestions over dealing withstd::shared_ptr
The text was updated successfully, but these errors were encountered: