diff --git a/hub/exports/building_energy/idf_helper/idf_appliance.py b/hub/exports/building_energy/idf_helper/idf_appliance.py index 2da1485b..6651ec58 100644 --- a/hub/exports/building_energy/idf_helper/idf_appliance.py +++ b/hub/exports/building_energy/idf_helper/idf_appliance.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfAppliance(CercIdf): +class IdfAppliance(IdfBase): def add(self, thermal_zone, zone_name): schedule_name = f'Appliance schedules {thermal_zone.usage_name}' storeys_number = int(thermal_zone.total_floor_area / thermal_zone.footprint_area) diff --git a/hub/exports/building_energy/idf_helper/idf_construction.py b/hub/exports/building_energy/idf_helper/idf_construction.py index b6974f45..244241fe 100644 --- a/hub/exports/building_energy/idf_helper/idf_construction.py +++ b/hub/exports/building_energy/idf_helper/idf_construction.py @@ -1,9 +1,9 @@ -from hub.city_model_structure.building_demand.layer import Layer -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.city_model_structure.building_demand.layer import Layer +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfConstruction(CercIdf): +class IdfConstruction(IdfBase): def _add_solid_material(self, layer): file = self._files['solid_materials'] self._write_to_idf_format(file, idf_cte.SOLID_MATERIAL) diff --git a/hub/exports/building_energy/idf_helper/idf_dhw.py b/hub/exports/building_energy/idf_helper/idf_dhw.py index e8def02a..d5124e93 100644 --- a/hub/exports/building_energy/idf_helper/idf_dhw.py +++ b/hub/exports/building_energy/idf_helper/idf_dhw.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfDhw(CercIdf): +class IdfDhw(IdfBase): def add(self, thermal_zone, zone_name): name = f'DHW {zone_name}' peak_flow_rate = thermal_zone.domestic_hot_water.peak_flow * thermal_zone.total_floor_area diff --git a/hub/exports/building_energy/idf_helper/idf_file_schedule.py b/hub/exports/building_energy/idf_helper/idf_file_schedule.py index 229c22cf..23880b1e 100644 --- a/hub/exports/building_energy/idf_helper/idf_file_schedule.py +++ b/hub/exports/building_energy/idf_helper/idf_file_schedule.py @@ -1,10 +1,10 @@ from pathlib import Path + import hub.exports.building_energy.idf_helper as idf_cte - -from hub.exports.building_energy.cerc_idf import CercIdf +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfFileSchedule(CercIdf): +class IdfFileSchedule(IdfBase): def add(self, usage, schedule_type, schedules): schedule_name = f'{schedule_type} schedules {usage}' for schedule in schedules: diff --git a/hub/exports/building_energy/idf_helper/idf_heating_system.py b/hub/exports/building_energy/idf_helper/idf_heating_system.py index c7f34b5c..4c9dbee3 100644 --- a/hub/exports/building_energy/idf_helper/idf_heating_system.py +++ b/hub/exports/building_energy/idf_helper/idf_heating_system.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfHeatingSystem(CercIdf): +class IdfHeatingSystem(IdfBase): def add(self, thermal_zone, zone_name): availability_schedule = f'HVAC AVAIL SCHEDULES {thermal_zone.usage_name}' thermostat_name = f'Thermostat {thermal_zone.usage_name}' diff --git a/hub/exports/building_energy/idf_helper/idf_infiltration.py b/hub/exports/building_energy/idf_helper/idf_infiltration.py index 9e7a97a3..93d58421 100644 --- a/hub/exports/building_energy/idf_helper/idf_infiltration.py +++ b/hub/exports/building_energy/idf_helper/idf_infiltration.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfInfiltration(CercIdf): +class IdfInfiltration(IdfBase): def add(self, thermal_zone, zone_name): schedule_name = f'Infiltration schedules {thermal_zone.usage_name}' diff --git a/hub/exports/building_energy/idf_helper/idf_lighting.py b/hub/exports/building_energy/idf_helper/idf_lighting.py index 57730e83..2217f3e3 100644 --- a/hub/exports/building_energy/idf_helper/idf_lighting.py +++ b/hub/exports/building_energy/idf_helper/idf_lighting.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfLighting(CercIdf): +class IdfLighting(IdfBase): def add(self, thermal_zone, zone_name): storeys_number = int(thermal_zone.total_floor_area / thermal_zone.footprint_area) watts_per_zone_floor_area = thermal_zone.lighting.density * storeys_number diff --git a/hub/exports/building_energy/idf_helper/idf_material.py b/hub/exports/building_energy/idf_helper/idf_material.py index 1c1c8037..d9d0b1c7 100644 --- a/hub/exports/building_energy/idf_helper/idf_material.py +++ b/hub/exports/building_energy/idf_helper/idf_material.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfMaterial(CercIdf): +class IdfMaterial(IdfBase): def _add_solid_material(self, layer): file = self._files['solid_materials'] self._write_to_idf_format(file, idf_cte.SOLID_MATERIAL) diff --git a/hub/exports/building_energy/idf_helper/idf_occupancy.py b/hub/exports/building_energy/idf_helper/idf_occupancy.py index 6890678e..1d30c508 100644 --- a/hub/exports/building_energy/idf_helper/idf_occupancy.py +++ b/hub/exports/building_energy/idf_helper/idf_occupancy.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfOccupancy(CercIdf): +class IdfOccupancy(IdfBase): def add(self, thermal_zone, zone_name): number_of_people = thermal_zone.occupancy.occupancy_density * thermal_zone.total_floor_area fraction_radiant = 0 diff --git a/hub/exports/building_energy/idf_helper/idf_schedule.py b/hub/exports/building_energy/idf_helper/idf_schedule.py index d72a7162..7f0626a1 100644 --- a/hub/exports/building_energy/idf_helper/idf_schedule.py +++ b/hub/exports/building_energy/idf_helper/idf_schedule.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfSchedule(CercIdf): +class IdfSchedule(IdfBase): def add(self, usage, schedule_type, schedules): if len(schedules) < 1: return diff --git a/hub/exports/building_energy/idf_helper/idf_shading.py b/hub/exports/building_energy/idf_helper/idf_shading.py index 0c109ac3..fe1d9a97 100644 --- a/hub/exports/building_energy/idf_helper/idf_shading.py +++ b/hub/exports/building_energy/idf_helper/idf_shading.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfShading(CercIdf): +class IdfShading(IdfBase): def add(self, building): name = building.name file = self._files['shading'] diff --git a/hub/exports/building_energy/idf_helper/idf_surfaces.py b/hub/exports/building_energy/idf_helper/idf_surfaces.py index 3a0bcabe..c9547d13 100644 --- a/hub/exports/building_energy/idf_helper/idf_surfaces.py +++ b/hub/exports/building_energy/idf_helper/idf_surfaces.py @@ -1,9 +1,9 @@ import hub.exports.building_energy.idf_helper as idf_cte import hub.helpers.constants as cte -from hub.exports.building_energy.cerc_idf import CercIdf +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfSurfaces(CercIdf): +class IdfSurfaces(IdfBase): def add(self, building, zone_name): # Verify if create building surfaces "by hand" it's faster wwr it's missing zone_name = f'{zone_name}' diff --git a/hub/exports/building_energy/idf_helper/idf_thermostat.py b/hub/exports/building_energy/idf_helper/idf_thermostat.py index 267bcbc6..c5f6271b 100644 --- a/hub/exports/building_energy/idf_helper/idf_thermostat.py +++ b/hub/exports/building_energy/idf_helper/idf_thermostat.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfThermostat(CercIdf): +class IdfThermostat(IdfBase): def add(self, thermal_zone): thermostat_name = f'Thermostat {thermal_zone.usage_name}' diff --git a/hub/exports/building_energy/idf_helper/idf_ventilation.py b/hub/exports/building_energy/idf_helper/idf_ventilation.py index cbc2d285..10053d44 100644 --- a/hub/exports/building_energy/idf_helper/idf_ventilation.py +++ b/hub/exports/building_energy/idf_helper/idf_ventilation.py @@ -1,9 +1,9 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte import hub.helpers.constants as cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfVentilation(CercIdf): +class IdfVentilation(IdfBase): def add(self, thermal_zone, zone_name): schedule_name = f'Ventilation schedules {thermal_zone.usage_name}' air_change = thermal_zone.mechanical_air_change * cte.HOUR_TO_SECONDS diff --git a/hub/exports/building_energy/idf_helper/idf_windows_constructions.py b/hub/exports/building_energy/idf_helper/idf_windows_constructions.py index 9dba5ade..079fd08c 100644 --- a/hub/exports/building_energy/idf_helper/idf_windows_constructions.py +++ b/hub/exports/building_energy/idf_helper/idf_windows_constructions.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfWindowsConstructions(CercIdf): +class IdfWindowsConstructions(IdfBase): def add(self): glazing_index = self._windows_added_to_idf['glazing_index'] + 1 for i in range(1, glazing_index): diff --git a/hub/exports/building_energy/idf_helper/idf_windows_material.py b/hub/exports/building_energy/idf_helper/idf_windows_material.py index 6b8cbcac..eeb7f91b 100644 --- a/hub/exports/building_energy/idf_helper/idf_windows_material.py +++ b/hub/exports/building_energy/idf_helper/idf_windows_material.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfWindowsMaterial(CercIdf): +class IdfWindowsMaterial(IdfBase): def add(self, thermal_opening): name = f'{thermal_opening.overall_u_value}_{thermal_opening.g_value}' if name not in self._windows_added_to_idf: diff --git a/hub/exports/building_energy/idf_helper/idf_zone.py b/hub/exports/building_energy/idf_helper/idf_zone.py index 8cb950c4..1db36dae 100644 --- a/hub/exports/building_energy/idf_helper/idf_zone.py +++ b/hub/exports/building_energy/idf_helper/idf_zone.py @@ -1,8 +1,8 @@ -from hub.exports.building_energy.cerc_idf import CercIdf import hub.exports.building_energy.idf_helper as idf_cte +from hub.exports.building_energy.idf_helper.idf_base import IdfBase -class IdfZone(CercIdf): +class IdfZone(IdfBase): def add(self, thermal_zone, zone_name): file = self._files['zones'] self._write_to_idf_format(file, idf_cte.ZONE) diff --git a/hub/exports/energy_building_exports_factory.py b/hub/exports/energy_building_exports_factory.py index 331d6e15..a16b5e1e 100644 --- a/hub/exports/energy_building_exports_factory.py +++ b/hub/exports/energy_building_exports_factory.py @@ -11,7 +11,7 @@ import requests from hub.exports.building_energy.energy_ade import EnergyAde from hub.exports.building_energy.idf import Idf -from hub.exports.building_energy.idf_helper import CercIdf +from hub.exports.building_energy.cerc_idf import CercIdf from hub.exports.building_energy.insel.insel_monthly_energy_balance import InselMonthlyEnergyBalance from hub.helpers.utils import validate_import_export_type from hub.imports.weather.helpers.weather import Weather as wh diff --git a/tests/test_exports.py b/tests/test_exports.py index 3e435953..ac881960 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -144,7 +144,7 @@ class TestExports(TestCase): UsageFactory('nrcan', city).enrich() WeatherFactory('epw', city).enrich() try: - EnergyBuildingsExportsFactory('idf_helper', city, self._output_path)._cerc_idf + EnergyBuildingsExportsFactory('cerc_idf', city, self._output_path)._cerc_idf except Exception: self.fail("Idf ExportsFactory raised ExceptionType unexpectedly!")