BlendMMM commited on
Commit
7a2cc57
1 Parent(s): 71ed8f8

Update pages/8_Scenario_Planner.py

Browse files
Files changed (1) hide show
  1. pages/8_Scenario_Planner.py +5 -5
pages/8_Scenario_Planner.py CHANGED
@@ -53,13 +53,13 @@ def optimize(key):
53
  # print('@@@@@@@@')
54
  if len(channel_list) > 0:
55
  scenario = st.session_state["scenario"]
56
- if key.lower() == "spends":
57
  with status_placeholder:
58
  with st.spinner("Optimizing"):
59
  result = st.session_state["scenario"].optimize(
60
  st.session_state["total_spends_change"], channel_list
61
  )
62
- elif key.lower() == "sales":
63
  with status_placeholder:
64
  with st.spinner("Optimizing"):
65
 
@@ -787,7 +787,7 @@ if auth_status == True:
787
  with _columns1[0]:
788
 
789
  optimization_selection = st.selectbox(
790
- "Optimize", options=["Spends", "Sales"], key="optimization_key"
791
  )
792
  with _columns1[1]:
793
  st.markdown("#")
@@ -811,7 +811,7 @@ if auth_status == True:
811
  st.button("Reset", on_click=reset_scenario)
812
 
813
  _columns2 = st.columns((2, 2, 2))
814
- if st.session_state["optimization_key"] == "Spends":
815
  with _columns2[0]:
816
  spend_input = st.text_input(
817
  "Absolute",
@@ -827,7 +827,7 @@ if auth_status == True:
827
  step=1,
828
  on_change=update_all_spends,
829
  )
830
- elif st.session_state["optimization_key"] == "Sales":
831
  with _columns2[0]:
832
 
833
  sales_input = st.text_input(
 
53
  # print('@@@@@@@@')
54
  if len(channel_list) > 0:
55
  scenario = st.session_state["scenario"]
56
+ if key.lower() == "media spends":
57
  with status_placeholder:
58
  with st.spinner("Optimizing"):
59
  result = st.session_state["scenario"].optimize(
60
  st.session_state["total_spends_change"], channel_list
61
  )
62
+ elif key.lower() == "revenue":
63
  with status_placeholder:
64
  with st.spinner("Optimizing"):
65
 
 
787
  with _columns1[0]:
788
 
789
  optimization_selection = st.selectbox(
790
+ "Optimize", options=["Media Spends", "Revenue"], key="optimization_key"
791
  )
792
  with _columns1[1]:
793
  st.markdown("#")
 
811
  st.button("Reset", on_click=reset_scenario)
812
 
813
  _columns2 = st.columns((2, 2, 2))
814
+ if st.session_state["optimization_key"] == "Media Spends":
815
  with _columns2[0]:
816
  spend_input = st.text_input(
817
  "Absolute",
 
827
  step=1,
828
  on_change=update_all_spends,
829
  )
830
+ elif st.session_state["optimization_key"] == "Revenue":
831
  with _columns2[0]:
832
 
833
  sales_input = st.text_input(