From 795c1224d15ec318396c5edcf39c1bc267eba328 Mon Sep 17 00:00:00 2001 From: jlayec Date: Sun, 14 Mar 2021 23:03:16 +0000 Subject: [PATCH 1/2] fix average consumption refresh in summary dashboard --- web/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/views.py b/web/views.py index e8d1bff..cef629a 100644 --- a/web/views.py +++ b/web/views.py @@ -41,7 +41,7 @@ def display_value(value): filtered_trips.append(trip) filtered_chargings = MyPSACC.get_chargings(mini, maxi) figures.get_figures(filtered_trips, filtered_chargings) - consumption = "Average consumption: {:.1f} kWh/100km".format(float(figures.consumption_df.mean(numeric_only=True))) + consumption = "Average consumption: {:.1f} kWh/100km".format(float(figures.consumption_df["consumption_km"].mean())) #mean(numeric_only=True) return figures.trips_map, figures.consumption_fig, figures.consumption_fig_by_speed, consumption, figures.table_fig, \ figures.battery_info, figures.battery_table, max_millis, step, marks From 582368fb23b4f44f70c9ff757c74190d249bcae9 Mon Sep 17 00:00:00 2001 From: Florian BEZANNIER <48728684+flobz@users.noreply.github.com> Date: Mon, 15 Mar 2021 09:51:22 +0100 Subject: [PATCH 2/2] remove comment --- web/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/views.py b/web/views.py index cef629a..94042fa 100644 --- a/web/views.py +++ b/web/views.py @@ -41,7 +41,7 @@ def display_value(value): filtered_trips.append(trip) filtered_chargings = MyPSACC.get_chargings(mini, maxi) figures.get_figures(filtered_trips, filtered_chargings) - consumption = "Average consumption: {:.1f} kWh/100km".format(float(figures.consumption_df["consumption_km"].mean())) #mean(numeric_only=True) + consumption = "Average consumption: {:.1f} kWh/100km".format(float(figures.consumption_df["consumption_km"].mean())) return figures.trips_map, figures.consumption_fig, figures.consumption_fig_by_speed, consumption, figures.table_fig, \ figures.battery_info, figures.battery_table, max_millis, step, marks