Spaces:
Sleeping
Sleeping
Update app/materials_library.py
Browse files- app/materials_library.py +25 -29
app/materials_library.py
CHANGED
@@ -250,42 +250,38 @@ def display_materials_page():
|
|
250 |
except (KeyError, ValueError) as e:
|
251 |
logger.error(f"Error processing material {k}: {str(e)}")
|
252 |
continue
|
253 |
-
|
254 |
material_library.library_glazing_materials = {}
|
255 |
for k, f in st.session_state.project_data["fenestrations"]["library"].items():
|
256 |
try:
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
logger.error(f"Error processing fenestration {k}: Missing key {e}")
|
281 |
-
continue
|
282 |
-
|
283 |
-
|
284 |
with tab1:
|
285 |
display_materials_tab(material_library)
|
286 |
with tab2:
|
287 |
display_fenestrations_tab(material_library)
|
288 |
-
|
289 |
# Navigation buttons
|
290 |
col1, col2 = st.columns(2)
|
291 |
with col1:
|
|
|
250 |
except (KeyError, ValueError) as e:
|
251 |
logger.error(f"Error processing material {k}: {str(e)}")
|
252 |
continue
|
253 |
+
|
254 |
material_library.library_glazing_materials = {}
|
255 |
for k, f in st.session_state.project_data["fenestrations"]["library"].items():
|
256 |
try:
|
257 |
+
if f["type"] == "window":
|
258 |
+
material_library.library_glazing_materials[k] = GlazingMaterial(
|
259 |
+
name=k,
|
260 |
+
shgc=f["performance"]["shgc"],
|
261 |
+
u_value=f["performance"]["u_value"],
|
262 |
+
h_o=f.get("h_o", DEFAULT_WINDOW_PROPERTIES["h_o"]),
|
263 |
+
category="Window/Skylight",
|
264 |
+
is_library=True
|
265 |
+
)
|
266 |
+
elif f["type"] == "door":
|
267 |
+
material_library.library_glazing_materials[k] = GlazingMaterial(
|
268 |
+
name=k,
|
269 |
+
shgc=0.0,
|
270 |
+
u_value=f["performance"]["u_value"],
|
271 |
+
h_o=f.get("h_o", DEFAULT_WINDOW_PROPERTIES["h_o"]),
|
272 |
+
category="Door",
|
273 |
+
is_library=True
|
274 |
+
)
|
275 |
+
logger.debug(f"Loaded fenestration: {k}, Type: {f['type']}")
|
276 |
+
except KeyError as e:
|
277 |
+
logger.error(f"Error processing fenestration {k}: Missing key {e}")
|
278 |
+
continue
|
279 |
+
|
|
|
|
|
|
|
|
|
280 |
with tab1:
|
281 |
display_materials_tab(material_library)
|
282 |
with tab2:
|
283 |
display_fenestrations_tab(material_library)
|
284 |
+
|
285 |
# Navigation buttons
|
286 |
col1, col2 = st.columns(2)
|
287 |
with col1:
|