samuelrince commited on
Commit
ea45772
·
1 Parent(s): 7825e11

feat: add datacenter pue and wue config

Browse files
Files changed (1) hide show
  1. src/expert.py +38 -26
src/expert.py CHANGED
@@ -104,41 +104,53 @@ def expert_mode():
104
 
105
 
106
  with st.container(border=True):
107
- st.markdown("###### Configure the electricity mix of the data center")
108
-
109
- location = st.selectbox(
110
- label="Data center location",
111
- options=[c[1] for c in COUNTRY_CODES],
112
- format_func=format_country_name,
113
- index=0
114
- )
115
-
116
- col4, col5, col6, col7 = st.columns(4)
117
-
118
- electricity_mix = electricity_mixes.find_electricity_mix(location)
 
 
 
 
 
 
 
 
 
 
119
 
120
- with col4:
 
 
121
  em_gwp = st.number_input(
122
- "GHG emissions [kgCO2eq / kWh]",
123
- electricity_mix.gwp,
124
  format="%0.6f",
125
  )
126
- with col5:
127
  em_adpe = st.number_input(
128
- "Abiotic resources [kgSbeq / kWh]",
129
- electricity_mix.adpe,
130
  format="%0.13f",
131
  )
132
- with col6:
133
  em_pe = st.number_input(
134
- "Primary energy [MJ / kWh]",
135
- electricity_mix.pe,
136
  format="%0.3f",
137
  )
138
- with col7:
139
  em_wue = st.number_input(
140
- "Water consumption [L / kWh]",
141
- electricity_mix.wue,
142
  format="%0.3f",
143
  )
144
 
@@ -151,8 +163,8 @@ def expert_mode():
151
  if_electricity_mix_adpe=em_adpe,
152
  if_electricity_mix_pe=em_pe,
153
  if_electricity_mix_wue=em_wue,
154
- datacenter_pue=1.2,
155
- datacenter_wue=0.5
156
  )
157
 
158
  impacts, usage, embodied = format_impacts(impacts)
 
104
 
105
 
106
  with st.container(border=True):
107
+ st.markdown("###### Configure the data center")
108
+
109
+ dc_pue_col, dc_wue_col, dc_location_col = st.columns(3)
110
+ with dc_pue_col:
111
+ datacenter_pue = st.number_input(
112
+ label="Data center PUE",
113
+ value=1.2,
114
+ min_value=1.0
115
+ )
116
+ with dc_wue_col:
117
+ datacenter_wue = st.number_input(
118
+ label="Data center WUE [L / kWh]",
119
+ value=0.6,
120
+ min_value=0.
121
+ )
122
+ with dc_location_col:
123
+ dc_location = st.selectbox(
124
+ label="Data center location",
125
+ options=[c[1] for c in COUNTRY_CODES],
126
+ format_func=format_country_name,
127
+ index=0
128
+ )
129
 
130
+ em_gwp_col, em_adpe_col, em_pe_col, em_wue_col = st.columns(4)
131
+ electricity_mix = electricity_mixes.find_electricity_mix(dc_location)
132
+ with em_gwp_col:
133
  em_gwp = st.number_input(
134
+ label="GHG emissions [kgCO2eq / kWh]",
135
+ value=electricity_mix.gwp,
136
  format="%0.6f",
137
  )
138
+ with em_adpe_col:
139
  em_adpe = st.number_input(
140
+ label="Abiotic resources [kgSbeq / kWh]",
141
+ value=electricity_mix.adpe,
142
  format="%0.13f",
143
  )
144
+ with em_pe_col:
145
  em_pe = st.number_input(
146
+ label="Primary energy [MJ / kWh]",
147
+ value=electricity_mix.pe,
148
  format="%0.3f",
149
  )
150
+ with em_wue_col:
151
  em_wue = st.number_input(
152
+ label="Water consumption [L / kWh]",
153
+ value=electricity_mix.wue,
154
  format="%0.3f",
155
  )
156
 
 
163
  if_electricity_mix_adpe=em_adpe,
164
  if_electricity_mix_pe=em_pe,
165
  if_electricity_mix_wue=em_wue,
166
+ datacenter_pue=datacenter_pue,
167
+ datacenter_wue=datacenter_wue
168
  )
169
 
170
  impacts, usage, embodied = format_impacts(impacts)