render
¶
Static rendering pipeline: renders CSV tables and matplotlib figures directly from a
RecordStore.
Design note: every record type sharing a tag (Point2D/Scatter2D/Trace2D/AxLine/
HistogramEntry) is drawn onto one shared SingleAxisFigure and saved once to <tag>.jpg,
since histogram data isn't special-cased onto its own figure/file; a tag mixing record types
renders the same way any other tag does.
Rendering only ever reads, so worker processes each open their own read-only RecordStore
connection and render disjoint tags in parallel with zero write-lock contention, since SQLite's
WAL mode allows any number of concurrent readers, unlike generate_records, where only one
process can ever write at a time.
render_assets
¶
render_assets(
db_path: Path,
output_dir: Path,
n_procs: int = 1,
on_progress: ProgressCallback | None = None,
) -> None
Renders CSV tables and matplotlib figures for every tag in the RecordStore at
db_path, writing them under output_dir (nested per tag).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
Path
|
path to the trendify output directory's |
required |
output_dir
|
Path
|
directory tables/figures are written under |
required |
n_procs
|
int
|
number of worker processes rendering tags in parallel. |
1
|
on_progress
|
ProgressCallback | None
|
called once per tag finished, always from this process -- never a worker, so it never needs to be picklable. Left to raise: a failing callback aborts rendering rather than being silently swallowed. |
None
|