summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nemesis/html_gen.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nemesis/html_gen.py b/nemesis/html_gen.py
index 70d476b..85d2cae 100644
--- a/nemesis/html_gen.py
+++ b/nemesis/html_gen.py
@@ -1,3 +1,6 @@
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ import collections
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import hashlib
@@ -5,12 +8,12 @@ import math
TRIM_PERCENT = 0.10
-def get_color(name):
+def get_color(name: str) -> str:
hash_object = hashlib.md5(name.encode())
color_index = int(hash_object.hexdigest(), 16) % 360
return f'hsl({color_index}, 90%, 30%)'
-def plot_results(results, output_file, input_file):
+def plot_results(results: "collections.defaultdict[str, collections.defaultdict[float, collections.defaultdict[int, list[tuple[list[tuple[str, float]], float]]]]]", output_file: str, input_file: str) -> None:
# determine the number of loops we have data for
total_loops = set()
for x_values in results.values():