Explorar el Código

Support more sigmas

Vecna hace 3 días
padre
commit
f3d93a012f
Se han modificado 2 ficheros con 41 adiciones y 6 borrados
  1. 20 3
      parsing-results/make_tables.py
  2. 21 3
      parsing-results/make_tables_tp.py

+ 20 - 3
parsing-results/make_tables.py

@@ -5,9 +5,17 @@ import pandas as pd
 import numpy as np
 
 def format(mean, std):
-    if std >= 10.0:
-        m = int(round(mean/10.0)) * 10.0
-        s = int(round(std/10.0)) * 10.0
+    if std >= 1000:
+        m = int(round(mean/1000.0)) * 1000
+        s = int(round(std/1000.0)) * 1000
+        dec = 0
+    elif std >= 100:
+        m = int(round(mean/100.0)) * 100
+        s = int(round(std/100.0)) * 100
+        dec = 0
+    elif std >= 10:
+        m = int(round(mean/10.0)) * 10
+        s = int(round(std/10.0)) * 10
         dec = 0
     elif std >= 1.0:
         m = int(round(mean))
@@ -29,6 +37,15 @@ def format(mean, std):
         m = int(round(mean*10000)) / 10000.0
         s = int(round(std*10000)) / 10000.0
         dec = 4
+    elif std >= 0.00001:
+        m = int(round(mean*100000)) / 100000.0
+        s = int(round(std*100000)) / 100000.0
+        dec = 5
+    # We measure in ns; if std == 0, this is the case to use
+    else:
+        m = int(round(mean*1000000)) / 1000000.0
+        s = int(round(std*1000000)) / 1000000.0
+        dec = 6
     m = str(m)
     s = str(s)
 

+ 21 - 3
parsing-results/make_tables_tp.py

@@ -5,9 +5,17 @@ import pandas as pd
 import numpy as np
 
 def format(mean, std):
-    if std >= 10.0:
-        m = int(round(mean/10.0)) * 10.0
-        s = int(round(std/10.0)) * 10.0
+    if std >= 1000:
+        m = int(round(mean/1000.0)) * 1000
+        s = int(round(std/1000.0)) * 1000
+        dec = 0
+    elif std >= 100:
+        m = int(round(mean/100.0)) * 100
+        s = int(round(std/100.0)) * 100
+        dec = 0
+    elif std >= 10:
+        m = int(round(mean/10.0)) * 10
+        s = int(round(std/10.0)) * 10
         dec = 0
     elif std >= 1.0:
         m = int(round(mean))
@@ -29,6 +37,15 @@ def format(mean, std):
         m = int(round(mean*10000)) / 10000.0
         s = int(round(std*10000)) / 10000.0
         dec = 4
+    elif std >= 0.00001:
+        m = int(round(mean*100000)) / 100000.0
+        s = int(round(std*100000)) / 100000.0
+        dec = 5
+    # We measure in ns; if std == 0, this is the case to use
+    else:
+        m = int(round(mean*1000000)) / 1000000.0
+        s = int(round(std*1000000)) / 1000000.0
+        dec = 6
     m = str(m)
     s = str(s)
 
@@ -46,6 +63,7 @@ def format(mean, std):
 
     return m, s
 
+
 def main():
     perf = open("performance_stats"+".csv", "w", newline='')
     protocols=["Open Invitation", "Trust Promotion(0->1)",