'
"PRIMObenchmark"
)
FOOT_LINKS = (
("tasks", "Tasks"),
("submit", "Submit a model"),
("contribute", "Contribute"),
("method", "Method"),
)
NAME_COLUMNS = frozenset({"Model", "Best"})
STRONG_COLUMNS = frozenset({"Task"})
METRIC_COLUMNS = frozenset({"Metric"})
RIGHT_COLUMNS = frozenset({"Rank", "Patients"})
CHEVRON = (
''
)
# --------------------------------------------------------------------- rail
def rail_html(
boards: list[Board], active_slug: str | None, active_tab: str | None
) -> str:
"""The left navigation: brand, a collapsible "Boards" menu, then the foot links.
The board groups live inside a ``{escape(group)}
' ) for board in cards: cls = "pm-link pm-active" if board.slug == active_slug else "pm-link" parts.append( f'' f'{escape(board.name)}' f'{board.n_tasks}' ) for board in opens: parts.append( '' f'{escape(board.name)}' 'open' ) parts.append("Leading (Elo)
'] if not top: parts.append( 'No ranked model yet. Be the first.
' ) return "".join(parts) for row in top: badge = ( ' baseline' if row.is_baseline else "" ) score = "n/a" if row.elo is None else str(row.elo) parts.append( f'{escape(row.name)}{badge}' f' {score}
' ) return "".join(parts) def _live_card(board: Board, df: pd.DataFrame, by_id: dict[str, dict]) -> str: top = top_models(df, by_id, board, N_TOP_MODELS) return ( f'' f"{escape(board.blurb)}
' f"{_leading(top)}" ) def _open_card(board: OpenBoard) -> str: return ( '' f"{escape(board.blurb)}
' 'Propose a cohort →
' ) def render_boards(boards: list[Board], df: pd.DataFrame, by_id: dict[str, dict]) -> str: """The Boards overview: every board as a card, grouped by facet. Live cards link to their board and teaser their leaders; open cards state a gap and link to Contribute. A section counts its open slices so the page reads as showing its own gaps, not the registry as the whole territory. """ if not boards: return ( 'The task registry is ' "unavailable right now. Please retry in a moment.
PRIMO evaluates representations of omics samples through " "drug-development-related tasks. Benchmarks are organized by data " "modality, therapeutic area, or task category.
{escape(group)}
' f'{note}{counter}
{escape(empty)}
' score_cols = _score_columns(df) bold = _bold_cells(df, score_cols, bold_axis) if bold_axis is not None else set() head = [] for index, col in enumerate(df.columns): align = ( ' style="text-align:right"' if col in score_cols or col in RIGHT_COLUMNS else "" ) head.append( f'The task registry could not be loaded. Please retry shortly.
" "Board
' f"{_board_meta(board)}
Ranked
' f'Only models that covered all {board.n_tasks} tasks are ' "ranked by Elo. Elo compares models pairwise within each task and never " "compares AUROC with Pearson directly.
" f"Per task
' 'Every submission, partial ones included. Read across a row.
' f"{len(df)} hidden clinical targets. One fixed linear probe reads each " "one out of your embedding; the cohorts stay anonymous, the biology does " "not.