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 76ba0c2879..899a56c78a 100644 --- a/HPXMLtoOpenStudio/measure.xml +++ b/HPXMLtoOpenStudio/measure.xml @@ -3,8 +3,8 @@ 3.1 hpxm_lto_openstudio b1543b30-9465-45ff-ba04-1d1f85e763bc - 0b0fdd93-375d-48a7-94c7-141c1253acfc - 2023-11-14T04:26:24Z + ff727cab-96e5-480f-a9a7-78c64755662f + 2023-11-15T00:52:51Z D8922A73 HPXMLtoOpenStudio HPXML to OpenStudio Translator @@ -222,18 +222,6 @@ resource 63C6A1E2 - - data/g_functions/README.md - md - resource - 3A6546AB - - - data/g_functions/rectangle_5m_v1.0.json - json - resource - 25FFB6A8 - data/unavailable_periods.csv csv 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 1cdffb28e9..64e8575308 100644 --- a/ReportUtilityBills/measure.rb +++ b/ReportUtilityBills/measure.rb @@ -237,10 +237,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 7e37109635..2f5cff8ec0 100644 --- a/ReportUtilityBills/measure.xml +++ b/ReportUtilityBills/measure.xml @@ -3,8 +3,8 @@ 3.1 report_utility_bills ca88a425-e59a-4bc4-af51-c7e7d1e960fe - 35c428ae-4beb-465f-ba07-e521f7bf46a7 - 2023-11-13T18:23:41Z + 00195856-fc00-4476-b601-ab53286b33cf + 2023-11-17T15:16:06Z 15BF4E57 ReportUtilityBills Utility Bills Report @@ -142,7 +142,7 @@ measure.rb rb script - 9F95708E + 4A038500 detailed_rates/Sample Flat Rate Min Annual Charge.json @@ -322,7 +322,7 @@ test_report_utility_bills.rb rb test - C1365144 + 07F2D0DB diff --git a/ReportUtilityBills/tests/test_report_utility_bills.rb b/ReportUtilityBills/tests/test_report_utility_bills.rb index 7b64b6363a..ee375ad525 100644 --- a/ReportUtilityBills/tests/test_report_utility_bills.rb +++ b/ReportUtilityBills/tests/test_report_utility_bills.rb @@ -1211,7 +1211,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) @@ -1220,15 +1221,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.'