Closed benbovy closed 4 years ago
"Diagnostics" is a bit too specific to describe the feature after all. Runtime hooks may be useful not only for monitoring a simulation, but also for controlling its execution (e.g., early stopping the simulation after some time exceeded or based on another condition, skip the rest of the time step execution and continue, etc.) possibly via specific signals returned by runtime hook functions (That we can implement later).
Unfortunately, Sphinx IPython directive doesn't work well with classes (https://github.com/ipython/ipython/issues/11362)
black . && flake8
whats-new.rst
for all changes andapi.rst
for new APIThis PR supersedes #93. After discussion with @rlange2, we needed to think more about the design. Using the generic "callback" term was probably not the most appropriate to describe this feature. I'm now pretty happy with a
@runtime_hook
decorator for simple functions and aRuntimeDiagnostics
base class for more advanced simulation runtime diagnostics.