Progress reporting#
Pass on_progress to run_contingency_analysis_pandapower
and the engine will call it as outage groups finish. It is off by default.
This hook is pandapower only. get_ac_loadflow_results
and the powsybl backend do not accept it. Powsybl security analysis runs
entirely in Java; a callback from Python into that run is not implemented
and not planned in the pypowsybl wrapper. Progress reporting will stay
pandapower-local.
What it reports#
on_progress(done, total):
totalis the outage-group count,len(grouped_contingencies). With grouping off that is the contingency list. Withcfg.apply_outage_groupingseveral contingencies can share one group, sototalcan be smaller.- First call is
(0, total), before the first load flow. - Later calls are about once a second, then
(total, total)if the run succeeds. - A failing callback does not fail the analysis. The exception is logged and ignored.
Sequential and parallel#
The same callback works on both paths. Sequential calls it between load flows. Parallel calls it on the driver process; a Python callable cannot be sent into a Ray worker.