Skip to main content

task

Prefect task tabulating the four Granite metric caches into a csv_report_df.

Mirrors the v8 Granite protocol's merge/derive/filter flow (steps 4-5 of its run()): read each background calculation step's per-file metrics from its cache (ga/fluid/cst/gcc_calculation.cache) directly as a DataFrame, assemble them via the shared assemble_scan_frame (GA as base, fluid/CST/GCC left-merged on the filename column with collision coalescing), derive the drusen + segmentation-area columns, then apply the biomarker group/name column filter. Column names remain TECHNICAL — display renaming is the downstream csv_report step's job.

The four calculation steps run in the background phase and persist to the cache DB; this step runs interactively and consumes their .cache accessors, so there is no in-memory metric-dict round-trip. Non-cache-backed itself.

Module

Functions

biomarker_tabulation_task

def biomarker_tabulation_task(    datasource: BaseSource,    config: BiomarkerTabulationConfig,    ga_metrics: CacheAccessor,    fluid_metrics: CacheAccessor,    cst_metrics: CacheAccessor,    gcc_metrics: CacheAccessor,    filenames: list[str],)> BiomarkerTabulationResult:

Merge, derive and filter the four metric caches into a csv_report_df.

Arguments

  • datasource: The datasource (unused directly; the cache rows are already keyed by the datasource filenames).
  • config: Selection config (biomarker_groups / biomarker_names).
  • ga_metrics: Cache accessor for the background ga_calculation step.
  • fluid_metrics: Cache accessor for the background fluid_calculation step.
  • cst_metrics: Cache accessor for the background cst_calculation step.
  • gcc_metrics: Cache accessor for the background gcc_calculation step.
  • filenames: The selected filenames; every one is guaranteed a row (as an all-NA row when a calculation skipped/failed the file), mirroring the v8 protocol's _fill_missing_metrics backfill.

Returns BiomarkerTabulationResult carrying the tabulated csv_report_df with TECHNICAL column names plus the filename column.