From 39dd12c8c38e27b045e20480771ce6173b67f442 Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Sun, 7 Apr 2019 04:57:24 +0200 Subject: [PATCH] pls --- server/nightr/strategies/tide_strat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/nightr/strategies/tide_strat.py b/server/nightr/strategies/tide_strat.py index ef13e8c..17aa996 100644 --- a/server/nightr/strategies/tide_strat.py +++ b/server/nightr/strategies/tide_strat.py @@ -19,9 +19,9 @@ def is_tide(context: Context) -> Prediction: month, cur_year_total_cars, last_year_total_cars = determine_month() month = int(month) - p.reasons.append(f"The month is {calendar.month_name[month]}") p.reasons.append(f"The number of cars having driven on the Storbæltsbro is {cur_year_total_cars}, in the current year") - p.reasons.append(f"The number of cars having driven over it in the last year is {last_year_total_cars}, thus the frequency is: {last_year_total_cars / cur_year_total_cars}") + p.reasons.append(f"The number of cars having driven over it in the last year is {last_year_total_cars}, thus the frequency is: {last_year_total_cars / cur_year_total_cars:.2f}") + p.reasons.append(f"The month is therefore {calendar.month_name[month]}") tide_data = requests.get('https://www.dmi.dk/fileadmin/user_upload/Bruger_upload/Tidevand/2019/Aarhus.t.txt') @@ -77,7 +77,7 @@ def is_tide(context: Context) -> Prediction: moments.append(time[0]) night = sum([1 for x in moments if 6 >= x.hour or x.hour >= 22]) - p.reasons.append(f"The water level is currently at {current_water_level}") + p.reasons.append(f"The water level is currently at {current_water_level} in the Aarhus Bay") p.reasons.append(f"The number of times the water is at the current level at nighttime is: {night}, compared to the total amount of times in {calendar.month_name[month]}, being {len(moments)}") p.probability = 1 - (night / len(moments))