Visualization Demo Sub-Module
t3co.demos.visualization_demo
Demo for the T3CO visualization module (:class:t3co.visualize.charts.T3COCharts).
This script builds a small T3CO results DataFrame from the bundled demo inputs (without requiring FASTSim or the optimizer), then renders the three available plots with both backends:
backend="matplotlib"-> static PNG filesbackend="plotly"-> interactive, self-contained HTML files
A backend whose optional dependencies are not installed is skipped with a note;
install them with pip install "t3co[viz]".
Run from the repository root::
python src/t3co/demos/visualization_demo.py
Outputs are written to ./results/visualization/ (relative to the working dir).
build_demo_results(max_per_fuel=2, max_total=12)
Builds a small results DataFrame by running a handful of selections that span the available fuel types in the demo scenario file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_per_fuel
|
int
|
Max selections to include per distinct fuel type. |
2
|
max_total
|
int
|
Overall cap on the number of selections. |
12
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: Flattened T3CO results, one row per selection. |
Source code in src/t3co/demos/visualization_demo.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
render(results_df, backend)
Renders the three plots for one backend and writes them to OUT_DIR.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results_df
|
DataFrame
|
The T3CO results to plot. |
required |
backend
|
str
|
"matplotlib" (static PNG) or "plotly" (interactive HTML). |
required |
Source code in src/t3co/demos/visualization_demo.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |