Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -36,6 +36,7 @@ from app.renewable_energy import display_renewable_energy_page
|
|
36 |
from app.embodied_energy import display_embodied_energy_page
|
37 |
from app.materials_cost import display_materials_cost_page
|
38 |
from app.m_c_data import SAMPLE_MATERIALS, SAMPLE_FENESTRATIONS, DEFAULT_MATERIAL_PROPERTIES, DEFAULT_WINDOW_PROPERTIES, SAMPLE_CONSTRUCTIONS
|
|
|
39 |
|
40 |
class BuildSustain:
|
41 |
"""
|
@@ -137,10 +138,18 @@ class BuildSustain:
|
|
137 |
"skylights": []
|
138 |
},
|
139 |
"internal_loads": {
|
140 |
-
"schedules":
|
141 |
-
"people":
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
"ventilation": [],
|
145 |
"infiltration": []
|
146 |
},
|
@@ -341,8 +350,22 @@ class BuildSustain:
|
|
341 |
if key in st.session_state:
|
342 |
st.session_state.pop(key, None)
|
343 |
|
344 |
-
# Clear
|
345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
|
347 |
def _handle_module_reruns(self):
|
348 |
"""
|
|
|
36 |
from app.embodied_energy import display_embodied_energy_page
|
37 |
from app.materials_cost import display_materials_cost_page
|
38 |
from app.m_c_data import SAMPLE_MATERIALS, SAMPLE_FENESTRATIONS, DEFAULT_MATERIAL_PROPERTIES, DEFAULT_WINDOW_PROPERTIES, SAMPLE_CONSTRUCTIONS
|
39 |
+
from app.i_l_data import PEOPLE_ACTIVITY_LEVELS, DEFAULT_BUILDING_INTERNALS, DEFAULT_EQUIPMENT_LOADS, DEFAULT_OCCUPANT_DENSITY, DEFAULT_SCHEDULE_TEMPLATES, LIGHTING_FIXTURE_TYPES, display_internal_loads_help
|
40 |
|
41 |
class BuildSustain:
|
42 |
"""
|
|
|
138 |
"skylights": []
|
139 |
},
|
140 |
"internal_loads": {
|
141 |
+
"schedules": dict(DEFAULT_SCHEDULE_TEMPLATES),
|
142 |
+
"people": {
|
143 |
+
"activity_levels": dict(PEOPLE_ACTIVITY_LEVELS),
|
144 |
+
"occupant_densities": dict(DEFAULT_OCCUPANT_DENSITY)
|
145 |
+
},
|
146 |
+
"lighting": {
|
147 |
+
"fixture_types": dict(LIGHTING_FIXTURE_TYPES),
|
148 |
+
"building_internals": dict(DEFAULT_BUILDING_INTERNALS)
|
149 |
+
},
|
150 |
+
"equipment": {
|
151 |
+
"loads": dict(DEFAULT_EQUIPMENT_LOADS)
|
152 |
+
},
|
153 |
"ventilation": [],
|
154 |
"infiltration": []
|
155 |
},
|
|
|
350 |
if key in st.session_state:
|
351 |
st.session_state.pop(key, None)
|
352 |
|
353 |
+
# Clear internal loads specific states when leaving the Internal Loads page
|
354 |
+
if previous_page == "Internal Loads":
|
355 |
+
keys_to_clear = [
|
356 |
+
"people_editor",
|
357 |
+
"lighting_editor",
|
358 |
+
"equipment_editor",
|
359 |
+
"ventilation_editor",
|
360 |
+
"infiltration_editor",
|
361 |
+
"internal_loads_action",
|
362 |
+
"internal_loads_rerun_pending",
|
363 |
+
"internal_loads_form_state",
|
364 |
+
"rerun_trigger"
|
365 |
+
]
|
366 |
+
for key in keys_to_clear:
|
367 |
+
if key in st.session_state:
|
368 |
+
st.session_state.pop(key, None)
|
369 |
|
370 |
def _handle_module_reruns(self):
|
371 |
"""
|