Reporting#

render(sol, case_name='', *, output=None, stream=None, detail='auto', options=None)#

Auto-detect best format and render.

Parameters:
  • sol -- Solved power flow case.

  • case_name -- Optional name for report header.

  • output -- Output file path (extension determines format).

  • stream -- Output stream for TTY detection. Defaults to sys.stdout.

  • detail -- Output detail level - "full", "summary", or "auto" (default). Auto: <=200 buses = full, 201-500 = no branches, >500 = summary only.

  • options -- Presentation knobs (rating column, top-N cap). None falls back to ReportOptions defaults (rating_index=1).

Returns:

Formatted report string.

render_plain(sol, case_name='', *, options=None)#

Render a plain-text report (adaptive column widths) as a string.

Parameters match render() (sol, case_name, options). On convergence failure: only the header + counts + hint are printed; all downstream values (aggregates, per-bus/gen/branch/VSC tables) are derived from last-iteration voltages and would be garbage.

render_rich(sol, case_name='', detail='auto', *, options=None)#

Render a colorized terminal report (sparklines, coloring) as a string.

Parameters match render() (sol, case_name, detail, options). On convergence failure: only the header + counts + hint are printed.

render_html(sol, case_name='', *, options=None)#

Render a self-contained HTML report (inline CSS) as a string.

Parameters match render() (sol, case_name, options). On convergence failure: heading + counts + hint only; data tables are omitted because every numeric result field would be garbage.

render_json(sol)#

Render the solved case sol as a JSON string.

On convergence failure: emits only solve metadata (status, counts, iterations, mismatch, timings, warnings). All per-device result arrays are dropped because their values are last-iteration garbage.