oversampleqa.report¶
oversampleqa.report
¶
Report generation for oversampleqa.
frame_to_html(frame, *, float_format='{:.4f}')
¶
Render a DataFrame as an HTML table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
DataFrame
|
Frame to render. A named index becomes the first column. |
required |
float_format
|
str
|
Format applied to floating-point cells. |
'{:.4f}'
|
Returns:
| Type | Description |
|---|---|
str
|
An HTML table, or a note when the frame is empty. |
Source code in src/oversampleqa/_render.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
frame_to_markdown(frame, *, float_format='{:.4f}')
¶
Render a DataFrame as a GitHub-flavoured Markdown table.
Written out rather than delegated to DataFrame.to_markdown, which needs
tabulate. That is installed here only as a transitive dependency of
something else, and depending on a package nobody declared is how a working
install becomes a broken one after an unrelated upgrade.
The previous implementation used to_csv(sep="|"), which is not Markdown:
it has no header separator row and no leading or trailing pipes, so it
rendered as one run-on paragraph rather than a table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
DataFrame
|
Frame to render. The index becomes the first column when it is
named, since |
required |
float_format
|
str
|
Format applied to floating-point cells. Raw repr leaks
values like |
'{:.4f}'
|
Returns:
| Type | Description |
|---|---|
str
|
A Markdown table, or a note when the frame is empty. |
Source code in src/oversampleqa/_render.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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 | |
generate_report(benchmark_results, output_format='markdown', output_path=None, include_plots=True, fidelity_reports=None)
¶
Generate a report from benchmark results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
benchmark_results
|
DataFrame
|
Benchmark results dataframe. |
required |
output_format
|
str
|
Output format ( |
'markdown'
|
output_path
|
str | None
|
Optional output file path. |
None
|
include_plots
|
bool
|
Whether to include plot artifacts. |
True
|
fidelity_reports
|
dict[str, Any] | None
|
Optional mapping of oversampler name to
:class: |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Rendered report content as a string. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/oversampleqa/report.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |