@@ -3104,15 +3104,15 @@ def update(self):
31043104 # (ones without any compute during the relevant dt)
31053105 # 3. Colors the labels appropriately.
31063106 formatter = CustomJSHover (
3107- code = """
3108- const colormap = %s ;
3107+ code = f """
3108+ const colormap = { dict ( zip ( stackers , colors )) } ;
31093109 const divs = [];
3110- for (let k of Object.keys(source.data)) {
3110+ for (let k of Object.keys(source.data)) {{
31113111 const val = source.data[k][value];
31123112 const color = colormap[k];
3113- if (k === "time" || k === "nthreads" || val < 1.e-3) {
3113+ if (k === "time" || k === "nthreads" || val < 1.e-3) {{
31143114 continue;
3115- }
3115+ }}
31163116 const label = k.length >= 20 ? k.slice(0, 20) + '…' : k;
31173117
31183118 // Unshift so that the ordering of the labels is the same as
@@ -3127,18 +3127,15 @@ def update(self):
31273127 + '</div>'
31283128 )
31293129
3130- }
3130+ }}
31313131 divs.unshift(
31323132 '<div>'
31333133 + '<span style="font-weight: bold; color: darkgrey;">nthreads: </span>'
31343134 + source.data.nthreads[value]
31353135 + '</div>'
31363136 );
31373137 return divs.join('\\ n')
3138- """
3139- % dict (
3140- zip (stackers , colors )
3141- ), # sneak the color mapping into the callback
3138+ """ , # sneak the color mapping into the callback
31423139 args = {"source" : self .source },
31433140 )
31443141 # Add the HoverTool to the top line renderer.
@@ -3378,13 +3375,13 @@ def update(self):
33783375 )
33793376
33803377 self .root .title .text = (
3381- "Progress -- total: %( all)s , "
3382- "waiting: %( waiting)s , "
3383- "queued: %( queued)s , "
3384- "processing: %( processing)s , "
3385- "in-memory: %( memory)s , "
3386- "no-worker: %( no_worker)s , "
3387- "erred: %( erred)s" % totals
3378+ "Progress -- total: { all} , "
3379+ "waiting: { waiting} , "
3380+ "queued: { queued} , "
3381+ "processing: { processing} , "
3382+ "in-memory: { memory} , "
3383+ "no-worker: { no_worker} , "
3384+ "erred: { erred}" . format ( ** totals )
33883385 )
33893386
33903387
@@ -4537,8 +4534,9 @@ def __init__(self, scheduler, start=None):
45374534 else :
45384535 logs_html = Log (
45394536 "\n " .join (
4540- "%s - %s"
4541- % (datetime .fromtimestamp (time ).strftime ("%H:%M:%S.%f" ), line )
4537+ "{} - {}" .format (
4538+ datetime .fromtimestamp (time ).strftime ("%H:%M:%S.%f" ), line
4539+ )
45424540 for time , level , line in logs
45434541 )
45444542 )._repr_html_ ()
0 commit comments