Skip to content

Commit

Permalink
Don't write Building/Site element when not needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
shorowit committed Oct 31, 2023
1 parent b159db6 commit 11c321e
Show file tree
Hide file tree
Showing 31 changed files with 10 additions and 97 deletions.
6 changes: 3 additions & 3 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>e3c3d6b8-7931-4e31-a544-f4b168b10038</version_id>
<version_modified>2023-10-31T23:17:38Z</version_modified>
<version_id>3393081e-a5f6-41fd-931a-a676f65fd3db</version_id>
<version_modified>2023-10-31T23:27:23Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -250,7 +250,7 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>B24BC928</checksum>
<checksum>C8079DF3</checksum>
</file>
<file>
<filename>hpxml_defaults.rb</filename>
Expand Down
14 changes: 7 additions & 7 deletions HPXMLtoOpenStudio/resources/hpxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1074,14 +1074,14 @@ def to_doc(doc)
building = XMLHelper.add_element(hpxml, 'Building')
building_building_id = XMLHelper.add_element(building, 'BuildingID')
XMLHelper.add_attribute(building_building_id, 'id', @building_id)
building_site = XMLHelper.add_element(building, 'Site')
building_site_id = XMLHelper.add_element(building_site, 'SiteID')
if @site_id.nil?
XMLHelper.add_attribute(building_site_id, 'id', 'SiteID')
else
XMLHelper.add_attribute(building_site_id, 'id', @site_id)
end
if (not @state_code.nil?) || (not @zip_code.nil?) || (not @time_zone_utc_offset.nil?) || (not @egrid_region.nil?) || (not @egrid_subregion.nil?) || (not @cambium_region_gea.nil?) || (not @dst_enabled.nil?) || (not @dst_begin_month.nil?) || (not @dst_begin_day.nil?) || (not @dst_end_month.nil?) || (not @dst_end_day.nil?)
building_site = XMLHelper.add_element(building, 'Site')
building_site_id = XMLHelper.add_element(building_site, 'SiteID')
if @site_id.nil?
XMLHelper.add_attribute(building_site_id, 'id', 'SiteID')
else
XMLHelper.add_attribute(building_site_id, 'id', @site_id)
end
if (not @state_code.nil?) || (not @zip_code.nil?)
address = XMLHelper.add_element(building_site, 'Address')
XMLHelper.add_element(address, 'StateCode', @state_code, :string, @state_code_isdefaulted) unless @state_code.nil?
Expand Down
3 changes: 0 additions & 3 deletions workflow/sample_files/base-location-capetown-zaf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/sample_files/base-misc-defaults.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/sample_files/base-residents-5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L100AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L100AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L110AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L110AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L120AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L120AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L130AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L130AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L140AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L140AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L150AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L150AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L155AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L155AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L160AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L160AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L170AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L170AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L200AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L200AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L202AC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L202AL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L302XC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L304XC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L322XC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down
3 changes: 0 additions & 3 deletions workflow/tests/ASHRAE_Standard_140/L324XC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</SoftwareInfo>
<Building>
<BuildingID id='MyBuilding'/>
<Site>
<SiteID id='SiteID'/>
</Site>
<ProjectStatus>
<EventType>proposed workscope</EventType>
</ProjectStatus>
Expand Down

0 comments on commit 11c321e

Please sign in to comment.