MCPcopy Create free account
hub / github.com/Open-Quant/openquant / _format_rate

Function _format_rate

python/benchmarks/benchmark_data_processing.py:83–90  ·  view source on GitHub ↗
(v: float)

Source from the content-addressed store, hash-verified

81
82
83def _format_rate(v: float) -> str:
84 if v >= 1_000_000_000:
85 return f"{v / 1_000_000_000:.2f}B/s"
86 if v >= 1_000_000:
87 return f"{v / 1_000_000:.2f}M/s"
88 if v >= 1_000:
89 return f"{v / 1_000:.2f}K/s"
90 return f"{v:.2f}/s"
91
92
93def _format_table(stats: list[BenchStats]) -> str:

Callers 1

_format_tableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected