astrocook.core.debug_hooks module#

Hook for the debug plots requested by the core.

The core does not depend on the GUI (findings register F6): it hands the plot data to a handler, which the GUI sets to the signal that draws them on the main thread. Without a handler (scripts, tests) the request is dropped, as the GUI signal did when nothing was connected to it.

astrocook.core.debug_hooks.set_debug_plot_handler(handler: Callable[[dict], None] | None) → None[source]#

Set the function that receives the debug plot requests.

Parameters:

handler (callable or None) – Called with a dictionary of plot data ('title' and the arrays to plot); None removes the current handler.

astrocook.core.debug_hooks.request_debug_plot(plot_data: dict) → None[source]#

Pass plot_data to the debug plot handler, if one is set.