From 2895f1ca055fcab464db85864ba5f993e3b411c0 Mon Sep 17 00:00:00 2001 From: Philip Groesdonk Date: Wed, 6 Nov 2024 12:16:31 +0100 Subject: [PATCH] made sure no BuildingAHU is created for json files without a central_ahu dict --- teaser/data/input/teaserjson_input.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/teaser/data/input/teaserjson_input.py b/teaser/data/input/teaserjson_input.py index c4994ce9d..258e4e96f 100644 --- a/teaser/data/input/teaserjson_input.py +++ b/teaser/data/input/teaserjson_input.py @@ -106,31 +106,30 @@ def load_teaser_json(path, project): bldg.window_area = bldg_in["window_area"] try: + ahu_in = bldg_in["central_ahu"] bldg.central_ahu = BuildingAHU(parent=bldg) - bldg.central_ahu.heating = bldg_in["central_ahu"]["heating"] - bldg.central_ahu.cooling = bldg_in["central_ahu"]["cooling"] - bldg.central_ahu.dehumidification = bldg_in["central_ahu"][ - "dehumidification" - ] - bldg.central_ahu.humidification = bldg_in["central_ahu"]["humidification"] - bldg.central_ahu.heat_recovery = bldg_in["central_ahu"]["heat_recovery"] - bldg.central_ahu.by_pass_dehumidification = bldg_in["central_ahu"][ + bldg.central_ahu.heating = ahu_in["heating"] + bldg.central_ahu.cooling = ahu_in["cooling"] + bldg.central_ahu.dehumidification = ahu_in["dehumidification"] + bldg.central_ahu.humidification = ahu_in["humidification"] + bldg.central_ahu.heat_recovery = ahu_in["heat_recovery"] + bldg.central_ahu.by_pass_dehumidification = ahu_in[ "by_pass_dehumidification" ] - bldg.central_ahu.efficiency_recovery = bldg_in["central_ahu"][ + bldg.central_ahu.efficiency_recovery = ahu_in[ "efficiency_recovery" ] - bldg.central_ahu.efficiency_recovery_false = bldg_in["central_ahu"][ + bldg.central_ahu.efficiency_recovery_false = ahu_in[ "efficiency_recovery_false" ] - bldg.central_ahu.min_relative_humidity_profile = bldg_in["central_ahu"][ + bldg.central_ahu.min_relative_humidity_profile = ahu_in[ "min_relative_humidity_profile" ] - bldg.central_ahu.max_relative_humidity_profile = bldg_in["central_ahu"][ + bldg.central_ahu.max_relative_humidity_profile = ahu_in[ "max_relative_humidity_profile" ] - bldg.central_ahu.v_flow_profile = bldg_in["central_ahu"]["v_flow_profile"] - bldg.central_ahu.temperature_profile = bldg_in["central_ahu"][ + bldg.central_ahu.v_flow_profile = ahu_in["v_flow_profile"] + bldg.central_ahu.temperature_profile = ahu_in[ "temperature_profile" ] except KeyError: