printing
Column
dataclass
¶
Specification for a single column in the iteration table.
Source code in openscvx/utils/printing.py
Verbosity
¶
Bases: IntEnum
Verbosity levels for iteration table output.
Source code in openscvx/utils/printing.py
build_header_format(columns: list[Column]) -> str
¶
build_separator(columns: list[Column]) -> str
¶
Generate separator line matching the total width of active columns.
color_J_nonlin(value: Any, params: Any, data: dict) -> Optional[str]
¶
color_J_tr(value: Any, params: Any, data: dict) -> Optional[str]
¶
Color J_tr green if within tolerance, red otherwise.
color_J_vb(value: Any, params: Any, data: dict) -> Optional[str]
¶
Color J_vb green if within tolerance, red otherwise.
color_J_vc(value: Any, params: Any, data: dict) -> Optional[str]
¶
Color J_vc green if within tolerance, red otherwise.
color_acceptance_ratio(value: Any, params: Any, data: dict) -> Optional[str]
¶
Color acceptance ratio based on success level.
<= 0.1: red (unsuccessful) 0.1 < ratio <= 0.8: somewhat successful (green) 0.8 < ratio <= 1.5: very successful (blue)
1.5: overly successful (magenta)
Source code in openscvx/utils/printing.py
color_adaptive_state(value: Any, params: Any, data: dict) -> Optional[str]
¶
Color adaptive state green if acceptable, red otherwise.
Source code in openscvx/utils/printing.py
color_prob_stat(value: Any, params: Any, data: dict) -> Optional[str]
¶
footer(columns: list[Column]) -> None
¶
Print the table footer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
columns
|
list[Column]
|
List of Column specs defining the table structure |
required |
format_value(col: Column, value: Any, params: Any, data: dict) -> str
¶
Format a single value and apply coloring if needed.
Source code in openscvx/utils/printing.py
header(columns: list[Column]) -> None
¶
Print the table header for the given columns.
Source code in openscvx/utils/printing.py
intermediate(print_queue: queue.Queue, params: Any, columns: list[Column]) -> None
¶
Process and print iteration data from the queue.
This function runs in a loop, reading data from the print queue and displaying formatted iteration rows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
print_queue
|
Queue
|
Queue containing iteration data dicts |
required |
params
|
Any
|
Settings object (used for color threshold comparisons) |
required |
columns
|
list[Column]
|
List of Column specs defining the table structure |
required |
Source code in openscvx/utils/printing.py
print_problem_summary(settings: Any, lowered: Any, solver: Any) -> None
¶
Print the problem summary box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
Any
|
Configuration settings containing problem information |
required |
lowered
|
Any
|
LoweredProblem from lower_symbolic_problem() |
required |
solver
|
Any
|
Initialized ConvexSolver with built problem |
required |
Source code in openscvx/utils/printing.py
print_results_summary(result: OptimizationResults, timing_post, timing_init, timing_solve)
¶
Print the results summary box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
OptimizationResults
|
Optimization results object |
required |
timing_post
|
float
|
Post-processing time |
required |
timing_init
|
float
|
Initialization time |
required |
timing_solve
|
float
|
Solve time |
required |
Source code in openscvx/utils/printing.py
print_row(columns: list[Column], data: dict, params: Any) -> None
¶
Print a single data row for the given columns.
print_summary_box(lines, title='Summary')
¶
Print a centered summary box with the given lines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
list
|
List of strings to display in the box |
required |
title
|
str
|
Title for the box (default: "Summary") |
'Summary'
|