File size: 2,409 Bytes
f7b117b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import streamlit as st

from components import (
    buildings_view,
    models_view,
    performance_view,
    computation_view,
    logos,
    model_selector,
    header,
    overview_view,
)
import utils

PAGES = [
    "Overview",
    "Buildings",
    "Models",
    "Performance",
    "Computational Resources",
]


st.set_page_config(page_title="Gas Demand Dashboard", layout="wide")


@st.cache_data(ttl=86400)
def fetch_data():
    return utils.get_wandb_data(
        entity=st.secrets["wandb_entity"],
        project="enfobench-gas-demand",
        api_key=st.secrets["wandb_api_key"],
        job_type="metrics",
    )


# Load data
data = fetch_data()

# Extract models
models = sorted(data["model"].unique().tolist())


with st.sidebar:
    logos()
    view = st.selectbox("View", PAGES, index=0)

    if view == "Performance" or view == "Computational Resources":
        models_to_plot = model_selector(models)

    if view == "Overview":
        st.header("Sources")
        st.link_button("GitHub Repository", url="https://github.com/attila-balint-kul/energy-forecast-benchmark-toolkit", use_container_width=True)
        st.link_button("Documentation", url="https://attila-balint-kul.github.io/energy-forecast-benchmark-toolkit/", use_container_width=True)
        st.link_button("Electricity Demand Dataset", url="https://huggingface.co/datasets/EDS-lab/electricity-demand", use_container_width=True)
        st.link_button("HuggingFace Organization", url="https://huggingface.co/EDS-lab", use_container_width=True)

        st.header("Other Dashboards")
        st.link_button("Electricity Demand", url="https://huggingface.co/spaces/EDS-lab/EnFoBench-ElectricityDemand", use_container_width=True)
        st.link_button("PV Generation", url="https://huggingface.co/spaces/EDS-lab/EnFoBench-PVGeneration", use_container_width=True)

    st.header("Refresh data")
    refresh = st.button(
        "Refresh", use_container_width=True, help="Fetch the latest data from W&B"
    )
    if refresh:
        fetch_data.clear()
        st.rerun()


header()

if view == "Overview":
    overview_view(data)
elif view == "Buildings":
    buildings_view(data)
elif view == "Models":
    models_view(data)
elif view == "Performance":
    performance_view(data, models_to_plot)
elif view == "Computational Resources":
    computation_view(data, models_to_plot)
else:
    st.write("Not implemented yet")