- SimPEG.utils.hook(obj, method, name=None, overwrite=False, silent=False)#
Dynamically bind a class’s method to an instance of a different class.
Instance of a class that will be binded to a new method
The method that will be binded to obj. The syntax is ClassName.method
Provide a different name for the method being binded to obj. If
None, the original method name is used.
- overwritebool, default:
True, the hook will overwrite a preexisting method of obj if it has the same name as the name input argument. If
False, preexisting methods are not overwritten.
- silentbool, default:
Print whether a previous hook was overwritten