Spaces:
Sleeping
Sleeping
Update data/climate_data.py
Browse files- data/climate_data.py +30 -4
data/climate_data.py
CHANGED
|
@@ -151,7 +151,7 @@ class ClimateData:
|
|
| 151 |
hdd = st.number_input("Heating Degree Days (base 18°C)", min_value=0.0, value=0.0, step=100.0)
|
| 152 |
cdd = st.number_input("Cooling Degree Days (base 18°C)", min_value=0.0, value=0.0, step=100.0)
|
| 153 |
winter_design_temp = st.number_input("Winter Design Temp (99.6%) (°C)", min_value=-50.0, max_value=20.0, value=0.0, step=0.5)
|
| 154 |
-
summer_design_temp_db = st.number_input("Summer Design Temp
|
| 155 |
summer_design_temp_wb = st.number_input("Summer Design Temp WB (0.4%) (°C)", min_value=0.0, max_value=40.0, value=25.0, step=0.5)
|
| 156 |
summer_daily_range = st.number_input("Summer Daily Range (°C)", min_value=0.0, value=5.0, step=0.5)
|
| 157 |
|
|
@@ -162,7 +162,7 @@ class ClimateData:
|
|
| 162 |
col1, col2 = st.columns(2)
|
| 163 |
with col1:
|
| 164 |
for month in month_names[:6]:
|
| 165 |
-
monthly_temps[month] = st.number_input(f"{month} Temp (°C)", min_value=-
|
| 166 |
with col2:
|
| 167 |
for month in month_names[6:]:
|
| 168 |
monthly_temps[month] = st.number_input(f"{month} Temp (°C)", min_value=-50.0, max_value=50.0, value=20.0, step=0.5, key=f"temp_{month}")
|
|
@@ -296,10 +296,15 @@ class ClimateData:
|
|
| 296 |
st.button("Continue to Building Components", disabled=True)
|
| 297 |
|
| 298 |
def display_design_conditions(self, location: ClimateLocation):
|
| 299 |
-
"""Display a table of design conditions for calculations."""
|
| 300 |
st.subheader("Design Conditions for HVAC Calculations")
|
|
|
|
|
|
|
| 301 |
design_data = pd.DataFrame({
|
| 302 |
"Parameter": [
|
|
|
|
|
|
|
|
|
|
| 303 |
"Climate Zone",
|
| 304 |
"Heating Degree Days (base 18°C)",
|
| 305 |
"Cooling Degree Days (base 18°C)",
|
|
@@ -309,6 +314,9 @@ class ClimateData:
|
|
| 309 |
"Summer Daily Temperature Range"
|
| 310 |
],
|
| 311 |
"Value": [
|
|
|
|
|
|
|
|
|
|
| 312 |
location.climate_zone,
|
| 313 |
f"{location.heating_degree_days} HDD",
|
| 314 |
f"{location.cooling_degree_days} CDD",
|
|
@@ -318,7 +326,25 @@ class ClimateData:
|
|
| 318 |
f"{location.summer_daily_range} °C"
|
| 319 |
]
|
| 320 |
})
|
| 321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
|
| 323 |
@staticmethod
|
| 324 |
def assign_climate_zone(hdd: float, cdd: float, avg_humidity: float) -> str:
|
|
|
|
| 151 |
hdd = st.number_input("Heating Degree Days (base 18°C)", min_value=0.0, value=0.0, step=100.0)
|
| 152 |
cdd = st.number_input("Cooling Degree Days (base 18°C)", min_value=0.0, value=0.0, step=100.0)
|
| 153 |
winter_design_temp = st.number_input("Winter Design Temp (99.6%) (°C)", min_value=-50.0, max_value=20.0, value=0.0, step=0.5)
|
| 154 |
+
summer_design_temp_db = st.number_input("Summer Design Temp EXPORTDB (0.4%) (°C)", min_value=0.0, max_value=50.0, value=35.0, step=0.5)
|
| 155 |
summer_design_temp_wb = st.number_input("Summer Design Temp WB (0.4%) (°C)", min_value=0.0, max_value=40.0, value=25.0, step=0.5)
|
| 156 |
summer_daily_range = st.number_input("Summer Daily Range (°C)", min_value=0.0, value=5.0, step=0.5)
|
| 157 |
|
|
|
|
| 162 |
col1, col2 = st.columns(2)
|
| 163 |
with col1:
|
| 164 |
for month in month_names[:6]:
|
| 165 |
+
monthly_temps[month] = st.number_input(f"{month} Temp (°C)", min_value=- diaspora50.0, max_value=50.0, value=20.0, step=0.5, key=f"temp_{month}")
|
| 166 |
with col2:
|
| 167 |
for month in month_names[6:]:
|
| 168 |
monthly_temps[month] = st.number_input(f"{month} Temp (°C)", min_value=-50.0, max_value=50.0, value=20.0, step=0.5, key=f"temp_{month}")
|
|
|
|
| 296 |
st.button("Continue to Building Components", disabled=True)
|
| 297 |
|
| 298 |
def display_design_conditions(self, location: ClimateLocation):
|
| 299 |
+
"""Display a table of design conditions including additional parameters for HVAC calculations."""
|
| 300 |
st.subheader("Design Conditions for HVAC Calculations")
|
| 301 |
+
|
| 302 |
+
# Prepare the design data with additional parameters
|
| 303 |
design_data = pd.DataFrame({
|
| 304 |
"Parameter": [
|
| 305 |
+
"Latitude",
|
| 306 |
+
"Longitude",
|
| 307 |
+
"Elevation (m)",
|
| 308 |
"Climate Zone",
|
| 309 |
"Heating Degree Days (base 18°C)",
|
| 310 |
"Cooling Degree Days (base 18°C)",
|
|
|
|
| 314 |
"Summer Daily Temperature Range"
|
| 315 |
],
|
| 316 |
"Value": [
|
| 317 |
+
f"{location.latitude}°",
|
| 318 |
+
f"{location.longitude}°",
|
| 319 |
+
f"{location.elevation} m",
|
| 320 |
location.climate_zone,
|
| 321 |
f"{location.heating_degree_days} HDD",
|
| 322 |
f"{location.cooling_degree_days} CDD",
|
|
|
|
| 326 |
f"{location.summer_daily_range} °C"
|
| 327 |
]
|
| 328 |
})
|
| 329 |
+
|
| 330 |
+
# Add monthly temperatures
|
| 331 |
+
month_names = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
| 332 |
+
monthly_temp_data = pd.DataFrame({
|
| 333 |
+
"Parameter": [f"{month} Avg Temp" for month in month_names],
|
| 334 |
+
"Value": [f"{location.monthly_temps[month]} °C" for month in month_names]
|
| 335 |
+
})
|
| 336 |
+
|
| 337 |
+
# Add monthly humidity
|
| 338 |
+
monthly_humidity_data = pd.DataFrame({
|
| 339 |
+
"Parameter": [f"{month} Avg Humidity" for month in month_names],
|
| 340 |
+
"Value": [f"{location.monthly_humidity[month]} %" for month in month_names]
|
| 341 |
+
})
|
| 342 |
+
|
| 343 |
+
# Combine all data into one table
|
| 344 |
+
full_design_data = pd.concat([design_data, monthly_temp_data, monthly_humidity_data], ignore_index=True)
|
| 345 |
+
|
| 346 |
+
# Display the table in Streamlit
|
| 347 |
+
st.table(full_design_data)
|
| 348 |
|
| 349 |
@staticmethod
|
| 350 |
def assign_climate_zone(hdd: float, cdd: float, avg_humidity: float) -> str:
|