Skip to content

Figures

preview draws one dataset or one run; preview_report writes the whole set of figures plus an HTML report into a directory. Both are the same call for all seven algorithms, and the panels they produce are listed under Figure generation.

preview

preview(
    dataset: PDEDataset, *, file: TextIO | None = None
) -> None

Print a sanity-check summary of a PDEDataset.

Parameters:

  • dataset (PDEDataset) –

    The dataset to inspect.

  • file (TextIO | None, default: None ) –

    Optional text stream (defaults to sys.stdout via print).

Returns:

  • None

    None — this is a side-effecting print tool.

preview_report

preview_report(dataset: PDEDataset) -> DatasetReport

Build a typed report of a PDEDataset without printing anything.

Parameters:

  • dataset (PDEDataset) –

    The dataset to inspect. Not mutated; no RNG is consumed.

Returns:

VizEngine

Orchestrates rendering of universal, plugin, and comparison plots.

Parameters:

  • output_dir (Path) –

    Directory for rendered output. Created if missing.

  • style (dict[str, Any] | None, default: None ) –

    Extra matplotlib rcParams merged on top of DEFAULT_STYLE.

render_all

render_all(
    result: ExperimentResult,
    *,
    algorithm: Any | None = None,
    dataset: Any | None = None,
    animate: bool = False,
) -> ReportResult

Render universal plots, plugin plots, and HTML report.

Parameters:

  • result (ExperimentResult) –

    Completed experiment result.

  • algorithm (Any | None, default: None ) –

    If it implements VizExtension, plugin plots are rendered with per-plot error isolation.

  • dataset (Any | None, default: None ) –

    If provided (PDEDataset), enables field comparison (u-field True/Predicted/Residual) and PDE residual field.

  • animate (bool, default: False ) –

    When True, render a 2D field animation GIF for 2D-spatial+time datasets. Defaults to False.

Returns:

  • ReportResult

    ReportResult with generated figure paths, HTML report path, and warnings. Omitting dataset / algorithm (or requesting animate on non-2D data) skips the corresponding figure families.

render_comparison

render_comparison(
    results: list[ExperimentResult],
    *,
    labels: list[str] | None = None,
) -> ReportResult

Render multi-run comparison plots.

Generates: - Overlaid convergence curves - Score bar chart (R2 per run) - Summary table (expression, metrics, iterations)

Parameters:

  • results (list[ExperimentResult]) –

    List of completed experiment results.

  • labels (list[str] | None, default: None ) –

    Custom labels for each run. Falls back to algorithm_name from each result.

Returns:

  • ReportResult

    ReportResult with generated figure paths and warnings.

render_universal

render_universal(
    result: ExperimentResult,
    *,
    field_shape: tuple[int, ...] | None = None,
    infer_grid: bool = True,
) -> ReportResult

Render universal plots from an ExperimentResult.

Parameters:

  • result (ExperimentResult) –

    Completed experiment result.

  • field_shape (tuple[int, ...] | None, default: None ) –

    Optional field shape (e.g., (nx, nt)) used to reshape 1D residuals into a 2D heatmap. When omitted the spatial-residual panel falls back to a square-shape guess and shows "No spatial data" if that fails.

  • infer_grid (bool, default: True ) –

    When field_shape is omitted, whether to allow the square-shape guess. False (set by render_all for SCATTERED data) forces "No spatial data" instead of a fabricated grid.

Returns:

  • ReportResult

    ReportResult with generated figure paths and warnings.