WeixuanZ / flood-warning-system

Consider using f-strings PYL-C0209
Performance
Minor
a year agoa year old
Formatting a regular string which could be a f-string
358
359    # Risky rivers
360    warning_text2 = Div(
361        text="""<p><b>{}</b> rivers with stations at risk, the top 5 is tabulated below.</p>""".format(362            len(rivers_with_station(risky_stations))
363        ),
364        width=600,
Formatting a regular string which could be a f-string
415        )
416    )
417    warning_text3 = Div(
418        text="""<p><b>{}</b> clusters found, the towns within these clusters419            (<b>{}</b> in total) have a high risk of flooding.
420            The table below lists the towns with the highest relative water level
421            within each cluster in the order of decreasing risk
Formatting a regular string which could be a f-string
544            predict_plot.sizing_mode = "scale_width"
545            predict_plots.append(Panel(child=predict_plot, title=station.name))
546            predicting_text = Div(
547                text="<p><i>Prediction is running... {:.0%}</i></p>".format(i / 6)548            )
549            doc.add_next_tick_callback(
550                partial(
Formatting a regular string which could be a f-string
 75        d += "   coordinate:    {}\n".format(self.coord)
 76        d += "   town:          {}\n".format(self.town)
 77        d += "   river:         {}\n".format(self.river)
 78        d += "   typical range: {}".format(self.typical_range) 79        return d
 80
 81    def typical_range_consistent(self):
Formatting a regular string which could be a f-string
 69        return self._town
 70
 71    def __repr__(self):
 72        d = "Station name:     {}\n".format(self.name) 73        d += "   id:            {}\n".format(self.station_id)
 74        d += "   measure id:    {}\n".format(self.measure_id)
 75        d += "   coordinate:    {}\n".format(self.coord)