Spaces:
Sleeping
Sleeping
Commit
·
54b8ad8
1
Parent(s):
53779a3
test
Browse files
app.py
CHANGED
|
@@ -78,7 +78,12 @@ def battery_storage(batteries: int) -> float:
|
|
| 78 |
return batteries * BATTERY_CAPACITY * BATTERY_VOLTAGE * 0.8 / 1000 # kWh
|
| 79 |
|
| 80 |
|
| 81 |
-
def financial_analysis(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
"""Detailed financial calculations"""
|
| 83 |
solar_used = min(production, consumption)
|
| 84 |
surplus = max(0, production - consumption)
|
|
@@ -231,8 +236,8 @@ def main():
|
|
| 231 |
📊 **System Totals**
|
| 232 |
- **Total Panel Capacity**: {0:.1f} kW
|
| 233 |
- **Total Battery Storage**: {1:.1f} kWh
|
| 234 |
-
- **Total Investment**: {2:,.0f}
|
| 235 |
-
|
| 236 |
st.session_state.solar_panels * SOLAR_PANEL_RATING / 1000,
|
| 237 |
battery_storage(st.session_state.batteries),
|
| 238 |
st.session_state.solar_panels * st.session_state.panel_price
|
|
@@ -272,7 +277,9 @@ def main():
|
|
| 272 |
consumption = total_consumption(params["1br"], params["2br"], params["common"])
|
| 273 |
production = solar_production(st.session_state.solar_panels)
|
| 274 |
storage = battery_storage(st.session_state.batteries)
|
| 275 |
-
financials = financial_analysis(
|
|
|
|
|
|
|
| 276 |
analysis_data.append({"Scenario": name, **financials})
|
| 277 |
|
| 278 |
df = pd.DataFrame(analysis_data)
|
|
|
|
| 78 |
return batteries * BATTERY_CAPACITY * BATTERY_VOLTAGE * 0.8 / 1000 # kWh
|
| 79 |
|
| 80 |
|
| 81 |
+
def financial_analysis(
|
| 82 |
+
consumption: float,
|
| 83 |
+
common_area_consumption: float,
|
| 84 |
+
production: float,
|
| 85 |
+
storage: float,
|
| 86 |
+
) -> Dict:
|
| 87 |
"""Detailed financial calculations"""
|
| 88 |
solar_used = min(production, consumption)
|
| 89 |
surplus = max(0, production - consumption)
|
|
|
|
| 236 |
📊 **System Totals**
|
| 237 |
- **Total Panel Capacity**: {0:.1f} kW
|
| 238 |
- **Total Battery Storage**: {1:.1f} kWh
|
| 239 |
+
- **Total Investment**: ksh. {2:,.0f}
|
| 240 |
+
""".format(
|
| 241 |
st.session_state.solar_panels * SOLAR_PANEL_RATING / 1000,
|
| 242 |
battery_storage(st.session_state.batteries),
|
| 243 |
st.session_state.solar_panels * st.session_state.panel_price
|
|
|
|
| 277 |
consumption = total_consumption(params["1br"], params["2br"], params["common"])
|
| 278 |
production = solar_production(st.session_state.solar_panels)
|
| 279 |
storage = battery_storage(st.session_state.batteries)
|
| 280 |
+
financials = financial_analysis(
|
| 281 |
+
consumption, common_area_consumption, production, storage
|
| 282 |
+
)
|
| 283 |
analysis_data.append({"Scenario": name, **financials})
|
| 284 |
|
| 285 |
df = pd.DataFrame(analysis_data)
|