climate_ref.baseline_report.render
#
Write the static HTML report.
Hands frozen objects to Jinja, registers the formatting filters the templates are allowed, and writes the pages out.
CommentLink
#
One earlier report for the same pull request.
Source code in packages/climate-ref/src/climate_ref/baseline_report/render.py
CommentRow
#
One test case's row in the pull request comment table.
Source code in packages/climate-ref/src/climate_ref/baseline_report/render.py
counts
instance-attribute
#
The +a ~c -r shorthand per file kind, in the report's column order.
label
instance-attribute
#
The test case's label, for example example/diag/case.
url
instance-attribute
#
Link to the case's page in the hosted report.
versions
instance-attribute
#
v3 -> v4, or new / removed when the case only exists on one side.
render_case(report, case)
#
Render one test case's page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
AnalysedReport
|
The analysed report, which carries the header details. |
required |
case
|
AnalysedCase
|
The case to render. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The page's HTML. |
Source code in packages/climate-ref/src/climate_ref/baseline_report/render.py
render_comment(report, base_url, previous=())
#
Render the pull request comment as markdown.
The comment is one row per changed case and a link into the hosted report, so it stays well inside GitHub's comment size limit however many files moved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
AnalysedReport
|
The analysed report. |
required |
base_url
|
str
|
Where the report is hosted, for example |
required |
previous
|
Sequence[tuple[str, str]]
|
|
()
|
Returns:
| Type | Description |
|---|---|
str
|
The comment's markdown, ending in the marker the CI job finds it by. |
Source code in packages/climate-ref/src/climate_ref/baseline_report/render.py
render_index(report)
#
Render the overview page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
AnalysedReport
|
The analysed report. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The page's HTML. |
Source code in packages/climate-ref/src/climate_ref/baseline_report/render.py
write_site(report, out_dir)
#
Write the overview index.html plus one index.html per case, under the case label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
AnalysedReport
|
The analysed report. |
required |
out_dir
|
Path
|
Directory to write the site into. Created if it does not exist. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path of the index page. |