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

Function as_float

experiments/benchmark/make_benchmark_submission.py:22–31  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

20
21
22def as_float(value: Any) -> float | None:
23 if value in (None, ""):
24 return None
25 try:
26 number = float(value)
27 except (TypeError, ValueError):
28 return None
29 if math.isnan(number):
30 return None
31 return number
32
33
34def row_sort_key(row: Dict[str, Any], rank_field: str | None, score_field: str | None) -> tuple:

Callers 1

row_sort_keyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected