MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / row_sort_key

Function row_sort_key

experiments/benchmark/make_benchmark_submission.py:34–43  ·  view source on GitHub ↗
(row: Dict[str, Any], rank_field: str | None, score_field: str | None)

Source from the content-addressed store, hash-verified

32
33
34def row_sort_key(row: Dict[str, Any], rank_field: str | None, score_field: str | None) -> tuple:
35 rank = as_float(row.get(rank_field)) if rank_field else None
36 score = as_float(row.get(score_field)) if score_field else None
37 pool_rank = as_float(row.get("pool_rank"))
38 paper_id = str(row.get("paper_id") or "")
39 if rank is not None:
40 return (0, rank, 0.0, pool_rank if pool_rank is not None else float("inf"), paper_id)
41 if score is not None:
42 return (1, 0.0, -score, pool_rank if pool_rank is not None else float("inf"), paper_id)
43 return (2, 0.0, 0.0, pool_rank if pool_rank is not None else float("inf"), paper_id)
44
45
46def make_submission(

Callers 1

make_submissionFunction · 0.70

Calls 2

getMethod · 0.80
as_floatFunction · 0.70

Tested by

no test coverage detected