Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,13 @@ from dotenv import load_dotenv
|
|
6 |
import plotly.graph_objects as go
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Load environment variables
|
10 |
load_dotenv()
|
11 |
|
@@ -32,19 +39,15 @@ with st.form("solar_form"):
|
|
32 |
state_options = df['State'].dropna().unique()
|
33 |
location = st.selectbox("Select your State", options=sorted(state_options))
|
34 |
|
35 |
-
|
36 |
"Select Solar Project Type",
|
37 |
-
options=["Rooftop Solar",
|
|
|
|
|
38 |
)
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
electricity_bill = st.number_input("Enter your monthly electricity bill (₹)", min_value=0)
|
43 |
-
desired_kwh = None
|
44 |
-
else:
|
45 |
-
desired_kwh = st.number_input("Enter desired monthly solar electricity production (kWh)", min_value=1)
|
46 |
-
electricity_bill = st.number_input("Enter your monthly electricity bill (₹)", min_value=0)
|
47 |
-
roof_size = None
|
48 |
|
49 |
submitted = st.form_submit_button("Get Estimate")
|
50 |
|
@@ -56,12 +59,8 @@ if submitted and location:
|
|
56 |
ghi = state_data['Avg_GHI (kWh/m²/day)']
|
57 |
solar_cost_per_kw = state_data['Solar_Cost_per_kW (₹)']
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
estimated_daily_output = round(system_size_kw * ghi, 2)
|
62 |
-
else:
|
63 |
-
system_size_kw = round(desired_kwh / (30 * ghi), 2)
|
64 |
-
estimated_daily_output = round(system_size_kw * ghi, 2)
|
65 |
|
66 |
total_system_cost = round(system_size_kw * solar_cost_per_kw, 2)
|
67 |
monthly_savings = round(estimated_daily_output * 30 * TARIFF_RATE, 2)
|
|
|
6 |
import plotly.graph_objects as go
|
7 |
|
8 |
|
9 |
+
import streamlit as st
|
10 |
+
import pandas as pd
|
11 |
+
import google.generativeai as genai
|
12 |
+
import os
|
13 |
+
from dotenv import load_dotenv
|
14 |
+
import plotly.graph_objects as go
|
15 |
+
|
16 |
# Load environment variables
|
17 |
load_dotenv()
|
18 |
|
|
|
39 |
state_options = df['State'].dropna().unique()
|
40 |
location = st.selectbox("Select your State", options=sorted(state_options))
|
41 |
|
42 |
+
st.radio(
|
43 |
"Select Solar Project Type",
|
44 |
+
options=["Rooftop Solar"],
|
45 |
+
index=0,
|
46 |
+
disabled=True
|
47 |
)
|
48 |
|
49 |
+
roof_size = st.number_input("Enter your roof size (in sq meters)", min_value=1)
|
50 |
+
electricity_bill = st.number_input("Enter your monthly electricity bill (₹)", min_value=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
submitted = st.form_submit_button("Get Estimate")
|
53 |
|
|
|
59 |
ghi = state_data['Avg_GHI (kWh/m²/day)']
|
60 |
solar_cost_per_kw = state_data['Solar_Cost_per_kW (₹)']
|
61 |
|
62 |
+
system_size_kw = round(roof_size * ROOFTOP_CONVERSION_FACTOR, 2)
|
63 |
+
estimated_daily_output = round(system_size_kw * ghi, 2)
|
|
|
|
|
|
|
|
|
64 |
|
65 |
total_system_cost = round(system_size_kw * solar_cost_per_kw, 2)
|
66 |
monthly_savings = round(estimated_daily_output * 30 * TARIFF_RATE, 2)
|