diff --git a/PHX/from_HBJSON/create_hvac.py b/PHX/from_HBJSON/create_hvac.py index a693436..0f3231f 100644 --- a/PHX/from_HBJSON/create_hvac.py +++ b/PHX/from_HBJSON/create_hvac.py @@ -270,7 +270,7 @@ def build_phx_heating_electric( ) -> hvac.PhxHeaterElectric: phx_obj = hvac.PhxHeaterElectric() phx_obj = _transfer_attributes(_hbeph_heater, phx_obj) - phx_obj.usage_profile.space_heating = True + phx_obj.usage_profile.space_heating_percent = _hbeph_heater.percent_coverage return phx_obj @@ -279,7 +279,7 @@ def build_phx_heating_fossil_boiler( ) -> hvac.PhxHeaterBoilerFossil: phx_obj = hvac.PhxHeaterBoilerFossil() phx_obj = _transfer_attributes(_hbeph_heater, phx_obj) - phx_obj.usage_profile.space_heating = True + phx_obj.usage_profile.space_heating_percent = _hbeph_heater.percent_coverage return phx_obj @@ -288,7 +288,7 @@ def build_phx_heating_wood_boiler( ) -> hvac.PhxHeaterBoilerWood: phx_obj = hvac.PhxHeaterBoilerWood() phx_obj = _transfer_attributes(_hbeph_heater, phx_obj) - phx_obj.usage_profile.space_heating = True + phx_obj.usage_profile.space_heating_percent = _hbeph_heater.percent_coverage return phx_obj @@ -297,7 +297,7 @@ def build_phx_heating_district( ) -> hvac.PhxHeaterDistrictHeat: phx_obj = hvac.PhxHeaterDistrictHeat() phx_obj = _transfer_attributes(_hbeph_heater, phx_obj) - phx_obj.usage_profile.space_heating = True + phx_obj.usage_profile.space_heating_percent = _hbeph_heater.percent_coverage return phx_obj @@ -362,10 +362,10 @@ def build_phx_heating_hp_annual( phx_obj = hvac.PhxHeatPumpAnnual() phx_obj = _transfer_attributes(_hbph_heat_pump, phx_obj) - phx_obj.usage_profile.space_heating = True + phx_obj.usage_profile.space_heating_percent = _hbph_heat_pump.percent_coverage if hbph_heat_pump_has_cooling(_hbph_heat_pump): - phx_obj.usage_profile.cooling = True + phx_obj.usage_profile.cooling_percent = _hbph_heat_pump.cooling_params.percent_coverage phx_obj.params_cooling = build_phx_heat_pump_cooling_params(_hbph_heat_pump) return phx_obj @@ -378,10 +378,10 @@ def build_phx_heating_hp_monthly( phx_obj = hvac.PhxHeatPumpMonthly() phx_obj = _transfer_attributes(_hbph_heat_pump, phx_obj) - phx_obj.usage_profile.space_heating = True + phx_obj.usage_profile.space_heating_percent = _hbph_heat_pump.percent_coverage if hbph_heat_pump_has_cooling(_hbph_heat_pump): - phx_obj.usage_profile.cooling = True + phx_obj.usage_profile.cooling_percent = _hbph_heat_pump.cooling_params.percent_coverage phx_obj.params_cooling = build_phx_heat_pump_cooling_params(_hbph_heat_pump) return phx_obj @@ -394,10 +394,10 @@ def build_phx_heating_hp_combined( phx_obj = hvac.PhxHeatPumpCombined() phx_obj = _transfer_attributes(_hbph_heat_pump, phx_obj) - phx_obj.usage_profile.space_heating = True + phx_obj.usage_profile.space_heating_percent = _hbph_heat_pump.percent_coverage if hbph_heat_pump_has_cooling(_hbph_heat_pump): - phx_obj.usage_profile.cooling = True + phx_obj.usage_profile.cooling_percent = _hbph_heat_pump.cooling_params.percent_coverage phx_obj.params_cooling = build_phx_heat_pump_cooling_params(_hbph_heat_pump) return phx_obj diff --git a/PHX/from_WUFI_XML/phx_converter.py b/PHX/from_WUFI_XML/phx_converter.py index 3c4df20..c5faf44 100644 --- a/PHX/from_WUFI_XML/phx_converter.py +++ b/PHX/from_WUFI_XML/phx_converter.py @@ -4,7 +4,7 @@ from PHX.from_WUFI_XML.wufi_file_schema import WUFIplusProject -def convert_WUFI_XML_to_PHX_project(_model: WUFIplusProject) -> project.PhxProject: - phx_project = _PhxProject(_model) - +def convert_WUFI_XML_to_PHX_project(_wufi_xml_project: WUFIplusProject) -> project.PhxProject: + """Convert a WUFI-XML-Project object over to a PHX-Project.""" + phx_project = _PhxProject(_wufi_xml_project) return phx_project diff --git a/PHX/from_WUFI_XML/phx_schemas.py b/PHX/from_WUFI_XML/phx_schemas.py index 48fdd79..09f1a02 100644 --- a/PHX/from_WUFI_XML/phx_schemas.py +++ b/PHX/from_WUFI_XML/phx_schemas.py @@ -91,6 +91,7 @@ from PHX.model.hvac.collection import PhxZoneCoverage, AnyMechDevice, PhxRecirculationParameters from PHX.model.programs.occupancy import PhxProgramOccupancy from PHX.model.programs.ventilation import PhxProgramVentilation +from PHX.model.hvac.collection import PhxMechanicalSystemCollection from PHX.model.hvac.ventilation import ( PhxDeviceVentilator, AnyPhxExhaustVent, @@ -434,10 +435,13 @@ def _PhxVariant(_xml_variant_data: wufi_xml.Variant, _phx_project_host: PhxProje ) # -- Build the HVAC Systems, Devices, and Distribution + phx_obj.clear_mechanical_collections() for xml_system_data in _xml_variant_data.HVAC.Systems: - phx_obj.mech_systems.display_name = xml_system_data.Name - phx_obj.mech_systems.id_num = xml_system_data.IdentNr - phx_obj.mech_systems.zone_coverage = as_phx_obj( + + new_mechanical_collection = PhxMechanicalSystemCollection() + new_mechanical_collection.display_name = xml_system_data.Name + new_mechanical_collection.id_num = xml_system_data.IdentNr + new_mechanical_collection.zone_coverage = as_phx_obj( xml_system_data.ZonesCoverage[0], "PhxZoneCoverage" ) @@ -445,7 +449,7 @@ def _PhxVariant(_xml_variant_data: wufi_xml.Variant, _phx_project_host: PhxProje # -- Build all the actual Mechanical Devices (boilers, heat-pumps, etc...) for xml_device_data in xml_system_data.Devices: new_device = as_phx_obj(xml_device_data, "PhxMechanicalDevice") # type: AnyMechDevice - phx_obj.mech_systems.add_new_mech_device(new_device.identifier, new_device) + new_mechanical_collection.add_new_mech_device(new_device.identifier, new_device) # --------------------------------------------------------------------- # -- Cooling Distribution @@ -458,19 +462,22 @@ def _PhxVariant(_xml_variant_data: wufi_xml.Variant, _phx_project_host: PhxProje # -- total capacity across all the cooling devices? Seems like as # -- good a solution as any I guess.... - all_cooling_devices = phx_obj.mech_systems.cooling_devices + all_cooling_devices = new_mechanical_collection.cooling_devices number_phx_cooling_devices = len(all_cooling_devices) if number_phx_cooling_devices == 0: continue as_phx_w_num_devices = partial(as_phx_obj, number_phx_cooling_devices=number_phx_cooling_devices) - # -- Apply the param values to all of the cooling heat-pumps found for cooling_device in all_cooling_devices: - cooling_device.params_cooling.ventilation = as_phx_w_num_devices(xml_dist_cooling_data, "PhxCoolingVentilationParams") - cooling_device.params_cooling.recirculation = as_phx_w_num_devices(xml_dist_cooling_data, "PhxCoolingRecirculationParams") - cooling_device.params_cooling.dehumidification = as_phx_w_num_devices(xml_dist_cooling_data, "PhxCoolingDehumidificationParams") - cooling_device.params_cooling.panel = as_phx_w_num_devices(xml_dist_cooling_data, "PhxCoolingPanelParams") + cooling_device.params_cooling.ventilation = as_phx_w_num_devices( + xml_dist_cooling_data, "PhxCoolingVentilationParams") + cooling_device.params_cooling.recirculation = as_phx_w_num_devices( + xml_dist_cooling_data, "PhxCoolingRecirculationParams") + cooling_device.params_cooling.dehumidification = as_phx_w_num_devices( + xml_dist_cooling_data, "PhxCoolingDehumidificationParams") + cooling_device.params_cooling.panel = as_phx_w_num_devices( + xml_dist_cooling_data, "PhxCoolingPanelParams") # --------------------------------------------------------------------- # -- DHW Distribution (Piping) @@ -479,15 +486,15 @@ def _PhxVariant(_xml_variant_data: wufi_xml.Variant, _phx_project_host: PhxProje # -- Distribution Piping Elements for trunc in xml_dist_dhw_data.Truncs or []: new_trunc = as_phx_obj(trunc, "Trunc") # type: PhxPipeTrunk - phx_obj.mech_systems.add_distribution_piping(new_trunc) + new_mechanical_collection.add_distribution_piping(new_trunc) # -- Recirculation Piping Parameters phx_params = as_phx_obj(xml_dist_dhw_data, "PhxRecirculationParameters") - phx_obj.mech_systems._distribution_hw_recirculation_params = phx_params + new_mechanical_collection._distribution_hw_recirculation_params = phx_params # -- Recirculation Piping Element - recirc_pipe_element = as_phx_obj(xml_dist_dhw_data, "RecirculationTrunk") # type: PhxPipeElement - phx_obj.mech_systems.add_recirc_piping(recirc_pipe_element) + recirc_pipe_element = as_phx_obj(xml_dist_dhw_data, "RecirculationTrunk") # type: PhxPipeElement + new_mechanical_collection.add_recirc_piping(recirc_pipe_element) # --------------------------------------------------------------------- # -- Ventilation Distribution (Ducting) @@ -496,14 +503,16 @@ def _PhxVariant(_xml_variant_data: wufi_xml.Variant, _phx_project_host: PhxProje # -- duplicate the duct for each one its assigned to in WUFI-XML for i in wufi_duct_data.AssignedVentUnits or []: new_duct = as_phx_obj(wufi_duct_data, "PhxDuctElement", ventilator=i) - phx_obj.mech_systems.add_vent_ducting(new_duct) + new_mechanical_collection.add_vent_ducting(new_duct) # --------------------------------------------------------------------- # -- Supportive Devices (Pumps, Fans, etc...) xml_supp_device_data = xml_system_data.PHDistribution.SupportiveDevices for supportive_device_data in xml_supp_device_data or []: new_supp_device = as_phx_obj(supportive_device_data, "PhxSupportiveDevice") - phx_obj.mech_systems.supportive_devices.add_new_device(new_supp_device.identifier, new_supp_device) + new_mechanical_collection.supportive_devices.add_new_device(new_supp_device.identifier, new_supp_device) + + phx_obj.add_mechanical_collection(new_mechanical_collection) return phx_obj @@ -1404,7 +1413,7 @@ def _PhxMechanicalDevice(_data: wufi_xml.Device) -> Any: # -- Pass the data off using the correct device-builder-classname new_mech_device = as_phx_obj(_data, builder_class_name) - # -- Set the usage profile (heating, cooling, etc.) of the device + # -- Set the usage profile (heating %, cooling %, etc.) of the device new_mech_device.usage_profile = as_phx_obj(_data, "PhxUsageProfile") return new_mech_device @@ -1412,12 +1421,14 @@ def _PhxMechanicalDevice(_data: wufi_xml.Device) -> Any: def _PhxDevice_Ventilation(_data: wufi_xml.Device) -> PhxDeviceVentilator: phx_obj = PhxDeviceVentilator() - phx_obj.display_name = _data.Name or "unnamed_device" + + phx_obj.display_name = _data.Name or "unnamed_ventilation" phx_obj.id_num = _data.IdentNr phx_obj.identifier = str(_data.IdentNr) phx_obj.params.sensible_heat_recovery = _data.HeatRecovery phx_obj.params.latent_heat_recovery = _data.MoistureRecovery + if _data.PH_Parameters: phx_obj.params.in_conditioned_space = _data.PH_Parameters.InConditionedSpace or False phx_obj.params.quantity = _data.PH_Parameters.Quantity or 0 @@ -1431,14 +1442,10 @@ def _PhxDevice_Ventilation(_data: wufi_xml.Device) -> PhxDeviceVentilator: def _PhxDevice_Electric(_data: wufi_xml.Device) -> PhxHeaterElectric: - new_heater = PhxHeaterElectric() + phx_obj = PhxHeaterElectric() - if _data.DHW_Parameters is not None: - new_heater.percent_coverage = _data.DHW_Parameters.CoverageWithinSystem - if _data.Heating_Parameters is not None: - new_heater.percent_coverage = _data.Heating_Parameters.CoverageWithinSystem - - return new_heater + phx_obj.display_name = _data.Name or "unnamed_direct_electric" + return phx_obj def _PhxDevice_Boiler(_data: wufi_xml.Device) -> Optional[AnyPhxHeaterBoiler]: @@ -1448,18 +1455,17 @@ def _PhxDevice_Boiler(_data: wufi_xml.Device) -> Optional[AnyPhxHeaterBoiler]: hvac_enums.PhxFuelType.WOOD_LOG: "PhxHeaterBoilerWood", hvac_enums.PhxFuelType.WOOD_PELLET: "PhxHeaterBoilerWood", } - if not _data.PH_Parameters: - return None - boiler_type = hvac_enums.PhxFuelType(_data.PH_Parameters.EnergySourceBoilerType) return as_phx_obj(_data, boiler_builders[boiler_type]) def _PhxHeaterBoilerFossil(_data: wufi_xml.Device) -> PhxHeaterBoilerFossil: phx_obj = PhxHeaterBoilerFossil() + if not _data.PH_Parameters: return phx_obj + phx_obj.display_name = _data.Name or "unnamed_fossil_fuel_boiler" phx_obj.params.fuel = _data.PH_Parameters.EnergySourceBoilerType phx_obj.params.condensing = _data.PH_Parameters.CondensingBoiler phx_obj.params.in_conditioned_space = _data.PH_Parameters.InConditionedSpace @@ -1486,12 +1492,21 @@ def _PhxHeaterBoilerFossil(_data: wufi_xml.Device) -> PhxHeaterBoilerFossil: def _PhxHeaterBoilerWood(_data: wufi_xml.Device) -> PhxHeaterBoilerWood: phx_obj = PhxHeaterBoilerWood() + + if not _data.PH_Parameters: + return phx_obj + phx_obj.display_name = _data.Name or "unnamed_wood_boiler" return phx_obj def _PhxDevice_DistrictHeat(_data: wufi_xml.Device) -> PhxHeaterDistrictHeat: - return PhxHeaterDistrictHeat() + phx_obj = PhxHeaterDistrictHeat() + if not _data.PH_Parameters: + return phx_obj + + phx_obj.display_name = _data.Name or "unnamed_district_heat" + return phx_obj def _PhxDevice_HeatPump(_data: wufi_xml.Device) -> Optional[PhxHeatPumpDevice]: @@ -1511,38 +1526,51 @@ def _PhxDevice_HeatPump(_data: wufi_xml.Device) -> Optional[PhxHeatPumpDevice]: def _PhxDevice_HeatPump_Combined(_data: wufi_xml.Device) -> PhxHeatPumpCombined: phx_obj = PhxHeatPumpCombined() + if not _data.PH_Parameters: + return phx_obj + + phx_obj.display_name = _data.Name or "unnamed_combined_heat_pump" return phx_obj def _PhxDevice_HeatPump_Annual(_data: wufi_xml.Device) -> PhxHeatPumpAnnual: phx_obj = PhxHeatPumpAnnual() + if not _data.PH_Parameters: return phx_obj - + + phx_obj.display_name = _data.Name or "unnamed_annual_heat_pump" phx_obj.params.annual_COP = _data.PH_Parameters.AnnualCOP phx_obj.params.total_system_perf_ratio = ( _data.PH_Parameters.TotalSystemPerformanceRatioHeatGenerator ) + print(">>>", phx_obj.display_name, phx_obj.usage_profile) + print("-") return phx_obj def _PhxDevice_HeatPump_RatedMonthly(_data: wufi_xml.Device) -> PhxHeatPumpMonthly: phx_obj = PhxHeatPumpMonthly() + if not _data.PH_Parameters: return phx_obj + phx_obj.display_name = _data.Name or "unnamed_monthly_heat_pump" phx_obj.params.COP_1 = _data.PH_Parameters.RatedCOP1 phx_obj.params.COP_2 = _data.PH_Parameters.RatedCOP2 phx_obj.params.ambient_temp_1 = _data.PH_Parameters.AmbientTemperature1 phx_obj.params.ambient_temp_2 = _data.PH_Parameters.AmbientTemperature2 + return phx_obj def _PhxDevice_HeatPump_HotWater(_data: wufi_xml.Device) -> PhxHeatPumpHotWater: phx_obj = PhxHeatPumpHotWater() + if not _data.PH_Parameters: return phx_obj - + + phx_obj.display_name = _data.Name or "unnamed_hot_water_heat_pump" phx_obj.params.annual_COP = _data.PH_Parameters.AnnualCOP phx_obj.params.annual_system_perf_ratio = ( _data.PH_Parameters.TotalSystemPerformanceRatioHeatGenerator @@ -1556,8 +1584,9 @@ def _PhxDevice_WaterStorage(_data: wufi_xml.Device) -> PhxHotWaterTank: if not _data.PH_Parameters: return phx_obj + phx_obj.display_name = _data.Name or "unnamed_hot_water_tank" phx_obj.quantity = _data.PH_Parameters.QauntityWS - phx_obj.params.display_name = _data.Name + phx_obj.params.display_name = _data.Name or "unnamed_hot_water_tank" phx_obj.params.input_option = hvac_enums.PhxHotWaterInputOptions( _data.PH_Parameters.InputOption ) @@ -1577,6 +1606,7 @@ def _PhxDevice_Photovoltaic(_data: wufi_xml.Device) -> PhxDevicePhotovoltaic: if not _data.PH_Parameters: return phx_obj + phx_obj.display_name = _data.Name or "unnamed_photovoltaic" phx_obj.params.location_type = _data.PH_Parameters.SelectionLocation phx_obj.params.onsite_utilization_type = ( _data.PH_Parameters.SelectionOnSiteUtilization @@ -1598,13 +1628,22 @@ def _PhxDevice_Photovoltaic(_data: wufi_xml.Device) -> PhxDevicePhotovoltaic: def _PhxUsageProfile(_data: wufi_xml.Device) -> PhxUsageProfile: new_phx_profile = PhxUsageProfile() + + if _data.Heating_Parameters: + new_phx_profile.space_heating_percent =_data.Heating_Parameters.CoverageWithinSystem or 0.0 - new_phx_profile.space_heating =_data.UsedFor_Heating - new_phx_profile.dhw_heating = _data.UsedFor_DHW - new_phx_profile.cooling = _data.UsedFor_Cooling - new_phx_profile.ventilation =_data.UsedFor_Ventilation - new_phx_profile.humidification =_data.UsedFor_Humidification - new_phx_profile.dehumidification =_data.UsedFor_Dehumidification + if _data.Cooling_Parameters: + new_phx_profile.cooling_percent = _data.Cooling_Parameters.CoverageWithinSystem or 0.0 + + if _data.DHW_Parameters: + new_phx_profile.dhw_heating_percent = _data.DHW_Parameters.CoverageWithinSystem or 0.0 + + if _data.Ventilation_Parameters: + new_phx_profile.ventilation_percent =_data.Ventilation_Parameters.CoverageWithinSystem or 0.0 + + # new_phx_profile.humidification_percent =_data.UsedFor_Humidification + + # new_phx_profile.dehumidification_percent =_data.UsedFor_Dehumidification return new_phx_profile diff --git a/PHX/from_WUFI_XML/wufi_file_schema.py b/PHX/from_WUFI_XML/wufi_file_schema.py index 2e52081..a45ef82 100644 --- a/PHX/from_WUFI_XML/wufi_file_schema.py +++ b/PHX/from_WUFI_XML/wufi_file_schema.py @@ -599,6 +599,18 @@ class Heating_Parameters(BaseModel): _unpack_xml_tag_name = validator("*", allow_reuse=True, pre=True)(unpack_xml_tag) +class Cooling_Parameters(BaseModel): + CoverageWithinSystem: Optional[unit._Percentage] + + _unpack_xml_tag_name = validator("*", allow_reuse=True, pre=True)(unpack_xml_tag) + + +class Ventilation_Parameters(BaseModel): + CoverageWithinSystem: Optional[unit._Percentage] + + _unpack_xml_tag_name = validator("*", allow_reuse=True, pre=True)(unpack_xml_tag) + + class Device(BaseModel): Name: Optional[str] IdentNr: int @@ -615,6 +627,8 @@ class Device(BaseModel): PH_Parameters: Optional[PH_Parameters] DHW_Parameters: Optional[DHW_Parameters] Heating_Parameters: Optional[Heating_Parameters] + Cooling_Parameters: Optional[Cooling_Parameters] + Ventilation_Parameters: Optional[Ventilation_Parameters] HeatRecovery: Optional[unit._Percentage] MoistureRecovery: Optional[unit._Percentage] diff --git a/PHX/model/hvac/_base.py b/PHX/model/hvac/_base.py index dd7f610..c676949 100644 --- a/PHX/model/hvac/_base.py +++ b/PHX/model/hvac/_base.py @@ -6,6 +6,7 @@ from __future__ import annotations from inspect import signature from dataclasses import dataclass, field +import math from typing import Optional, ClassVar, Union, Any import uuid @@ -16,21 +17,94 @@ class PhxUsageProfile: """Is the device used to provide...""" - space_heating: bool = False - dhw_heating: bool = False - cooling: bool = False - ventilation: bool = False - humidification: bool = False - dehumidification: bool = False + # -- Percent of total energy demand covered by this device + space_heating_percent: float = 0.0 + dhw_heating_percent: float = 0.0 + cooling_percent: float = 0.0 + ventilation_percent: float = 0.0 + humidification_percent: float = 0.0 + dehumidification_percent: float = 0.0 + + @property + def space_heating(self) -> bool: + """True if the device used to provide space heating.""" + return not math.isclose(self.space_heating_percent, 0) + + @space_heating.setter + def space_heating(self, _in: bool) -> None: + if _in and self.space_heating_percent == 0: + self.space_heating_percent = 1.0 + elif _in == False: + self.space_heating_percent = 0.0 + + @property + def dhw_heating(self) -> bool: + """True if the device used to provide domestic hot water heating.""" + return not math.isclose(self.dhw_heating_percent, 0) + + @dhw_heating.setter + def dhw_heating(self, _in: bool) -> None: + if _in and self.dhw_heating_percent == 0: + self.dhw_heating_percent = 1.0 + elif _in == False: + self.dhw_heating_percent = 0.0 + + @property + def cooling(self) -> bool: + """True if the device used to provide cooling.""" + return not math.isclose(self.cooling_percent, 0) + + @cooling.setter + def cooling(self, _in: bool) -> None: + if _in and self.cooling_percent == 0: + self.cooling_percent = 1.0 + elif _in == False: + self.cooling_percent = 0.0 + + @property + def ventilation(self) -> bool: + """True if the device used to provide ventilation.""" + return not math.isclose(self.ventilation_percent, 0) + + @ventilation.setter + def ventilation(self, _in: bool) -> None: + if _in and self.ventilation_percent == 0: + self.ventilation_percent = 1.0 + elif _in == False: + self.ventilation_percent = 0.0 + + @property + def humidification(self) -> bool: + """True if the device used to provide humidification.""" + return not math.isclose(self.humidification_percent, 0) + + @humidification.setter + def humidification(self, _in: bool) -> None: + if _in and self.humidification_percent == 0: + self.humidification_percent = 1.0 + elif _in == False: + self.humidification_percent = 0.0 + + @property + def dehumidification(self) -> bool: + """True if the device used to provide dehumidification.""" + return not math.isclose(self.dehumidification_percent, 0) + + @dehumidification.setter + def dehumidification(self, _in: bool) -> None: + if _in and self.dehumidification_percent == 0: + self.dehumidification_percent = 1.0 + elif _in == False: + self.dehumidification_percent = 0.0 def __add__(self, other: PhxUsageProfile) -> PhxUsageProfile: obj = self.__class__() - obj.space_heating = any((self.space_heating, other.space_heating)) - obj.dhw_heating = any((self.dhw_heating, other.dhw_heating)) - obj.cooling = any((self.cooling, other.cooling)) - obj.ventilation = any((self.ventilation, other.ventilation)) - obj.humidification = any((self.humidification, other.humidification)) - obj.dehumidification = any((self.dehumidification, other.dehumidification)) + obj.space_heating_percent = self.space_heating_percent + other.space_heating_percent + obj.dhw_heating_percent = self.dhw_heating_percent + other.dhw_heating_percent + obj.cooling_percent = self.cooling_percent + other.cooling_percent + obj.ventilation_percent = self.ventilation_percent + other.ventilation_percent + obj.humidification_percent = self.humidification_percent + other.humidification_percent + obj.dehumidification_percent = self.dehumidification_percent + other.dehumidification_percent return obj diff --git a/PHX/model/hvac/_diagram.drawio b/PHX/model/hvac/_diagram.drawio index e69de29..405e948 100644 --- a/PHX/model/hvac/_diagram.drawio +++ b/PHX/model/hvac/_diagram.drawio @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PHX/model/hvac/collection.py b/PHX/model/hvac/collection.py index b0c2d0a..e884c9e 100644 --- a/PHX/model/hvac/collection.py +++ b/PHX/model/hvac/collection.py @@ -14,6 +14,9 @@ from PHX.model.enums.hvac import DeviceType, PhxSupportiveDeviceType from PHX.model.hvac.heating import AnyPhxHeater from PHX.model.hvac.heat_pumps import AnyPhxHeatPump +from PHX.model.hvac.piping import PhxRecirculationParameters +from PHX.model.hvac.renewable_devices import AnyRenewableDevice, PhxDevicePhotovoltaic +from PHX.model.hvac.supportive_devices import PhxSupportiveDevice from PHX.model.hvac.ventilation import ( AnyPhxVentilation, AnyPhxExhaustVent, @@ -22,9 +25,6 @@ PhxExhaustVentilatorUserDefined, ) from PHX.model.hvac.water import AnyWaterTank -from PHX.model.hvac.piping import PhxRecirculationParameters -from PHX.model.hvac.supportive_devices import PhxSupportiveDevice -from PHX.model.hvac.renewable_devices import AnyRenewableDevice, PhxDevicePhotovoltaic # ------------------------------------------------------------------------------ diff --git a/PHX/model/project.py b/PHX/model/project.py index 6329c90..9a90a1f 100644 --- a/PHX/model/project.py +++ b/PHX/model/project.py @@ -40,14 +40,39 @@ class PhxVariant: phius_cert: PhxPhiusCertification = field(default_factory=PhxPhiusCertification) phi_cert: PhxPhiCertification = field(default_factory=PhxPhiCertification) site: PhxSite = field(default_factory=PhxSite) - mech_systems: PhxMechanicalSystemCollection = field( - default_factory=PhxMechanicalSystemCollection + # mech_systems: PhxMechanicalSystemCollection = field( + # default_factory=PhxMechanicalSystemCollection + # ) + # -- Allow for multiple mechanical 'collections' in a variant + # -- If WUFI, these are called 'systems', but they also use + # -- the word 'system' in other places. So to avoid confusion, lets + # -- call them 'collections' here + _mech_collections: List[PhxMechanicalSystemCollection] = field( + default_factory=list ) def __post_init__(self) -> None: self.__class__._count += 1 self.id_num = self.__class__._count + # -- Always Add a default mech-collection + self._mech_collections.append(PhxMechanicalSystemCollection()) + + @property + def mech_systems(self) -> PhxMechanicalSystemCollection: + """Return the Default Mechanical System Collection for the variant. + + This is a facade to allow for backwards compatibility as well. + """ + print("Warning: You should be using the 'mech_collections' property "\ + "to access PHX mechanical devices instead of 'mech_systems'.") + return self._mech_collections[0] + + @property + def mech_collections(self) -> List[PhxMechanicalSystemCollection]: + """Return the list of Mechanical System Collections for the variant.""" + return self._mech_collections + @property def graphics3D(self): """Collects all of the geometry (Polygons, Vertices) in the Project.""" @@ -90,6 +115,13 @@ def get_total_roof_aperture_area(self) -> float: """Returns the total window area of the variant.building""" return self.building.get_total_roof_aperture_area() + def add_mechanical_collection(self, _mech_collection: PhxMechanicalSystemCollection) -> None: + """Add a new mechanical collection to the variant.""" + self._mech_collections.append(_mech_collection) + + def clear_mechanical_collections(self) -> None: + """Clear all mechanical collections from the variant.""" + self._mech_collections = [] @dataclass class ProjectData_Agent: diff --git a/PHX/to_WUFI_XML/xml_schemas.py b/PHX/to_WUFI_XML/xml_schemas.py index bb24e84..567e157 100644 --- a/PHX/to_WUFI_XML/xml_schemas.py +++ b/PHX/to_WUFI_XML/xml_schemas.py @@ -3,7 +3,7 @@ """Conversion Schemas for how to write PH/HB objects to WUFI XML""" -from typing import List, Optional, Any, TypeVar +from typing import List, Optional, Any, TypeVar, Dict import sys from functools import reduce @@ -117,9 +117,18 @@ def _PhxVariant(_variant: project.PhxVariant) -> List[xml_writable]: XML_Object("Building", _variant.building), XML_Object("ClimateLocation", _variant.site), XML_Object("PassivehouseData", _variant.phius_cert), - XML_Object( - "HVAC", _variant.mech_systems, _schema_name="_PhxMechanicalSystemCollection" - ), + XML_Object("HVAC", _variant._mech_collections, _schema_name="_Systems"), + ] + + +def _Systems(_collections: List[hvac.PhxMechanicalSystemCollection]) -> List[xml_writable]: + return [ + XML_List("Systems", + [ + XML_Object("System", collection, "index", i, _schema_name="_PhxMechanicalSystemCollection") + for i, collection in enumerate(_collections) + ] + ) ] @@ -1161,12 +1170,17 @@ def _DeviceHeaterDistrictDeviceParams( def _PhxDeviceHeaterHeatPump(_d: hvac.PhxHeatPumpDevice) -> List[xml_writable]: - param_schemas = { - hvac.PhxHeatPumpAnnualParams.hp_type.value: "_DeviceHeaterHeatPumpPhParamsAnnual", - hvac.PhxHeatPumpMonthlyParams.hp_type.value: "_DeviceHeaterHeatPumpPhParamsMonthly", - hvac.PhxHeatPumpHotWaterParams.hp_type.value: "_DeviceHeaterHeatPumpPhParamsHotWater", - hvac.PhxHeatPumpCombinedParams.hp_type.value: "_DeviceHeaterHeatPumpPhParamsCombined", + param_schemas: Dict[hvac.HeatPumpType, str] = { + hvac.PhxHeatPumpAnnualParams.hp_type: "_DeviceHeaterHeatPumpPhParamsAnnual", + hvac.PhxHeatPumpMonthlyParams.hp_type: "_DeviceHeaterHeatPumpPhParamsMonthly", + hvac.PhxHeatPumpHotWaterParams.hp_type: "_DeviceHeaterHeatPumpPhParamsHotWater", + hvac.PhxHeatPumpCombinedParams.hp_type: "_DeviceHeaterHeatPumpPhParamsCombined", } + + hp_type: Optional[hvac.HeatPumpType] = getattr(_d.params, "hp_type", None) + if not hp_type: + return [] + return [ XML_Node("Name", _d.display_name), XML_Node("IdentNr", _d.id_num), @@ -1178,16 +1192,15 @@ def _PhxDeviceHeaterHeatPump(_d: hvac.PhxHeatPumpDevice) -> List[xml_writable]: XML_Node("UsedFor_Ventilation", _d.usage_profile.ventilation), XML_Node("UsedFor_Humidification", _d.usage_profile.humidification), XML_Node("UsedFor_Dehumidification", _d.usage_profile.dehumidification), + XML_Object("PH_Parameters", _d.params, _schema_name=param_schemas[hp_type]), XML_Object( - "PH_Parameters", - _d.params, - _schema_name=param_schemas[_d.params.hp_type.value], + "DHW_Parameters", _d, _schema_name="_DeviceHotWaterHeatPumpDeviceParams" ), XML_Object( - "DHW_Parameters", _d, _schema_name="_DeviceHeaterHeatPumpDeviceParams" + "Heating_Parameters", _d, _schema_name="_DeviceHeaterHeatPumpDeviceParams" ), XML_Object( - "Heating_Parameters", _d, _schema_name="_DeviceHeaterHeatPumpDeviceParams" + "Cooling_Parameters", _d, _schema_name="_DeviceCoolingHeatPumpDeviceParams" ), ] @@ -1245,9 +1258,24 @@ def _DeviceHeaterHeatPumpPhParamsCombined( ] +def _DeviceHotWaterHeatPumpDeviceParams(_d: hvac.PhxHeatPumpDevice) -> List[xml_writable]: + return [ + XML_Node("CoverageWithinSystem", _d.usage_profile.dhw_heating_percent), + XML_Node("Unit", _d.unit), + XML_Node("Selection", 1), + ] + def _DeviceHeaterHeatPumpDeviceParams(_d: hvac.PhxHeatPumpDevice) -> List[xml_writable]: return [ - XML_Node("CoverageWithinSystem", _d.percent_coverage), + XML_Node("CoverageWithinSystem", _d.usage_profile.space_heating_percent), + XML_Node("Unit", _d.unit), + XML_Node("Selection", 1), + ] + + +def _DeviceCoolingHeatPumpDeviceParams(_d: hvac.PhxHeatPumpDevice) -> List[xml_writable]: + return [ + XML_Node("CoverageWithinSystem", _d.usage_profile.cooling_percent), XML_Node("Unit", _d.unit), XML_Node("Selection", 1), ] @@ -1559,7 +1587,7 @@ def _PhxZoneCoverage(_zc: hvac.PhxZoneCoverage) -> List[xml_writable]: ] -def _PhxMechanicalDevices( +def _PhxMechanicalSystemCollection( _hvac_collection: hvac.PhxMechanicalSystemCollection, ) -> List[xml_writable]: devices = { @@ -1572,7 +1600,7 @@ def _PhxMechanicalDevices( hvac.DeviceType.PHOTOVOLTAIC: "_PhxDevicePhotovoltaic", } - wufi_devices = [] + wufi_devices: List[hvac.AnyMechDevice] = [] wufi_devices.extend(_hvac_collection.devices) wufi_devices.extend(_hvac_collection.renewable_devices) return [ @@ -1599,20 +1627,6 @@ def _PhxMechanicalDevices( ] -def _PhxMechanicalSystemCollection( - _hvac: hvac.PhxMechanicalSystemCollection, -) -> List[xml_writable]: - return [ - XML_List( - "Systems", - [ - XML_Object("System", n, "index", i, _schema_name="_PhxMechanicalDevices") - for i, n in enumerate([_hvac]) - ], - ), - ] - - # -- ELEC. EQUIPMENT DEVICES -------------------------------------------------- diff --git a/_testing_WUFI_to_PHX.py b/_testing_WUFI_to_PHX.py index 32bb7d1..ec8b91e 100644 --- a/_testing_WUFI_to_PHX.py +++ b/_testing_WUFI_to_PHX.py @@ -14,7 +14,7 @@ SOURCE_DIR = pathlib.Path("tests", "_reference_xml") SOURCE_FILE_NAMES = [ - "Arverne_D_231102.xml", + "test_multiple_cooling_2_systems.xml", ] TARGET_DIR = pathlib.Path("tests", "_regenerated_xml") @@ -25,15 +25,16 @@ # ---------------------------------------------------------------- # -- 1) Read in the WUFI-XML File as a new Pydantic Model - print(f"[green bold]> Reading in the file: {xm_source_file}[/green bold]") + print(f"[green bold]> Reading in data from XML-File: {xm_source_file}[/green bold]") wufi_xml_data = get_WUFI_XML_file_as_dict(xm_source_file) wufi_xml_model = WUFIplusProject.parse_obj(wufi_xml_data) # ---------------------------------------------------------------- # -- 2) Convert the Pydantic WUFI model over to a PHX model - print(f"[green bold]> Converting XML file to PHX Model[/green bold]") + print(f"[green bold]> Converting XML-data to a PHX-Model[/green bold]") phx_project = convert_WUFI_XML_to_PHX_project(wufi_xml_model) + # ---------------------------------------------------------------- # -- 3) Output the PHX model back to a WUFI-XML target_file = TARGET_DIR / xm_source_file_name diff --git a/tests/test_model/test_hvac/test_base.py b/tests/test_model/test_hvac/test_base.py index 364f1bc..87bcdff 100644 --- a/tests/test_model/test_hvac/test_base.py +++ b/tests/test_model/test_hvac/test_base.py @@ -3,8 +3,8 @@ def test_PhxUsageProfile_add(reset_class_counters): - use_1 = _base.PhxUsageProfile(False, False, False, True, True, False) - use_2 = _base.PhxUsageProfile(False, False, True, True, False, False) + use_1 = _base.PhxUsageProfile(0, 0, 0, 1.0, 1.0, 0) + use_2 = _base.PhxUsageProfile(0, 0, 1.0, 1.0, 0, 0) use_3 = use_1 + use_2 assert use_3 != use_2 != use_1 diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpAnnual.py b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpAnnual.py index 712ae25..4b38347 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpAnnual.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpAnnual.py @@ -5,7 +5,7 @@ def test_default_PhxHeaterHeatPumpAnnual_with_no_cooling(reset_class_counters): h1 = heat_pumps.PhxHeatPumpAnnual() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 # -- Set all the cooling 'off' h1.params_cooling.ventilation.used = False @@ -17,8 +17,6 @@ def test_default_PhxHeaterHeatPumpAnnual_with_no_cooling(reset_class_counters): coll.add_new_mech_device(h1.identifier, h1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -58,10 +56,15 @@ def test_default_PhxHeaterHeatPumpAnnual_with_no_cooling(reset_class_counters): "1", "", "", - "0.0", + "1.0", "0.0", "1", "", + "", + "0.0", + "0.0", + "1", + "", "", "", "", @@ -89,15 +92,13 @@ def test_default_PhxHeaterHeatPumpAnnual_with_no_cooling(reset_class_counters): "true", '', "", - "", - "", ] def test_default_PhxHeaterHeatPumpAnnual_with_single_recirc_cooling(reset_class_counters): h1 = heat_pumps.PhxHeatPumpAnnual() - h1.usage_profile.space_heating = True - h1.usage_profile.cooling = True + h1.usage_profile.space_heating_percent = 1.0 + h1.usage_profile.cooling_percent = 1.0 # -- Turn on only the Recirculation cooling h1.params_cooling.ventilation.used = False @@ -111,8 +112,6 @@ def test_default_PhxHeaterHeatPumpAnnual_with_single_recirc_cooling(reset_class_ # -- Check the result result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', 'Ideal Air System', '1', '1', @@ -152,10 +151,15 @@ def test_default_PhxHeaterHeatPumpAnnual_with_single_recirc_cooling(reset_class_ '1', '', '', - '0.0', + '1.0', '0.0', '1', '', + "", + "1.0", + "0.0", + "1", + "", '', '', '', @@ -191,6 +195,4 @@ def test_default_PhxHeaterHeatPumpAnnual_with_single_recirc_cooling(reset_class_ 'true', '', '', - '', - '', ] \ No newline at end of file diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpCombined.py b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpCombined.py index 85cdbef..0a3fa75 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpCombined.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpCombined.py @@ -5,13 +5,11 @@ def test_default_PhxHeaterHeatPumpCombined(reset_class_counters): h1 = heat_pumps.PhxHeatPumpCombined() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 coll = collection.PhxMechanicalSystemCollection() coll.add_new_mech_device(h1.identifier, h1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -49,10 +47,15 @@ def test_default_PhxHeaterHeatPumpCombined(reset_class_counters): "1", "", "", + "1.0", + "0.0", + "1", + "", + "", "0.0", "0.0", "1", - "", + "", "", "", "", @@ -80,6 +83,4 @@ def test_default_PhxHeaterHeatPumpCombined(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpHotWater.py b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpHotWater.py index 47cd074..73a7f43 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpHotWater.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpHotWater.py @@ -5,13 +5,11 @@ def test_default_PhxHeaterHeatPumpHotWater(reset_class_counters): h1 = heat_pumps.PhxHeatPumpHotWater() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 coll = collection.PhxMechanicalSystemCollection() coll.add_new_mech_device(h1.identifier, h1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -52,10 +50,15 @@ def test_default_PhxHeaterHeatPumpHotWater(reset_class_counters): "1", "", "", - "0.0", + "1.0", "0.0", "1", "", + "", + "0.0", + "0.0", + "1", + "", "", "", "", @@ -83,6 +86,4 @@ def test_default_PhxHeaterHeatPumpHotWater(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpMonthly.py b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpMonthly.py index f5f4828..c938777 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpMonthly.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heat_pumps/test_PhxHeaterHeatPumpMonthly.py @@ -5,13 +5,11 @@ def test_default_PhxHeaterHeatPumpMonthly(reset_class_counters): h1 = heat_pumps.PhxHeatPumpMonthly() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 coll = collection.PhxMechanicalSystemCollection() coll.add_new_mech_device(h1.identifier, h1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -53,10 +51,15 @@ def test_default_PhxHeaterHeatPumpMonthly(reset_class_counters): "1", "", "", - "0.0", + "1.0", "0.0", "1", "", + '', + '0.0', + '0.0', + '1', + '', "", "", "", @@ -84,6 +87,4 @@ def test_default_PhxHeaterHeatPumpMonthly(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerFossil.py b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerFossil.py index cf9dbac..db71138 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerFossil.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerFossil.py @@ -5,7 +5,7 @@ def test_default_PhxHeaterBoilerFossil(reset_class_counters): h1 = heating.PhxHeaterBoilerFossil() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 assert h1.usage_profile.cooling == False coll = collection.PhxMechanicalSystemCollection() @@ -16,8 +16,6 @@ def test_default_PhxHeaterBoilerFossil(reset_class_counters): result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -96,6 +94,4 @@ def test_default_PhxHeaterBoilerFossil(reset_class_counters): "true", '', "", - "", - "", ] \ No newline at end of file diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerWood.py b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerWood.py index 10d7e3b..d7e36d4 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerWood.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterBoilerWood.py @@ -5,13 +5,11 @@ def test_default_PhxHeaterBoilerWood(reset_class_counters): h1 = heating.PhxHeaterBoilerWood() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 coll = collection.PhxMechanicalSystemCollection() coll.add_new_mech_device(h1.identifier, h1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -93,6 +91,4 @@ def test_default_PhxHeaterBoilerWood(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterDistrictHeat.py b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterDistrictHeat.py index c3fe41f..a7f7ad8 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterDistrictHeat.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterDistrictHeat.py @@ -5,13 +5,11 @@ def test_default_PhxHeaterDistrictHeat(reset_class_counters): h1 = heating.PhxHeaterDistrictHeat() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 coll = collection.PhxMechanicalSystemCollection() coll.add_new_mech_device(h1.identifier, h1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -74,6 +72,4 @@ def test_default_PhxHeaterDistrictHeat(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterElectric.py b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterElectric.py index 39c4b84..81535ce 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterElectric.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_heating/test_PhxHeaterElectric.py @@ -5,13 +5,11 @@ def test_default_PhxHeaterElectric(reset_class_counters): h1 = heating.PhxHeaterElectric() - h1.usage_profile.space_heating = True + h1.usage_profile.space_heating_percent = 1.0 coll = collection.PhxMechanicalSystemCollection() coll.add_new_mech_device(h1.identifier, h1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -79,6 +77,4 @@ def test_default_PhxHeaterElectric(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_renewable_equip/test_PhxDevicePhotovoltaic.py b/tests/test_to_WUFI_xml/test_hvac/test_renewable_equip/test_PhxDevicePhotovoltaic.py index fa15b4d..9362906 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_renewable_equip/test_PhxDevicePhotovoltaic.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_renewable_equip/test_PhxDevicePhotovoltaic.py @@ -10,8 +10,6 @@ def test_default_PhxDevicePhotovoltaic(reset_class_counters): coll.add_new_mech_device(p1.identifier, p1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -75,6 +73,4 @@ def test_default_PhxDevicePhotovoltaic(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_ventilation/test_PhxVentilator.py b/tests/test_to_WUFI_xml/test_hvac/test_ventilation/test_PhxVentilator.py index 91cafa2..bbfcab8 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_ventilation/test_PhxVentilator.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_ventilation/test_PhxVentilator.py @@ -18,8 +18,6 @@ def test_default_PhxRoomVentilation(reset_class_counters): coll.add_new_mech_device(v1.identifier, v1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -86,6 +84,4 @@ def test_default_PhxRoomVentilation(reset_class_counters): "true", '', "", - "", - "", ] diff --git a/tests/test_to_WUFI_xml/test_hvac/test_water/test_PhxHotWaterTank.py b/tests/test_to_WUFI_xml/test_hvac/test_water/test_PhxHotWaterTank.py index e553e64..83fa20f 100644 --- a/tests/test_to_WUFI_xml/test_hvac/test_water/test_PhxHotWaterTank.py +++ b/tests/test_to_WUFI_xml/test_hvac/test_water/test_PhxHotWaterTank.py @@ -9,8 +9,6 @@ def test_default_PhxHotWaterTank(reset_class_counters): coll.add_new_mech_device(t1.identifier, t1) result = generate_WUFI_XML_from_object(coll, _header="") assert xml_string_to_list(result) == [ - '', - '', "Ideal Air System", '1', "1", @@ -76,6 +74,4 @@ def test_default_PhxHotWaterTank(reset_class_counters): "true", '', "", - "", - "", ]