Skip to content

Commit

Permalink
add optino to show pvnet_gsp_sum
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Oct 20, 2023
1 parent 0a4060f commit 8cfb7fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ With any push to `main`, in order to deploy changes, the `Terraform Cloud` varia

- DB_URL: The database url which will be queried for forecasts
- password: The password for accessing the code
- SHOW_PVNET_GSP_SUM: Option to show `pvnet_gsp_sum` model or not. This defaults to zero

## Contributors

Expand Down
9 changes: 8 additions & 1 deletion src/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from plots.utils import colour_per_model


show_pvnet_gsp_sum = os.getenv("SHOW_PVNET_GSP_SUM", False)



def forecast_page():
"""Main page for status"""

Expand Down Expand Up @@ -44,8 +48,11 @@ def forecast_page():
if location.gsp_id == gsp_id
][0]

models = ["cnn", "National_xg", "pvnet_v2", "blend"]
if show_pvnet_gsp_sum:
models.append("pvnet_gsp_sum")
forecast_models = st.sidebar.multiselect(
"Select a model", ["cnn", "National_xg", "pvnet_v2", "blend"], ["pvnet_v2"]
"Select a model", models, ["pvnet_v2"]
)

probabilistic_forecasts = [model for model in forecast_models if model in ["National_xg", "pvnet_v2", "blend"]]
Expand Down
7 changes: 6 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
unsafe_allow_html=True,
)

show_pvnet_gsp_sum = os.getenv("SHOW_PVNET_GSP_SUM", False)


def metric_page():
# set up title and subheader
Expand All @@ -51,7 +53,10 @@ def metric_page():
use_adjuster = st.sidebar.radio("Use adjuster", [True, False], index=1)

st.sidebar.subheader("Select Forecast Model")
model_name = st.sidebar.selectbox("Select", ["cnn", "National_xg", "pvnet_v2"], "pvnet_v2")
models = ["cnn", "National_xg", "pvnet_v2"]
if show_pvnet_gsp_sum:
models.append("pvnet_gsp_sum")
model_name = st.sidebar.selectbox("Select", models, "pvnet_v2")

# set up database connection
url = os.environ["DB_URL"]
Expand Down

0 comments on commit 8cfb7fc

Please sign in to comment.