Florian Weinert commited on
Commit
9c71687
·
1 Parent(s): 06b14a4

style: satisfy ruff on build_network.py

Browse files

Two pre-existing issues, surfaced by CI because the language gate runs on
changed files and the previous commit touched this one:

- I001: import block was never grouped stdlib / third-party / first-party
- W605: the JS regex /\s+/ inside the generated-HTML f-string is an
invalid Python escape sequence

The W605 fix is output-neutral. In a non-raw string, \\s emits the same
literal backslash-s that the invalid \s already emitted, so the generated
JavaScript is unchanged — verified by regenerating from a real client file
and diffing byte for byte. Every other backslash construct in that
template already used the doubled form, so this was the lone exception.

Files changed (1) hide show
  1. build_network.py +3 -1
build_network.py CHANGED
@@ -2,7 +2,9 @@
2
 
3
  import html
4
  import json
 
5
  import numpy as np
 
6
  from config import COLORS
7
 
8
 
@@ -321,7 +323,7 @@ function getCorr(i, j) {{
321
 
322
  // --- Styling helpers (ported from Python) ---
323
  function wrapLabel(text) {{
324
- var words = text.split(/\s+/);
325
  if (words.length <= 2) return text;
326
  var lines = [], line = '';
327
  for (var w = 0; w < words.length; w++) {{
 
2
 
3
  import html
4
  import json
5
+
6
  import numpy as np
7
+
8
  from config import COLORS
9
 
10
 
 
323
 
324
  // --- Styling helpers (ported from Python) ---
325
  function wrapLabel(text) {{
326
+ var words = text.split(/\\s+/);
327
  if (words.length <= 2) return text;
328
  var lines = [], line = '';
329
  for (var w = 0; w < words.length; w++) {{