264264 color: #b3b3b3;
265265 }
266266}
267- """
267+ """ # noqa: W293
268268
269269
270270class NodeTiming : # noqa: D101
@@ -325,8 +325,7 @@ def get_child_timings(top_node: object, query_timings: object, depth: int = 0) -
325325
326326
327327def get_f7fff0_shade_hex (fraction : float ) -> str :
328- """
329- Returns a shade between very light (#f7fff0) and a slightly darker green-yellow,
328+ """Returns a shade between very light (#f7fff0) and a slightly darker green-yellow,
330329 depending on the fraction (0..1)
331330 """
332331 fraction = max (0 , min (1 , fraction ))
@@ -345,10 +344,8 @@ def get_f7fff0_shade_hex(fraction: float) -> str:
345344
346345def get_node_body (
347346 name : str , result : str , cpu_time : float , card : int , est : int , result_size : int , extra_info : str
348- ) -> str : # noqa: D103
349- """
350- Generate the HTML body for a single node in the tree.
351- """
347+ ) -> str :
348+ """Generate the HTML body for a single node in the tree."""
352349 node_style = f"background-color: { get_f7fff0_shade_hex (float (result ) / cpu_time )} ;"
353350 new_name = "BRIDGE" if (name == "INVALID" ) else name .replace ("_" , " " )
354351 formatted_num = f"{ float (result ):.4f} "
@@ -362,7 +359,7 @@ def get_node_body(
362359 body += f"<p>estimate: { est } </p>"
363360 body += f"<p>result size: { result_size } bytes</p>"
364361 body += "<details>"
365- body += f "<summary>Extra info</summary>"
362+ body += "<summary>Extra info</summary>"
366363 body += '<div class="node-details">'
367364 body += f"<p>{ extra_info } </p>"
368365 # TODO: Expand on timing. Usually available from a detailed profiling # noqa: TD002, TD003
@@ -411,6 +408,7 @@ def generate_tree_recursive(json_graph: object, cpu_time: float) -> str: # noqa
411408
412409# For generating the table in the top left with expandable phases
413410def generate_timing_html (graph_json : object , query_timings : object ) -> object :
411+ """Generates timing HTML table with expandable phases."""
414412 json_graph = json .loads (graph_json )
415413 gather_timing_information (json_graph , query_timings )
416414 table_head = """
@@ -500,7 +498,7 @@ def generate_metric_grid_html(graph_json: str) -> str: # noqa: D103
500498 else "N/A" ,
501499 }
502500 metric_grid_html = """<div class="metrics-grid">"""
503- for key in metrics . keys () :
501+ for key in metrics :
504502 metric_grid_html += f"""
505503 <div class="metric-box">
506504 <div class="metric-title">{ key } </div>
0 commit comments