File size: 1,429 Bytes
f1e08ee c4ae75a f1e08ee c4ae75a f1e08ee c4ae75a f1e08ee c4ae75a f1e08ee c4ae75a f1e08ee c4ae75a f1e08ee |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
import streamlit as st
from components import summary_view
import utils
st.set_page_config(page_title="Electricity Demand Dashboard", layout="wide")
@st.cache_data(ttl=86400)
def fetch_data():
return utils.get_wandb_data(
st.secrets["wandb_entity"],
"enfobench-electricity-demand",
st.secrets["wandb_api_key"],
job_type="metrics",
)
data = fetch_data()
models = sorted(data["model"].unique().tolist())
models_to_plot = set()
model_groups: dict[str, list[str]] = {}
for model in models:
group, model_name = model.split(".", maxsplit=1)
if group not in model_groups:
model_groups[group] = []
model_groups[group].append(model_name)
with st.sidebar:
left, right = st.columns(
2
) # Create two columns within the right column for side-by-side images
with left:
st.image("./images/ku_leuven_logo.png") # Adjust the path and width as needed
with right:
st.image("./images/energyville_logo.png")
view = st.selectbox("View", ["Summary", "Raw Data"], index=0)
st.header("Models to include")
for model_group, models in model_groups.items():
st.text(model_group)
for model_name in models:
to_plot = st.checkbox(model_name, value=True)
if to_plot:
models_to_plot.add(f"{model_group}.{model_name}")
if view == "Summary":
summary_view(data, models_to_plot)
|