diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 72222884ea..f136f20ef6 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -11,7 +11,7 @@ jobs: run-unit-tests: runs-on: ubuntu-latest container: - image: docker://nrel/openstudio:3.7.0-rc1 + image: docker://nrel/openstudio:3.7.0-rc3 steps: - uses: actions/checkout@v3 with: @@ -63,7 +63,7 @@ jobs: run-workflow1-tests: runs-on: ubuntu-latest container: - image: docker://nrel/openstudio:3.7.0-rc1 + image: docker://nrel/openstudio:3.7.0-rc3 steps: - uses: actions/checkout@v3 with: @@ -86,7 +86,7 @@ jobs: run-workflow2-tests: runs-on: ubuntu-latest container: - image: docker://nrel/openstudio:3.7.0-rc1 + image: docker://nrel/openstudio:3.7.0-rc3 steps: - uses: actions/checkout@v3 with: @@ -115,8 +115,8 @@ jobs: - name: Install software and run test shell: pwsh run: | - $env:OS_VERSION="3.7.0-rc1" - $env:OS_SHA="211bb633b0" + $env:OS_VERSION="3.7.0-rc3" + $env:OS_SHA="37087fd612" Invoke-WebRequest -OutFile Windows.tar.gz -URI "https://github.com/NREL/OpenStudio/releases/download/v${env:OS_VERSION}/OpenStudio-${env:OS_VERSION}+${env:OS_SHA}-Windows.tar.gz" tar -xzf Windows.tar.gz & .\OpenStudio-${env:OS_VERSION}+${env:OS_SHA}-Windows\bin\openstudio.exe workflow\run_simulation.rb -x workflow\sample_files\base.xml --hourly ALL --add-component-loads --add-stochastic-schedules diff --git a/HPXMLtoOpenStudio/measure.xml b/HPXMLtoOpenStudio/measure.xml index d6d59e007b..399c302ab0 100644 --- a/HPXMLtoOpenStudio/measure.xml +++ b/HPXMLtoOpenStudio/measure.xml @@ -3,8 +3,8 @@ 3.1 hpxm_lto_openstudio b1543b30-9465-45ff-ba04-1d1f85e763bc - 7f9d8cf2-9144-41f2-ad54-55bd9c514cd2 - 2023-11-16T00:11:23Z + 98d9b3c1-f151-4160-8578-3c17162952ed + 2023-11-21T15:58:04Z D8922A73 HPXMLtoOpenStudio HPXML to OpenStudio Translator diff --git a/ReportSimulationOutput/measure.rb b/ReportSimulationOutput/measure.rb index 00bf462407..0efbc0ce7b 100644 --- a/ReportSimulationOutput/measure.rb +++ b/ReportSimulationOutput/measure.rb @@ -561,9 +561,8 @@ def run(runner, user_arguments) args[:use_dview_format] = false end - output_dir = File.dirname(runner.lastEpwFilePath.get.to_s) - hpxml_defaults_path = @model.getBuilding.additionalProperties.getFeatureAsString('hpxml_defaults_path').get + output_dir = File.dirname(hpxml_defaults_path) building_id = @model.getBuilding.additionalProperties.getFeatureAsString('building_id').get hpxml = HPXML.new(hpxml_path: hpxml_defaults_path, building_id: building_id) diff --git a/ReportSimulationOutput/measure.xml b/ReportSimulationOutput/measure.xml index 35f1983fda..9154fd44f3 100644 --- a/ReportSimulationOutput/measure.xml +++ b/ReportSimulationOutput/measure.xml @@ -3,8 +3,8 @@ 3.1 report_simulation_output df9d170c-c21a-4130-866d-0d46b06073fd - 24baa8d8-1e28-4b9b-a3fc-bea5adb1f3e7 - 2023-11-13T18:56:05Z + be0a8583-ee3d-4ba1-b96a-5670a43777ae + 2023-11-17T15:16:05Z 9BF1E6AC ReportSimulationOutput HPXML Simulation Output Report @@ -1929,7 +1929,7 @@ measure.rb rb script - 9820E474 + 86EC8E47 test_report_sim_output.rb diff --git a/ReportUtilityBills/measure.rb b/ReportUtilityBills/measure.rb index 060a092f93..01f2ab075a 100644 --- a/ReportUtilityBills/measure.rb +++ b/ReportUtilityBills/measure.rb @@ -241,10 +241,9 @@ def run(runner, user_arguments) args = get_arguments(runner, arguments(model), user_arguments) - output_dir = File.dirname(runner.lastEpwFilePath.get.to_s) - hpxml_path = @model.getBuilding.additionalProperties.getFeatureAsString('hpxml_path').get hpxml_defaults_path = @model.getBuilding.additionalProperties.getFeatureAsString('hpxml_defaults_path').get + output_dir = File.dirname(hpxml_defaults_path) building_id = @model.getBuilding.additionalProperties.getFeatureAsString('building_id').get hpxml = HPXML.new(hpxml_path: hpxml_defaults_path, building_id: building_id) diff --git a/ReportUtilityBills/measure.xml b/ReportUtilityBills/measure.xml index 486203fd63..d181368808 100644 --- a/ReportUtilityBills/measure.xml +++ b/ReportUtilityBills/measure.xml @@ -3,8 +3,8 @@ 3.1 report_utility_bills ca88a425-e59a-4bc4-af51-c7e7d1e960fe - 1f833719-ec58-490d-b8d3-5b7dd52078bc - 2023-11-16T00:15:18Z + c7c5cd30-3512-4635-a4b1-22b9026aa9ee + 2023-11-21T15:58:07Z 15BF4E57 ReportUtilityBills Utility Bills Report @@ -142,7 +142,7 @@ measure.rb rb script - 48E10965 + 4A5E67D2 detailed_rates/Sample Flat Rate Min Annual Charge.json @@ -322,7 +322,7 @@ test_report_utility_bills.rb rb test - D3C8A200 + EA22C7B4 diff --git a/ReportUtilityBills/tests/test_report_utility_bills.rb b/ReportUtilityBills/tests/test_report_utility_bills.rb index 78c6477ea0..b1a99ed299 100644 --- a/ReportUtilityBills/tests/test_report_utility_bills.rb +++ b/ReportUtilityBills/tests/test_report_utility_bills.rb @@ -1223,7 +1223,8 @@ def _test_measure(hpxml: nil, expected_errors: [], expected_warnings: []) # Run OSW command = "#{OpenStudio.getOpenStudioCLI} run -w #{osw_path}" - cli_output = `#{command}` + success = system(command) + assert(success) # Cleanup File.delete(osw_path) @@ -1232,15 +1233,12 @@ def _test_measure(hpxml: nil, expected_errors: [], expected_warnings: []) bills_monthly_csv = File.join(File.dirname(template_osw), 'run', 'results_bills_monthly.csv') # Check warnings/errors - if not expected_errors.empty? - expected_errors.each do |expected_error| - assert(cli_output.include?("ERROR] #{expected_error}")) - end + log_lines = File.readlines(File.join(File.dirname(template_osw), 'run', 'run.log')).map(&:strip) + expected_errors.each do |expected_error| + assert(log_lines.any? { |line| line.include?(' ERROR]') && line.include?(expected_error) }) end - if not expected_warnings.empty? - expected_warnings.each do |expected_warning| - assert(cli_output.include?("WARN] #{expected_warning}")) - end + expected_warnings.each do |expected_warning| + assert(log_lines.any? { |line| line.include?(' WARN]') && line.include?(expected_warning) }) end if !hpxml.nil? diff --git a/tasks.rb b/tasks.rb index f6bb9cb777..8eaa184e60 100644 --- a/tasks.rb +++ b/tasks.rb @@ -2559,47 +2559,11 @@ def display_usage(command_list) # Update measures XMLs puts 'Updating measure.xmls...' - require 'oga' Dir['**/measure.xml'].each do |measure_xml| - for n_attempt in 1..5 # For some reason CLI randomly generates errors, so try multiple times - measure_dir = File.dirname(measure_xml) - command = "#{OpenStudio.getOpenStudioCLI} measure -u '#{measure_dir}'" - system(command, [:out, :err] => File::NULL) - - # Check for error - xml_doc = XMLHelper.parse_file(measure_xml) - err_val = XMLHelper.get_value(xml_doc, '/measure/error', :string) - if err_val.nil? - err_val = XMLHelper.get_value(xml_doc, '/error', :string) - end - if err_val.nil? - break # Successfully updated - else - if n_attempt == 5 - fail "#{measure_xml}: #{err_val}" # Error generated all 5 times, fail - else - # Remove error from measure XML, try again - orig_lines = File.readlines(measure_xml) - new_lines = [] - inside_error = false - orig_lines.each do |l| - if l.include? '' - inside_error = true - end - if l.include? '' - inside_error = false - next - end - next if inside_error - - new_lines << l - end - File.open(measure_xml, 'w') do |file| - file.puts new_lines - end - end - end - end + measure_dir = File.dirname(measure_xml) + # Using classic to work around https://github.com/NREL/OpenStudio/issues/5045 + command = "#{OpenStudio.getOpenStudioCLI} classic measure -u '#{measure_dir}'" + system(command, [:out, :err] => File::NULL) end puts 'Done.'