Skip to content

Commit

Permalink
🐛 Handle case for no fires
Browse files Browse the repository at this point in the history
  • Loading branch information
jh0ker committed Nov 3, 2023
1 parent be09677 commit 9ac3c91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def run():
dt_earliest = df["acq_datetime"].min()
dt_latest = df["acq_datetime"].max()

if dt_latest.date() != dt_earliest.date():
if len(df) == 0:
dt_range_str = "in den letzten 24-48 Stunden"
elif dt_latest.date() != dt_earliest.date():
dt_earliest_str = dt_earliest.astimezone(TZ_BERLIN).strftime("%d.%m.%Y um %H:%M")
dt_latest_str = dt_latest.astimezone(TZ_BERLIN).strftime("%d.%m.%Y um %H:%M")
dt_range_str = f"vom {dt_earliest_str} bis zum {dt_latest_str}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def run():
languages=["en"],
).strftime("%d.%m.%Y um %H:%M")

if dt_latest.date() != dt_earliest.date():
if len(df) == 0:
dt_range_str = "in den letzten 24-48 Stunden"
elif dt_latest.date() != dt_earliest.date():
dt_earliest_str = dt_earliest.astimezone(TZ_BERLIN).strftime("%d.%m.%Y um %H:%M")
dt_latest_str = dt_latest.astimezone(TZ_BERLIN).strftime("%d.%m.%Y um %H:%M")
dt_range_str = f"vom {dt_earliest_str} bis zum {dt_latest_str}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def run():
dt_earliest = df["acq_datetime"].min()
dt_latest = df["acq_datetime"].max()

if dt_latest.date() != dt_earliest.date():
if len(df) == 0:
dt_range_str = "in den letzten 24-48 Stunden"
elif dt_latest.date() != dt_earliest.date():
dt_earliest_str = dt_earliest.astimezone(TZ_BERLIN).strftime("%d.%m.%Y um %H:%M")
dt_latest_str = dt_latest.astimezone(TZ_BERLIN).strftime("%d.%m.%Y um %H:%M")
dt_range_str = f"vom {dt_earliest_str} bis zum {dt_latest_str}"
Expand Down

0 comments on commit 9ac3c91

Please sign in to comment.