diff --git a/src/dashboard.py b/src/dashboard.py index 79befaad56817d29830be2d542df3954a27fc685..544ae7c39c865c88fef8a8e3181569a28e211bd2 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1,23 +1,24 @@ -from re import A -from dash import html, dcc, dash_table, Dash -from dash.dependencies import Input, Output, State, MATCH +import os +from datetime import datetime, timedelta +import oracledb +import pandas as pd import plotly.express as px import plotly.graph_objs as go -import pandas as pd -from datetime import datetime, timedelta -from sqlalchemy import create_engine, select, and_, desc +from dash import Dash, dash_table, dcc, html +from dash.dependencies import MATCH, Input, Output, State +from sqlalchemy import and_, create_engine, desc, func, select from sqlalchemy.orm import Session -from utils.db_tools.orm_classes import InputForecasts, Modell, PegelForecasts,Log, ModellSensor, SensorData -import oracledb -import os -from sqlalchemy import select, func -from dash_tools.style_configs import (create_log_table, - create_historical_plot, + +from dash_tools.layout_helper import create_collapsible_section +from dash_tools.style_configs import (create_historical_plot, create_historical_table, - create_input_forecasts_plot, create_inp_forecast_status_table, + create_input_forecasts_plot, + create_log_table, create_model_forecasts_plot) -from dash_tools.layout_helper import create_collapsible_section +from utils.db_tools.orm_classes import (InputForecasts, Log, Modell, + ModellSensor, PegelForecasts, + SensorData) NUM_RECENT_INPUT_FORECASTS = 12 NUM_RECENT_PEGEL_FORECASTS = 5 @@ -202,7 +203,7 @@ class ForecastMonitor: # Get last 144 hours of sensor data time_threshold = datetime.now() - timedelta(hours=144) - time_threshold= pd.to_datetime("2024-09-13 14:00:00.000") - timedelta(hours=144) #TODO rausnehmen + #time_threshold= pd.to_datetime("2024-09-13 14:00:00.000") - timedelta(hours=144) #TODO rausnehmen stmt = select(SensorData).where( SensorData.tstamp >= time_threshold,