From 49cf634398e639f63cd43155d3be19e331b57020 Mon Sep 17 00:00:00 2001 From: davidusb-geek Date: Fri, 18 Aug 2023 18:30:23 +0200 Subject: [PATCH] Fix - Added some code to fix some numerical syntax issues in tables --- src/emhass/web_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/emhass/web_server.py b/src/emhass/web_server.py index 4f282637..60d978cb 100644 --- a/src/emhass/web_server.py +++ b/src/emhass/web_server.py @@ -21,8 +21,12 @@ app = Flask(__name__) def get_injection_dict(df, plot_size = 1366): - # Create plots cols_p = [i for i in df.columns.to_list() if 'P_' in i] + # Let's round the data in the DF + cols_else = [i for i in df.columns.to_list() if 'P_' not in i] + df.loc[:, cols_p] = df[cols_p].astype(int) + df.loc[:, cols_else] = df[cols_else].round(2) + # Create plots n_colors = len(cols_p) colors = px.colors.sample_colorscale("jet", [n/(n_colors -1) for n in range(n_colors)]) fig_0 = px.line(df[cols_p], title='Systems powers schedule after optimization results',