From ef304710c4c65cf94311440eda9f42c961448a5d Mon Sep 17 00:00:00 2001 From: Majid Rezaei Date: Wed, 25 Sep 2024 05:54:03 -0400 Subject: [PATCH] fix: change building names in result factory to upper case --- hub/imports/results/ep_multiple_buildings.py | 15 ++++++++------- lachine_development.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hub/imports/results/ep_multiple_buildings.py b/hub/imports/results/ep_multiple_buildings.py index bd9a2dd3..71d62763 100644 --- a/hub/imports/results/ep_multiple_buildings.py +++ b/hub/imports/results/ep_multiple_buildings.py @@ -24,7 +24,7 @@ class EnergyPlusMultipleBuildings: csv_output = list(csv.DictReader(csv_file)) for building in self._city.buildings: - building_name = building.name + building_name = building.name.upper() buildings_energy_demands[f'Building {building_name} Heating Demand (J)'] = [ float( row[f"{building_name} IDEAL LOADS AIR SYSTEM:Zone Ideal Loads Supply Air Total Heating Energy [J](Hourly)"]) @@ -36,7 +36,7 @@ class EnergyPlusMultipleBuildings: for row in csv_output ] buildings_energy_demands[f'Building {building_name} DHW Demand (W)'] = [ - float(row[f"DHW {building.name}:Water Use Equipment Heating Rate [W](Hourly)"]) + float(row[f"DHW {building_name}:Water Use Equipment Heating Rate [W](Hourly)"]) for row in csv_output ] buildings_energy_demands[f'Building {building_name} Appliances (W)'] = [ @@ -58,14 +58,15 @@ class EnergyPlusMultipleBuildings: if energy_plus_output_file_path.is_file(): building_energy_demands = self._building_energy_demands(energy_plus_output_file_path) for building in self._city.buildings: - building.heating_demand[cte.HOUR] = building_energy_demands[f'Building {building.name} Heating Demand (J)'] - building.cooling_demand[cte.HOUR] = building_energy_demands[f'Building {building.name} Cooling Demand (J)'] + building_name = building.name.upper() + building.heating_demand[cte.HOUR] = building_energy_demands[f'Building {building_name} Heating Demand (J)'] + building.cooling_demand[cte.HOUR] = building_energy_demands[f'Building {building_name} Cooling Demand (J)'] building.domestic_hot_water_heat_demand[cte.HOUR] = \ - [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} DHW Demand (W)']] + [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} DHW Demand (W)']] building.appliances_electrical_demand[cte.HOUR] = \ - [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} Appliances (W)']] + [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} Appliances (W)']] building.lighting_electrical_demand[cte.HOUR] = \ - [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} Lighting (W)']] + [x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} Lighting (W)']] building.heating_demand[cte.MONTH] = MonthlyValues.get_total_month(building.heating_demand[cte.HOUR]) building.cooling_demand[cte.MONTH] = MonthlyValues.get_total_month(building.cooling_demand[cte.HOUR]) building.domestic_hot_water_heat_demand[cte.MONTH] = ( diff --git a/lachine_development.py b/lachine_development.py index 965c98c3..a4cc6ac9 100644 --- a/lachine_development.py +++ b/lachine_development.py @@ -21,7 +21,7 @@ simulation_results_path.mkdir(parents=True, exist_ok=True) sra_output_path = output_path / 'sra_outputs' sra_output_path.mkdir(parents=True, exist_ok=True) cost_analysis_output_path = output_path / 'cost_analysis' -cost_analysis_output_path.mkdir(parents=True, exist_ok=True)]) +cost_analysis_output_path.mkdir(parents=True, exist_ok=True) lachine_output_path = output_path / 'lachine_outputs' # Create City from HUB to run EP_Workflow