From ea22fd9a7658f07b3f59ab718afe2cbbf804ee27 Mon Sep 17 00:00:00 2001 From: acid Date: Thu, 26 Sep 2024 11:25:51 +0100 Subject: [PATCH] move output into its own folder --- last_bus_times.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/last_bus_times.py b/last_bus_times.py index d862469..d159110 100644 --- a/last_bus_times.py +++ b/last_bus_times.py @@ -14,6 +14,8 @@ date_format = "%Y-%m-%d" yesterday = datetime.today() - timedelta(days=1) yesterday = yesterday.strftime(date_format) delay_csv = "delays.csv" +delay_html = "output/delays.html" +delay_png = "output/delays.png" def get_delay(date_string: str) -> int: @@ -73,8 +75,8 @@ def make_plot(): df["Date"] = pd.to_datetime(df["Date"]) fig = calplot(df, x="Date", y="Minutes Late", dark_theme=True, colorscale=[(0, "green"), (0.1, "yellow"), (1, "red")]) - fig.write_image("delays.png") - plotly.offline.plot(fig, filename="delays.html") + fig.write_image(delay_png) + plotly.offline.plot(fig, filename=delay_html) if __name__ == "__main__":