akrherz / pyIEM

Consider using f-strings PYL-C0209
Performance
Minor
10 months ago2 years old
Formatting a regular string which could be a f-string
 65def test_simple(month):
 66    """Can we walk before we run."""
 67    text = (
 68        "KCVG DS 24/%02i 590353/ 312359// 53/ 48/" 69        "/9470621/T/T/00/00/00/00/00/00/"
 70        "00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/00/225/26381759/"
 71        "26500949="
Formatting a regular string which could be a f-string
392                sig.ets.strftime("%H%M"),
393            )
394            channels = ["SIGMET.%s" % (i,) for i in sig.centers]
395            channels.append("SIGMET.%s" % (self.source[1:],))396            xtra = {"channels": ",".join(channels), "twitter": txt}
397
398            j.append([txt, html, xtra])
Formatting a regular string which could be a f-string
391                area,
392                sig.ets.strftime("%H%M"),
393            )
394            channels = ["SIGMET.%s" % (i,) for i in sig.centers]395            channels.append("SIGMET.%s" % (self.source[1:],))
396            xtra = {"channels": ",".join(channels), "twitter": txt}
397
Formatting a regular string which could be a f-string
385                area,
386                sig.ets.strftime("%H%M"),
387            )
388            html = ("<p>%s issues SIGMET %s%s till %s UTC</p>") % (389                self.source,
390                sig.label,
391                area,
Formatting a regular string which could be a f-string
379        j = []
380        for sig in self.sigmets:
381            area = " for " + sig.areatext if sig.areatext != "" else ""
382            txt = ("%s issues SIGMET %s%s till %s UTC") % (383                self.source,
384                sig.label,
385                area,