Skip to content

Commit

Permalink
Merge pull request #1901 from NREL/update_measure
Browse files Browse the repository at this point in the history
Fix BuildResidentialHPXML docs links, take 2
  • Loading branch information
shorowit authored Dec 20, 2024
2 parents d53251a + 0d18829 commit 34fce41
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
12 changes: 9 additions & 3 deletions BuildResidentialHPXML/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>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>32bd49ca-09dc-40ec-b676-f01d76e98566</version_id>
<version_modified>2024-12-09T21:40:28Z</version_modified>
<version_id>df4fe828-a827-4cc2-8a4d-9c8daf649202</version_id>
<version_modified>2024-12-20T20:07:27Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -7558,11 +7558,17 @@
<usage_type>resource</usage_type>
<checksum>425682E4</checksum>
</file>
<file>
<filename>version.txt</filename>
<filetype>txt</filetype>
<usage_type>resource</usage_type>
<checksum>93016553</checksum>
</file>
<file>
<filename>test_build_residential_hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>CCBB49E7</checksum>
<checksum>71348C9A</checksum>
</file>
</files>
</measure>
1 change: 1 addition & 0 deletions BuildResidentialHPXML/resources/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
237a7a19483db8aae3195ccffb40336c
16 changes: 0 additions & 16 deletions BuildResidentialHPXML/tests/test_build_residential_hpxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,22 +386,6 @@ def test_workflows
assert_equal(31, hvac_control.seasons_cooling_end_day)
end

def test_version
found_match = false
measure_xml_path = File.join(File.dirname(__FILE__), '..', 'measure.xml')
File.readlines(measure_xml_path).each do |xml_line|
next unless xml_line.include? '<description>'
next unless xml_line.include? 'https://openstudio-hpxml.readthedocs.io'

found_match = true
if not xml_line.include? Version::OS_HPXML_Version
puts "ERROR: Found incorrect OS-HPXML version. Manually edit the BuildResidentialHPXML/measure.rb and run 'openstudio tasks.rb update_measures' to force the measure.xml to be regenerated."
end
assert(xml_line.include? Version::OS_HPXML_Version)
end
assert(found_match)
end

private

def _set_measure_argument_values(hpxml_file, args)
Expand Down
4 changes: 2 additions & 2 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>771dde81-1742-4c4a-90f5-ca41ad0afad4</version_id>
<version_modified>2024-12-20T19:16:39Z</version_modified>
<version_id>f5059b5f-8030-497a-bab2-94f90354de7e</version_id>
<version_modified>2024-12-20T20:07:28Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down
8 changes: 8 additions & 0 deletions tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,14 @@ def display_usage(command_list)
puts 'Applying rubocop auto-correct to measures...'
system(command)

# Update a BuildResidentialHPXML/resources file when the OS-HPXML version changes.
# This will ensure that the BuildResidentialHPXML measure.xml is appropriately updated.
# Without this, the BuildResidentialHPXML measure has no differences and so OpenStudio
# would skip updating it.
version_rb_path = File.join(File.dirname(__FILE__), 'HPXMLtoOpenStudio/resources/version.rb')
version_txt_path = File.join(File.dirname(__FILE__), 'BuildResidentialHPXML/resources/version.txt')
File.write(version_txt_path, Digest::MD5.file(version_rb_path).hexdigest)

# Update measures XMLs
puts 'Updating measure.xmls...'
Dir['**/measure.xml'].each do |measure_xml|
Expand Down

0 comments on commit 34fce41

Please sign in to comment.