MCPcopy Create free account
hub / github.com/WizardOfMenlo/stir / format_prover

Function format_prover

graph_script.py:240–255  ·  view source on GitHub ↗
(table, rates)

Source from the content-addressed store, hash-verified

238 return table_entries
239
240def format_prover(table, rates):
241 result = []
242 for row in table:
243 new_row = []
244 for i in range(len(row)):
245 if row[i] is None:
246 new_row.append('-')
247 else:
248 stir_time, fri_time = row[i]
249 ratio = round(fri_time / stir_time, 2)
250 stir_time = round_to_n(stir_time, 2)
251 fri_time = round_to_n(fri_time, 2)
252 new_row.append('$\\frac{{ {} }}{{ {} }} \\approx {} \\times $'.format(fri_time, stir_time, ratio))
253 result.append(new_row)
254
255 return '\\\\\n'.join([' & '.join(["$\\sfrac{{1}}{{{}}}$".format(2**rate)] + row) for rate,row in zip(rates, result)])
256
257
258def format_table(table, rates, round_precision=None):

Callers 1

make_latex_tablesFunction · 0.85

Calls 1

round_to_nFunction · 0.85

Tested by

no test coverage detected