v1
PDF report step v1.
Module
Submodules
- bitfount.steps.pdf_report.v1.config - Config for the PDF report step (v1).
- bitfount.steps.pdf_report.v1.preprocessing - Shape-based preprocessing for the pdf_report v1 step.
- bitfount.steps.pdf_report.v1.result - Result for the PDF report step (v1).
- bitfount.steps.pdf_report.v1.task - Prefect task for PDF report generation.
Functions
task_fn
def task_fn( datasource: BaseSource, config: PDFReportConfig, ga_metrics: dict[str, GAMetrics | GAMetricsWithFovea | str | None] | CacheAccessor, ga_predictions: CacheAccessor, filenames: list[str], evaluations: list[CriteriaEvaluation], task_id: str,) ‑> PDFReportResult:Generate PDF reports using composable pure functions.
For each eligible file, renders a PDF report containing patient metadata, B-scan images with segmentation overlays, and GA metrics.
Arguments
datasource: The datasource providing patient and scan data.config: PDF report configuration (heading, text_fields, trial_name, and the total GA-area slider bounds).ga_metrics: Mapping of filename → GA metrics (or None/error string).ga_predictions: Cache accessor for GA model inference results (background stepga_inference.cache). Materialised once at the start of this task.filenames: List of file IDs to process.evaluations: The structured evaluations fromcriteria_matching, used to determine eligible entries.task_id: Task run ID.
Returns PDFReportResult with a DataFrame mapping filenames to PDF paths.
Classes
Config
class Config(**data: Any):Config for the PDF report generation step.
All fields are required — defaults are provided by the YAML template.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Variables
- static
heading : str
- static
model_config
- static
text_fields : list[dict[str, str]]
- static
total_ga_area_lower_bound : float
- static
total_ga_area_upper_bound : float
- static
trial_name : str
Result
class Result(**data: Any):Result of a PDF report task.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.
self is explicitly positional-only to allow self as a field name.