simpeg.utils.call_hooks#
- simpeg.utils.call_hooks(match, mainFirst=False)[source]#
Wrap a function to an instance of a class.
Use the following syntax:
@call_hooks('doEndIteration') def doEndIteration(self): pass
This will call everything named _doEndIteration at the beginning of the function call. By default the main method (doEndIteration) is run after all of the sub methods (_doEndIteration*). This can be reversed by adding the mainFirst=True kwarg.