diff options
| author | bd <bdunahu@operationnull.com> | 2025-11-30 22:05:17 -0500 |
|---|---|---|
| committer | bd <bdunahu@operationnull.com> | 2025-11-30 22:05:17 -0500 |
| commit | 6bb0c7086b5000ce7a7078760204af6f929c0468 (patch) | |
| tree | 7d30805dd45eb8dff6e5c35d5c05c148c51d50a9 /nemesis/html_gen.py | |
| parent | 30df289b3d01e0cd68056626f0426ee75e91b1ab (diff) | |
nemesis: Update html_gen with type annotations
Provided by righttyper
Diffstat (limited to 'nemesis/html_gen.py')
| -rw-r--r-- | nemesis/html_gen.py | 7 |
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(): |
