Spaces:
Sleeping
Sleeping
[FIX] Empty coefficients (tab3) highlighted in blue (for secondary resources)
Browse files- tabs/tab3_coefficients.py +10 -2
tabs/tab3_coefficients.py
CHANGED
|
@@ -150,8 +150,16 @@ def render_tab(cost_sliders):
|
|
| 150 |
|
| 151 |
for m in method_order:
|
| 152 |
for r in resource_order:
|
| 153 |
-
|
| 154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
|
| 156 |
df_default = df_default.astype(float)
|
| 157 |
df_current = df_current.astype(float)
|
|
|
|
| 150 |
|
| 151 |
for m in method_order:
|
| 152 |
for r in resource_order:
|
| 153 |
+
is_secondary = (m, r) in secondary_resources
|
| 154 |
+
current_val = st.session_state.costs.get(m, {}).get(r, 0.0)
|
| 155 |
+
|
| 156 |
+
if is_secondary:
|
| 157 |
+
default_val = cost_sliders.get(m, {}).get(r, {}).get("median", 0.0) if current_val != 0.0 else 0.0
|
| 158 |
+
else:
|
| 159 |
+
default_val = cost_sliders.get(m, {}).get(r, {}).get("median", 0.0)
|
| 160 |
+
|
| 161 |
+
df_default.at[m, r] = default_val
|
| 162 |
+
df_current.at[m, r] = current_val
|
| 163 |
|
| 164 |
df_default = df_default.astype(float)
|
| 165 |
df_current = df_current.astype(float)
|