From 1c689a7ad11cb030dacb616ffa9d990e958ad6f7 Mon Sep 17 00:00:00 2001 From: Wenyi Kuang Date: Wed, 6 Mar 2024 15:32:47 -0700 Subject: [PATCH 1/4] test JENKINS_HOME --- test/measure_tests.txt | 8 +------ test/resource_measure_tests.txt | 39 +-------------------------------- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/test/measure_tests.txt b/test/measure_tests.txt index ef8c5c937..d56a8b3e7 100644 --- a/test/measure_tests.txt +++ b/test/measure_tests.txt @@ -1,7 +1 @@ -measures/qoi_report/tests/qoi_report_test.rb -measures/simulation_settings_check/tests/measure_test.rb -measures/emissions_reporting/tests/EmissionsReporting_Test.rb -measures/TimeseriesCSVExport/tests/Measure_Test.rb -measures/comstock_sensitivity_reports/tests/comstock_sensitivity_reports_test.rb -measures/scout_loads_summary/tests/Measure_Test.rb -measures/la_100_qaqc/tests/measure_Test.rb +measures/qoi_report/tests/qoi_report_test.rb \ No newline at end of file diff --git a/test/resource_measure_tests.txt b/test/resource_measure_tests.txt index ded2de5f9..05e9c0f74 100644 --- a/test/resource_measure_tests.txt +++ b/test/resource_measure_tests.txt @@ -1,38 +1 @@ -resources/measures/upgrade_env_roof_insul_aedg/tests/env_roof_insul_aedg_test.rb -resources/measures/set_exterior_lighting_template/tests/measure_test.rb -resources/measures/set_wall_template/tests/measure_test.rb -resources/measures/upgrade_env_new_aedg_windows/tests/measure_test.rb -resources/measures/upgrade_env_new_aedg_windows/tests/env_new_aedg_windows_test.rb -resources/measures/create_bar_from_building_type_ratios/tests/create_bar_from_building_type_ratios_test.rb -resources/measures/set_roof_template/tests/measure_test.rb -resources/measures/upgrade_light_led/tests/light_led_test.rb -resources/measures/upgrade_hvac_add_heat_pump_rtu/tests/measure_test.rb -resources/measures/create_typical_building_from_model/tests/create_typical_building_from_model_test.rb -resources/measures/upgrade_exterior_wall_insulation/tests/measure_test.rb -resources/measures/set_service_water_heating_template/tests/measure_test.rb -resources/measures/hardsize_model/tests/measure_test.rb -resources/measures/upgrade_hvac_multispeed_minimum_flow/tests/measure_Test.rb -resources/measures/upgrade_hvac_doas_hp_minisplits/tests/hvac_doas_hp_minisplits_test.rb -resources/measures/set_hvac_template/tests/measure_test.rb -resources/measures/add_blinds_to_selected_windows/tests/add_blinds_to_selected_windows_test.rb -resources/measures/upgrade_env_secondary_windows/tests/measure_test.rb -resources/measures/upgrade_hvac_economizer/tests/hvac_economizer_test.rb -resources/measures/set_interior_lighting_bpr/tests/set_interior_lighting_bpr_test.rb -resources/measures/set_nist_infiltration_correlations/tests/nist_infiltration_correlations_test.rb -resources/measures/set_service_water_heating_fuel/tests/measure_test.rb -resources/measures/set_electric_equipment_bpr/tests/set_electric_equipment_bpr_test.rb -resources/measures/set_interior_lighting_technology/tests/set_interior_lighting_technology_test.rb -resources/measures/set_interior_equipment_template/tests/measure_test.rb -resources/measures/ChangeBuildingLocation/tests/change_building_location_test.rb -resources/measures/upgrade_hvac_replace_boiler_by_heatpump/tests/add_hpwh_test.rb -resources/measures/add_thermostat_setpoint_variability/tests/add_thermostat_setpoint_variability_test.rb -resources/measures/set_primary_kitchen_equipment/tests/set_primary_kitchen_equipment_test.rb -resources/measures/set_heating_fuel/tests/measure_test.rb -resources/measures/set_space_type_load_subcategories/tests/set_space_type_load_subcategories_test.rb -resources/measures/upgrade_env_window_film/tests/env_window_film_test.rb -resources/measures/add_hvac_nighttime_operation_variability/tests/add_hvac_nighttime_operation_variability_test.rb -resources/measures/upgrade_hvac_exhaust_air_energy_or_heat_recovery/tests/hvac_exhaust_air_energy_or_heat_recovery_test.rb -resources/measures/replace_baseline_windows/tests/replace_baseline_windows_test.rb -resources/measures/prototype_space_type_assignment/tests/prototype_space_type_assignment_test.rb -resources/measures/simulation_settings/tests/measure_test.rb -resources/measures/upgrade_hvac_dcv/tests/hvac_dcv_test.rb \ No newline at end of file +resources/measures/ChangeBuildingLocation/tests/change_building_location_test.rb \ No newline at end of file From 4088390980a716c59be11840742259bbc222e605 Mon Sep 17 00:00:00 2001 From: Wenyi Kuang Date: Wed, 6 Mar 2024 15:48:38 -0700 Subject: [PATCH 2/4] Run more tests to see whether is archieve --- test/measure_tests.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/measure_tests.txt b/test/measure_tests.txt index d56a8b3e7..ef8c5c937 100644 --- a/test/measure_tests.txt +++ b/test/measure_tests.txt @@ -1 +1,7 @@ -measures/qoi_report/tests/qoi_report_test.rb \ No newline at end of file +measures/qoi_report/tests/qoi_report_test.rb +measures/simulation_settings_check/tests/measure_test.rb +measures/emissions_reporting/tests/EmissionsReporting_Test.rb +measures/TimeseriesCSVExport/tests/Measure_Test.rb +measures/comstock_sensitivity_reports/tests/comstock_sensitivity_reports_test.rb +measures/scout_loads_summary/tests/Measure_Test.rb +measures/la_100_qaqc/tests/measure_Test.rb From 8ee165b15a76c958d73ea82a6e31f23edd19a1b7 Mon Sep 17 00:00:00 2001 From: Wenyi Kuang Date: Wed, 6 Mar 2024 19:27:44 -0700 Subject: [PATCH 3/4] Add testhelper to new added test to make it works --- Rakefile | 15 ++- .../tests/adjust_occupancy_schedule_test.rb | 1 + .../tests/test_hvac.rb | 3 +- .../tests/measure_test.rb | 4 +- .../tests/measure_test.rb | 4 +- .../hvac_nighttime_oa_controls/measure.rb | 40 ++++--- .../tests/new_measure_test.rb | 2 + .../tests/advanced_rtu_control_test.rb | 89 +++++++-------- .../df_thermostat_control_load_shed_test.rb | 36 +++--- .../df_thermostat_control_load_shift_test.rb | 33 +++--- .../tests/measure_test.rb | 2 + .../tests/console_gthp_test.rb | 8 +- .../tests/hydronic_gthp_test.rb | 16 +-- .../tests/measure_Test.rb | 3 +- .../tests/packaged_gthp_test.rb | 11 +- .../tests/measure_test.rb | 7 +- .../upgrade_light_led/tests/light_led_test.rb | 2 + .../tests/kitchen_equip_measure_test.rb | 2 + .../unoccupied_oa_controls_measure_test.rb | 105 +++++++++--------- test/resource_measure_tests.txt | 52 ++++++++- 20 files changed, 262 insertions(+), 173 deletions(-) diff --git a/Rakefile b/Rakefile index 899b29fef..f2958ffcf 100644 --- a/Rakefile +++ b/Rakefile @@ -27,13 +27,22 @@ namespace :unit_tests do if File.exist?(RESOURCE_MEASURETESTS_PATH) # load test files from file. full_file_list = FileList.new(File.readlines(RESOURCE_MEASURETESTS_PATH).map(&:chomp)) - full_file_list.select! { |item| item.include?('rb')} + full_file_list.select! { |item| item.include?('rb') && File.exist?(item) } p full_file_list end - t.test_files = full_file_list + t.test_files = full_file_list.select do |file| + begin + # Try to load the file to check for syntax errors + load file + true + rescue Exception => e + puts "Error in #{file}: #{e.message}" + Minitest::Reporters.reporter.report_error(file, e) + false + end + end p(full_file_list) t.verbose = false t.warning = false end - end diff --git a/resources/measures/adjust_occupancy_schedule/tests/adjust_occupancy_schedule_test.rb b/resources/measures/adjust_occupancy_schedule/tests/adjust_occupancy_schedule_test.rb index d91ecdab6..bf74ac7b0 100644 --- a/resources/measures/adjust_occupancy_schedule/tests/adjust_occupancy_schedule_test.rb +++ b/resources/measures/adjust_occupancy_schedule/tests/adjust_occupancy_schedule_test.rb @@ -6,6 +6,7 @@ require 'minitest/autorun' require_relative '../measure.rb' require 'fileutils' +require_relative '../../../../test/helpers/minitest_helper' class AdjustOccupancyScheduleTest < Minitest::Test # def setup diff --git a/resources/measures/create_typical_building_from_model/tests/test_hvac.rb b/resources/measures/create_typical_building_from_model/tests/test_hvac.rb index 846d7e2a3..a293068d6 100644 --- a/resources/measures/create_typical_building_from_model/tests/test_hvac.rb +++ b/resources/measures/create_typical_building_from_model/tests/test_hvac.rb @@ -6,8 +6,9 @@ require 'minitest/autorun' require_relative '../measure.rb' require 'fileutils' +require_relative '../../../../test/helpers/minitest_helper' -class AddHVACSystemTest < MiniTest::Unit::TestCase +class AddHVACSystemTest < Minitest::Test def test_add_hvac_systems # Get the original working directory start_dir = Dir.pwd diff --git a/resources/measures/fault_hvac_economizer_changeover_temperature/tests/measure_test.rb b/resources/measures/fault_hvac_economizer_changeover_temperature/tests/measure_test.rb index d3b27a980..93e9ef115 100644 --- a/resources/measures/fault_hvac_economizer_changeover_temperature/tests/measure_test.rb +++ b/resources/measures/fault_hvac_economizer_changeover_temperature/tests/measure_test.rb @@ -42,6 +42,8 @@ require 'fileutils' require 'minitest/autorun' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' + # only necessary to include here if annual simulation request and the measure doesn't require openstudio-standards # require 'openstudio-standards' @@ -239,7 +241,7 @@ def test_models argument_map['changeovertemp'] = changeovertemp # set arguments: apply measure - apply_measure = arguments[2].clone + apply_measure = arguments[2].clone assert(apply_measure.setValue(true)) argument_map['apply_measure'] = apply_measure diff --git a/resources/measures/fault_hvac_economizer_damper_stuck/tests/measure_test.rb b/resources/measures/fault_hvac_economizer_damper_stuck/tests/measure_test.rb index 76e581baf..094ef966b 100644 --- a/resources/measures/fault_hvac_economizer_damper_stuck/tests/measure_test.rb +++ b/resources/measures/fault_hvac_economizer_damper_stuck/tests/measure_test.rb @@ -42,6 +42,8 @@ require 'fileutils' require 'minitest/autorun' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' + # only necessary to include here if annual simulation request and the measure doesn't require openstudio-standards # require 'openstudio-standards' @@ -257,7 +259,7 @@ def test_models argument_map['damper_pos'] = damper_pos # set arguments: apply measure - apply_measure = arguments[5].clone + apply_measure = arguments[5].clone assert(apply_measure.setValue(true)) argument_map['apply_measure'] = apply_measure diff --git a/resources/measures/hvac_nighttime_oa_controls/measure.rb b/resources/measures/hvac_nighttime_oa_controls/measure.rb index dc73c8bf8..29c6a19f0 100644 --- a/resources/measures/hvac_nighttime_oa_controls/measure.rb +++ b/resources/measures/hvac_nighttime_oa_controls/measure.rb @@ -115,7 +115,7 @@ def run(model, runner, user_arguments) # # report final condition of model # runner.registerFinalCondition("The building finished with #{model.getSpaces.size} spaces.") - + template = 'ComStock 90.1-2013' std = Standard.build(template) @@ -159,22 +159,28 @@ def run(model, runner, user_arguments) li_unitary_systems.sort.each do |air_loop_hvac| # change night OA schedule to match hvac operation schedule for no night OA - # Schedule to control whether or not unit ventilates at night - clone hvac availability schedule - next unless air_loop_hvac.availabilitySchedule.clone.to_ScheduleRuleset.is_initialized - air_loop_vent_sch = air_loop_hvac.availabilitySchedule.clone.to_ScheduleRuleset.get - air_loop_vent_sch.setName("#{air_loop_hvac.name}_night_novent_schedule") - next unless air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized - air_loop_oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get.getControllerOutdoorAir - next unless air_loop_oa_system.minimumOutdoorAirSchedule.is_initialized - air_loop_oa_system.setMinimumOutdoorAirSchedule(air_loop_vent_sch) - oa_schd_op_count += 1 - end - - # change fan operation schedule to new clone of hvac operation schedule to ensure night cycling of fans (removing any constant schedules) - # Schedule to control whether or not unit ventilates at night - clone hvac availability schedule - next unless air_loop_hvac.availabilitySchedule.to_ScheduleRuleset.is_initialized - air_loop_fan_sch = air_loop_hvac.availabilitySchedule.clone.to_ScheduleRuleset.get - air_loop_fan_sch.setName("#{air_loop_hvac.name}_night_fancycle_schedule") + # Schedule to control whether or not unit ventilates at night - clone hvac availability schedule + next unless air_loop_hvac.availabilitySchedule.clone.to_ScheduleRuleset.is_initialized + + air_loop_vent_sch = air_loop_hvac.availabilitySchedule.clone.to_ScheduleRuleset.get + air_loop_vent_sch.setName("#{air_loop_hvac.name}_night_novent_schedule") + + next unless air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized + + air_loop_oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get.getControllerOutdoorAir + + next unless air_loop_oa_system.minimumOutdoorAirSchedule.is_initialized + + air_loop_oa_system.setMinimumOutdoorAirSchedule(air_loop_vent_sch) + oa_schd_op_count += 1 + end + + # change fan operation schedule to new clone of hvac operation schedule to ensure night cycling of fans (removing any constant schedules) + # Schedule to control whether or not unit ventilates at night - clone hvac availability schedule + next unless air_loop_hvac.availabilitySchedule.to_ScheduleRuleset.is_initialized + + air_loop_fan_sch = air_loop_hvac.availabilitySchedule.clone.to_ScheduleRuleset.get + air_loop_fan_sch.setName("#{air_loop_hvac.name}_night_fancycle_schedule") # Schedule to control the airloop fan operation schedule air_loop_hvac.supplyComponents.each do |component| obj_type = component.iddObjectType.valueName.to_s diff --git a/resources/measures/hvac_nighttime_oa_controls/tests/new_measure_test.rb b/resources/measures/hvac_nighttime_oa_controls/tests/new_measure_test.rb index 3e63714e9..9c7e33136 100644 --- a/resources/measures/hvac_nighttime_oa_controls/tests/new_measure_test.rb +++ b/resources/measures/hvac_nighttime_oa_controls/tests/new_measure_test.rb @@ -5,6 +5,8 @@ require 'minitest/autorun' require_relative '../measure.rb' require 'fileutils' +require_relative '../../../../test/helpers/minitest_helper' + class NewMeasureTest < Minitest::Test # def setup diff --git a/resources/measures/upgrade_advanced_rtu_control/tests/advanced_rtu_control_test.rb b/resources/measures/upgrade_advanced_rtu_control/tests/advanced_rtu_control_test.rb index 153be532b..173abd264 100644 --- a/resources/measures/upgrade_advanced_rtu_control/tests/advanced_rtu_control_test.rb +++ b/resources/measures/upgrade_advanced_rtu_control/tests/advanced_rtu_control_test.rb @@ -42,6 +42,7 @@ require 'fileutils' require 'minitest/autorun' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' class AdvancedRTUControlTest < Minitest::Test @@ -75,7 +76,7 @@ def run_dir(test_name) def model_input_path(osm_name) # return models_for_tests.select { |x| set[:model] == osm_name } - puts (File.expand_path(File.dirname(__FILE__))) #expands path relative to current wd, passing abs path back + puts (File.expand_path(File.dirname(__FILE__))) #expands path relative to current wd, passing abs path back return File.expand_path(File.join(File.dirname(__FILE__), '../../../tests/models', osm_name)) end @@ -115,13 +116,13 @@ def apply_measure_and_run(test_name, measure, argument_map, osm_path, epw_path, end # copy the osm and epw to the test directory - #osm_path = File.expand_path(osm_path) - puts(osm_path) + #osm_path = File.expand_path(osm_path) + puts(osm_path) new_osm_path = "#{run_dir(test_name)}/#{File.basename(osm_path)}" - new_osm_path = File.expand_path(new_osm_path) - puts(new_osm_path) + new_osm_path = File.expand_path(new_osm_path) + puts(new_osm_path) FileUtils.cp(osm_path, new_osm_path) - new_epw_path = File.expand_path("#{run_dir(test_name)}/#{File.basename(epw_path)}") + new_epw_path = File.expand_path("#{run_dir(test_name)}/#{File.basename(epw_path)}") FileUtils.cp(epw_path, new_epw_path) # create an instance of a runner runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new) @@ -130,33 +131,33 @@ def apply_measure_and_run(test_name, measure, argument_map, osm_path, epw_path, if model.nil? model = load_model(new_osm_path) end - + # set model weather file epw_file = OpenStudio::EpwFile.new(OpenStudio::Path.new(new_epw_path)) OpenStudio::Model::WeatherFile.setWeatherFile(model, epw_file) assert(model.weatherFile.is_initialized) - + # run the simulation if necessary unless File.exist?(sql_path(test_name)) puts "\nRUNNING SIZING RUN FOR #{test_name}..." std = Standard.build('90.1-2013') std.model_run_sizing_run(model, run_dir(test_name)) end - assert(File.exist?(File.join(run_dir(test_name), "in.osm"))) + assert(File.exist?(File.join(run_dir(test_name), "in.osm"))) assert(File.exist?(sql_path(test_name))) - + # change into run directory for tests start_dir = Dir.pwd Dir.chdir run_dir(test_name) - + # run the measure puts "\nAPPLYING MEASURE..." measure.run(model, runner, argument_map) result = runner.result result_success = result.value.valueName == 'Success' - + # change back directory Dir.chdir(start_dir) @@ -195,9 +196,9 @@ def test_number_of_arguments_and_argument_names arguments = measure.arguments(model) assert_equal(2, arguments.size) end - - - + + + def test_econo osm_name = '361_Small_Office_PSZ_Gas_3a.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -212,7 +213,7 @@ def test_econo model = load_model(osm_path) arguments = measure.arguments(model) argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments) - #put base case assertions here + #put base case assertions here # create hash of argument values args_hash = { 'add_econo' => true, 'add_dcv' => false} # populate argument with specified hash value if specified @@ -223,13 +224,13 @@ def test_econo end argument_map[arg.name] = temp_arg_var end - + # Apply the measure to the model and optionally run the model result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false) model = load_model(File.expand_path(model_output_path(__method__))) - #confirm that at least one air loop now has an economizer - has_econo = false + #confirm that at least one air loop now has an economizer + has_econo = false model.getAirLoopHVACs.sort.each do |air_loop_hvac| oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem if oa_system.is_initialized @@ -237,19 +238,19 @@ def test_econo oa_controller = oa_system.getControllerOutdoorAir economizer_type = oa_controller.getEconomizerControlType if economizer_type != 'NoEconomizer' - has_econo = true - end + has_econo = true + end else runner.registerInfo("Air loop #{air_loop_hvac.name} does not have outdoor air and cannot economize.") end - - end - assert(has_econo) -#put in assertions here -#then duplicate it for other models if needed + + end + assert(has_econo) +#put in assertions here +#then duplicate it for other models if needed end - def test_var_vol_fan + def test_var_vol_fan osm_name = '361_Retail_PSZ_Gas_5a.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -261,11 +262,11 @@ def test_var_vol_fan # Create an instance of the measure measure = AdvancedRTUControl.new - # Load the model; only used here for populating arguments + # Load the model; only used here for populating arguments model = load_model(osm_path) arguments = measure.arguments(model) argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments) - #put base case assertions here + #put base case assertions here # create hash of argument values args_hash = { 'add_econo' => false, 'add_dcv' => false} # populate argument with specified hash value if specified @@ -276,13 +277,13 @@ def test_var_vol_fan end argument_map[arg.name] = temp_arg_var end - + # Apply the measure to the model and optionally run the model - result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false) + result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false) model = load_model(File.expand_path(model_output_path(__method__))) - - var_vol_fan = false + + var_vol_fan = false model.getAirLoopHVACs.sort.each do |air_loop_hvac| air_loop_hvac.supplyComponents.each do |component| obj_type = component.iddObjectType.valueName.to_s @@ -290,18 +291,18 @@ def test_var_vol_fan when 'OS_AirLoopHVAC_UnitarySystem' component = component.to_AirLoopHVACUnitarySystem.get sup_fan = component.supplyFan - if sup_fan.is_initialized + if sup_fan.is_initialized sup_fan = sup_fan.get if sup_fan.to_FanVariableVolume.is_initialized - var_vol_fan = true - end - end - end - end - end - - assert(var_vol_fan) - + var_vol_fan = true + end + end + end + end + end + + assert(var_vol_fan) + end -end \ No newline at end of file +end diff --git a/resources/measures/upgrade_df_thermostat_control_load_shed/tests/df_thermostat_control_load_shed_test.rb b/resources/measures/upgrade_df_thermostat_control_load_shed/tests/df_thermostat_control_load_shed_test.rb index 2da9e1d4d..a143e8129 100644 --- a/resources/measures/upgrade_df_thermostat_control_load_shed/tests/df_thermostat_control_load_shed_test.rb +++ b/resources/measures/upgrade_df_thermostat_control_load_shed/tests/df_thermostat_control_load_shed_test.rb @@ -6,6 +6,8 @@ require 'minitest/autorun' require_relative '../measure.rb' require 'fileutils' +require_relative '../../../../test/helpers/minitest_helper' + # require all .rb files in resources folder Dir[File.dirname(__FILE__) + '../resources/*.rb'].each { |file| require file } @@ -61,7 +63,7 @@ def models_to_test weather: 'CO_FortCollins_16', result: 'NA' } - + return test_sets end @@ -186,28 +188,28 @@ def test_models arguments = measure.arguments(model) argument_map = OpenStudio::Measure::OSArgumentMap.new - # set arguments: + # set arguments: peak_len = arguments[0].clone assert(peak_len.setValue(4)) argument_map['peak_len'] = peak_len - # set arguments: + # set arguments: rebound_len = arguments[1].clone assert(rebound_len.setValue(2)) argument_map['rebound_len'] = rebound_len - # set arguments: - sp_adjustment = arguments[2].clone + # set arguments: + sp_adjustment = arguments[2].clone assert(sp_adjustment.setValue(2.0)) argument_map['sp_adjustment'] = sp_adjustment - # set arguments: - num_timesteps_in_hr = arguments[3].clone + # set arguments: + num_timesteps_in_hr = arguments[3].clone assert(num_timesteps_in_hr.setValue(4)) argument_map['num_timesteps_in_hr'] = num_timesteps_in_hr - # set arguments: - load_prediction_method = arguments[4].clone + # set arguments: + load_prediction_method = arguments[4].clone assert(load_prediction_method.setValue('part year bin sample'))#'bin sample''full baseline' argument_map['load_prediction_method'] = load_prediction_method @@ -227,9 +229,9 @@ def test_models # def dispatch_gen_create_binsamples_test # oat_harcoded = [] - # bins_hardcoded = - # selectdays_hardcoded = - # ns_hardcoded = + # bins_hardcoded = + # selectdays_hardcoded = + # ns_hardcoded = # puts("### ============================================================") # puts("### Creating bins...") @@ -244,10 +246,10 @@ def test_models # end # def dispatch_gen_run_samples_test(model) - # year_hardcoded = - # selectdays_hardcoded = - # num_timesteps_in_hr_hardcoded = - # y_seed_harcoded = + # year_hardcoded = + # selectdays_hardcoded = + # num_timesteps_in_hr_hardcoded = + # y_seed_harcoded = # puts("### ============================================================") # puts("### Running simulation on samples...") @@ -263,7 +265,7 @@ def test_models # osm_path = model_input_path(osm_name) # epw_path = epw_input_path(epw_name) # model = load_model(osm_path) - + # oat_harcoded = [] # bins_hardcoded = { # 'ext-hot' => { 'morning' => [], 'noon' => [], 'afternoon' => [], 'late-afternoon' => [], 'evening' => [], 'other' => [] }, diff --git a/resources/measures/upgrade_df_thermostat_control_load_shift/tests/df_thermostat_control_load_shift_test.rb b/resources/measures/upgrade_df_thermostat_control_load_shift/tests/df_thermostat_control_load_shift_test.rb index 9acb92ab9..42ee01cb2 100644 --- a/resources/measures/upgrade_df_thermostat_control_load_shift/tests/df_thermostat_control_load_shift_test.rb +++ b/resources/measures/upgrade_df_thermostat_control_load_shift/tests/df_thermostat_control_load_shift_test.rb @@ -6,6 +6,7 @@ require 'minitest/autorun' require_relative '../measure.rb' require 'fileutils' +require_relative '../../../../test/helpers/minitest_helper' # require all .rb files in resources folder Dir[File.dirname(__FILE__) + '../resources/*.rb'].each { |file| require file } @@ -181,28 +182,28 @@ def test_models arguments = measure.arguments(model) argument_map = OpenStudio::Measure::OSArgumentMap.new - # set arguments: + # set arguments: peak_len = arguments[0].clone assert(peak_len.setValue(4)) argument_map['peak_len'] = peak_len - # set arguments: + # set arguments: prepeak_len = arguments[1].clone assert(prepeak_len.setValue(2)) argument_map['prepeak_len'] = prepeak_len - # set arguments: - sp_adjustment = arguments[2].clone + # set arguments: + sp_adjustment = arguments[2].clone assert(sp_adjustment.setValue(2.0)) argument_map['sp_adjustment'] = sp_adjustment - # set arguments: - num_timesteps_in_hr = arguments[3].clone + # set arguments: + num_timesteps_in_hr = arguments[3].clone assert(num_timesteps_in_hr.setValue(4)) argument_map['num_timesteps_in_hr'] = num_timesteps_in_hr - # set arguments: - load_prediction_method = arguments[4].clone + # set arguments: + load_prediction_method = arguments[4].clone assert(load_prediction_method.setValue('part year bin sample'))#'bin sample''full baseline' argument_map['load_prediction_method'] = load_prediction_method @@ -222,9 +223,9 @@ def test_models # def dispatch_gen_create_binsamples_test # oat_harcoded = [] - # bins_hardcoded = - # selectdays_hardcoded = - # ns_hardcoded = + # bins_hardcoded = + # selectdays_hardcoded = + # ns_hardcoded = # puts("### ============================================================") # puts("### Creating bins...") @@ -239,10 +240,10 @@ def test_models # end # def dispatch_gen_run_samples_test(model) - # year_hardcoded = - # selectdays_hardcoded = - # num_timesteps_in_hr_hardcoded = - # y_seed_harcoded = + # year_hardcoded = + # selectdays_hardcoded = + # num_timesteps_in_hr_hardcoded = + # y_seed_harcoded = # puts("### ============================================================") # puts("### Running simulation on samples...") @@ -258,7 +259,7 @@ def test_models # osm_path = model_input_path(osm_name) # epw_path = epw_input_path(epw_name) # model = load_model(osm_path) - + # oat_harcoded = [] # bins_hardcoded = { # 'ext-hot' => { 'morning' => [], 'noon' => [], 'afternoon' => [], 'late-afternoon' => [], 'evening' => [], 'other' => [] }, diff --git a/resources/measures/upgrade_env_new_aedg_windows/tests/measure_test.rb b/resources/measures/upgrade_env_new_aedg_windows/tests/measure_test.rb index 85fbf36a2..8b27b1ecc 100644 --- a/resources/measures/upgrade_env_new_aedg_windows/tests/measure_test.rb +++ b/resources/measures/upgrade_env_new_aedg_windows/tests/measure_test.rb @@ -42,6 +42,8 @@ require 'fileutils' require 'minitest/autorun' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' + class EnvNewAedgWindowsTest < Minitest::Test diff --git a/resources/measures/upgrade_hvac_console_gshp/tests/console_gthp_test.rb b/resources/measures/upgrade_hvac_console_gshp/tests/console_gthp_test.rb index 85cf9a5e6..468acb011 100644 --- a/resources/measures/upgrade_hvac_console_gshp/tests/console_gthp_test.rb +++ b/resources/measures/upgrade_hvac_console_gshp/tests/console_gthp_test.rb @@ -43,6 +43,8 @@ require 'minitest/autorun' require 'open3' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' + class ConsoleGTHPTest < Minitest::Test @@ -300,7 +302,7 @@ def test_residential_ac # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + # test a few non-applicable system types def test_direct_evap_coolers_baseboard_gas_boiler osm_name = 'Direct_evap_coolers_boiler.osm' @@ -325,7 +327,7 @@ def test_pszhp # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_pvav_gas_heat_electric_reheat osm_name = 'PVAV_gas_heat_electric_reheat.osm' epw_name = 'NY_New_York_John_F_Ke_744860_16.epw' @@ -337,4 +339,4 @@ def test_pvav_gas_heat_electric_reheat # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end -end \ No newline at end of file +end diff --git a/resources/measures/upgrade_hvac_hydronic_gshp/tests/hydronic_gthp_test.rb b/resources/measures/upgrade_hvac_hydronic_gshp/tests/hydronic_gthp_test.rb index 5f3e2ddd9..9f8551f99 100644 --- a/resources/measures/upgrade_hvac_hydronic_gshp/tests/hydronic_gthp_test.rb +++ b/resources/measures/upgrade_hvac_hydronic_gshp/tests/hydronic_gthp_test.rb @@ -43,6 +43,8 @@ require 'minitest/autorun' require 'open3' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' + class HydronicGTHPTest < Minitest::Test @@ -215,7 +217,7 @@ def test_number_of_arguments_and_argument_names arguments = measure.arguments(model) assert_equal(7, arguments.size) end - + # test all applicable system types def test_pszac_gas_boiler osm_name = 'PSZ-AC_with_gas_boiler.osm' @@ -228,7 +230,7 @@ def test_pszac_gas_boiler # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_pvav_gas_boiler_reheat osm_name = 'PVAV_with_gas_boiler_reheat.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -240,7 +242,7 @@ def test_pvav_gas_boiler_reheat # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_vav_air_cooled_chiller_with_gas_boiler_reheat osm_name = 'VAV_air_cooled_chiller_with_gas_boiler_reheat.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -252,7 +254,7 @@ def test_vav_air_cooled_chiller_with_gas_boiler_reheat # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_vav_chiller_pfp_boxes osm_name = 'Outpatient_VAV_chiller_PFP_boxes.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -264,7 +266,7 @@ def test_vav_chiller_pfp_boxes # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_doas_fan_coil_air_cooled_chiller_boiler osm_name = 'DOAS_fan_coil_air_cooled_chiller_with_boiler.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -276,7 +278,7 @@ def test_doas_fan_coil_air_cooled_chiller_boiler # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + # test non-applicable system types def test_pszhp osm_name = 'PSZ-HP_gthp.osm' @@ -289,4 +291,4 @@ def test_pszhp # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end -end \ No newline at end of file +end diff --git a/resources/measures/upgrade_hvac_multispeed_minimum_flow/tests/measure_Test.rb b/resources/measures/upgrade_hvac_multispeed_minimum_flow/tests/measure_Test.rb index 08c9588e6..664a13b10 100644 --- a/resources/measures/upgrade_hvac_multispeed_minimum_flow/tests/measure_Test.rb +++ b/resources/measures/upgrade_hvac_multispeed_minimum_flow/tests/measure_Test.rb @@ -23,8 +23,7 @@ require 'openstudio/ruleset/ShowRunnerOutput' require_relative '../../../../test/helpers/minitest_helper' -require "#{File.dirname(__FILE__)}/../measure.rb" - +require_relative '../measure.rb' require 'minitest/autorun' class InjectIDFObjects_Test < MiniTest::Unit::TestCase diff --git a/resources/measures/upgrade_hvac_packaged_gshp/tests/packaged_gthp_test.rb b/resources/measures/upgrade_hvac_packaged_gshp/tests/packaged_gthp_test.rb index 69bb208d3..ba0da1b6f 100644 --- a/resources/measures/upgrade_hvac_packaged_gshp/tests/packaged_gthp_test.rb +++ b/resources/measures/upgrade_hvac_packaged_gshp/tests/packaged_gthp_test.rb @@ -44,6 +44,7 @@ require 'open3' require 'openstudio-standards' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' class PackagedGTHPTest < Minitest::Test @@ -228,7 +229,7 @@ def test_ptac_with_gas_coil_heat # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_pvav_gas_heat_electric_reheat_no_econ osm_name = 'PVAV_gas_heat_electric_reheat.osm' epw_name = 'NY_New_York_John_F_Ke_744860_16.epw' @@ -240,7 +241,7 @@ def test_pvav_gas_heat_electric_reheat_no_econ # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_vav osm_name = 'VAV_chiller_boiler_4A.osm' epw_name = 'NY_New_York_John_F_Ke_744860_16.epw' @@ -264,7 +265,7 @@ def test_pszhp # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_vav_pfp osm_name = 'VAV_with_PFP.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -276,7 +277,7 @@ def test_vav_pfp # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end - + def test_pvav_pfp osm_name = 'PVAV_with_PFP.osm' epw_name = 'NY_New_York_John_F_Ke_744860_16.epw' @@ -288,4 +289,4 @@ def test_pvav_pfp # Apply the measure and check if before/after results are identical result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: true) end -end \ No newline at end of file +end diff --git a/resources/measures/upgrade_hvac_vrf_hr_doas/tests/measure_test.rb b/resources/measures/upgrade_hvac_vrf_hr_doas/tests/measure_test.rb index 0c248a214..e5f9d7830 100644 --- a/resources/measures/upgrade_hvac_vrf_hr_doas/tests/measure_test.rb +++ b/resources/measures/upgrade_hvac_vrf_hr_doas/tests/measure_test.rb @@ -42,6 +42,7 @@ require 'fileutils' require 'minitest/autorun' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' # only necessary to include here if annual simulation request and the measure doesn't require openstudio-standards # require 'openstudio-standards' @@ -196,7 +197,7 @@ def models_to_test weather: 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16', result: 'NA' } - # test: floor area too large + # test: floor area too large test_sets << { model: 'SecondarySchool_PTHP', weather: 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16', @@ -232,7 +233,7 @@ def models_to_test weather: 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16', result: 'NA' } - + return test_sets end @@ -276,7 +277,7 @@ def test_models argument_map['upsizing_allowance_pct'] = upsizing_allowance_pct # set arguments: apply measure - apply_measure = arguments[3].clone + apply_measure = arguments[3].clone assert(apply_measure.setValue(true)) argument_map['apply_measure'] = apply_measure diff --git a/resources/measures/upgrade_light_led/tests/light_led_test.rb b/resources/measures/upgrade_light_led/tests/light_led_test.rb index 4f2ce61ee..370d4650e 100644 --- a/resources/measures/upgrade_light_led/tests/light_led_test.rb +++ b/resources/measures/upgrade_light_led/tests/light_led_test.rb @@ -5,6 +5,8 @@ require 'minitest/autorun' require_relative '../measure.rb' require 'fileutils' +require_relative '../../../../test/helpers/minitest_helper' + class LightLightingTechnologyTest < MiniTest::Test diff --git a/resources/measures/upgrade_ppl_electric_kitchen_equipment/tests/kitchen_equip_measure_test.rb b/resources/measures/upgrade_ppl_electric_kitchen_equipment/tests/kitchen_equip_measure_test.rb index 69c782a07..5232da639 100644 --- a/resources/measures/upgrade_ppl_electric_kitchen_equipment/tests/kitchen_equip_measure_test.rb +++ b/resources/measures/upgrade_ppl_electric_kitchen_equipment/tests/kitchen_equip_measure_test.rb @@ -42,6 +42,8 @@ require 'fileutils' require 'minitest/autorun' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' + class EnvSecondaryWindowsTest < Minitest::Test diff --git a/resources/measures/upgrade_unoccupied_oa_controls/tests/unoccupied_oa_controls_measure_test.rb b/resources/measures/upgrade_unoccupied_oa_controls/tests/unoccupied_oa_controls_measure_test.rb index 688de05e2..ebe98a663 100644 --- a/resources/measures/upgrade_unoccupied_oa_controls/tests/unoccupied_oa_controls_measure_test.rb +++ b/resources/measures/upgrade_unoccupied_oa_controls/tests/unoccupied_oa_controls_measure_test.rb @@ -42,6 +42,7 @@ require 'fileutils' require 'minitest/autorun' require_relative '../measure.rb' +require_relative '../../../../test/helpers/minitest_helper' class UnoccupiedOAControlsTest < Minitest::Test @@ -75,7 +76,7 @@ def run_dir(test_name) def model_input_path(osm_name) # return models_for_tests.select { |x| set[:model] == osm_name } - puts (File.expand_path(File.dirname(__FILE__))) #expands path relative to current wd, passing abs path back + puts (File.expand_path(File.dirname(__FILE__))) #expands path relative to current wd, passing abs path back return File.expand_path(File.join(File.dirname(__FILE__), '../../../tests/models', osm_name)) end @@ -117,29 +118,29 @@ def apply_measure_and_run(test_name, measure, argument_map, osm_path, epw_path, end # copy the osm and epw to the test directory - #osm_path = File.expand_path(osm_path) - puts(osm_path) + #osm_path = File.expand_path(osm_path) + puts(osm_path) new_osm_path = "#{run_dir(test_name)}/#{File.basename(osm_path)}" - new_osm_path = File.expand_path(new_osm_path) - puts(new_osm_path) + new_osm_path = File.expand_path(new_osm_path) + puts(new_osm_path) FileUtils.cp(osm_path, new_osm_path) - new_epw_path = File.expand_path("#{run_dir(test_name)}/#{File.basename(epw_path)}") + new_epw_path = File.expand_path("#{run_dir(test_name)}/#{File.basename(epw_path)}") FileUtils.cp(epw_path, new_epw_path) # create an instance of a runner runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new) # load the test model if model.nil? - puts 'loading test model 1' + puts 'loading test model 1' model = load_model(new_osm_path) end - + # set model weather file epw_file = OpenStudio::EpwFile.new(OpenStudio::Path.new(new_epw_path)) OpenStudio::Model::WeatherFile.setWeatherFile(model, epw_file) assert(model.weatherFile.is_initialized) - + # run the simulation if necessary unless File.exist?(sql_path(test_name)) puts "\nRUNNING SIZING RUN FOR #{test_name}..." @@ -147,20 +148,20 @@ def apply_measure_and_run(test_name, measure, argument_map, osm_path, epw_path, std = Standard.build('90.1-2013') std.model_run_sizing_run(model, run_dir(test_name)) end - assert(File.exist?(File.join(run_dir(test_name), "in.osm"))) + assert(File.exist?(File.join(run_dir(test_name), "in.osm"))) assert(File.exist?(sql_path(test_name))) - + # change into run directory for tests start_dir = Dir.pwd Dir.chdir run_dir(test_name) - + # run the measure puts "\nAPPLYING MEASURE..." measure.run(model, runner, argument_map) result = runner.result result_success = result.value.valueName == 'Success' - + # change back directory Dir.chdir(start_dir) @@ -183,7 +184,7 @@ def apply_measure_and_run(test_name, measure, argument_map, osm_path, epw_path, return result end - + def self.air_loop_hvac_unitary_system?(air_loop_hvac) is_unitary_system = false air_loop_hvac.supplyComponents.each do |component| @@ -211,10 +212,10 @@ def test_number_of_arguments_and_argument_names arguments = measure.arguments(model) assert_equal(0, arguments.size) end - - - def test_constant_oa_sched + + + def test_constant_oa_sched osm_name = '361_Retail_PSZ_Gas_5a.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -224,32 +225,32 @@ def test_constant_oa_sched # Create an instance of the measure measure = UnoccupiedOAControls.new - # Load the model; only used here for populating arguments + # Load the model; only used here for populating arguments model = load_model(osm_path) arguments = measure.arguments(model) argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments) - #no arguments to measure - + #no arguments to measure + # Apply the measure to the model and optionally run the model - result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false) + result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false) model = load_model(File.expand_path(model_output_path(__method__))) - - no_constant_oa = true + + no_constant_oa = true model.getAirLoopHVACs.sort.each do |air_loop_hvac| air_loop_oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get.getControllerOutdoorAir - if air_loop_oa_system.minimumOutdoorAirSchedule.get.to_ScheduleConstant.is_initialized - no_constant_oa = false - end - end - - assert(no_constant_oa) - -#put in assertions here -#then duplicate it for other models if needed + if air_loop_oa_system.minimumOutdoorAirSchedule.get.to_ScheduleConstant.is_initialized + no_constant_oa = false + end + end + + assert(no_constant_oa) + +#put in assertions here +#then duplicate it for other models if needed end - - def test_constant_air_loop_sched + + def test_constant_air_loop_sched osm_name = 'LargeOffice_VAV_chiller_boiler.osm' epw_name = 'CA_LOS-ANGELES-DOWNTOWN-USC_722874S_16.epw' @@ -259,24 +260,24 @@ def test_constant_air_loop_sched # Create an instance of the measure measure = UnoccupiedOAControls.new - # Load the model; only used here for populating arguments + # Load the model; only used here for populating arguments model = load_model(osm_path) arguments = measure.arguments(model) argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments) - #no arguments to measure - + #no arguments to measure + # Apply the measure to the model and optionally run the model - result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false) + result = apply_measure_and_run(__method__, measure, argument_map, osm_path, epw_path, run_model: false) model = load_model(File.expand_path(model_output_path(__method__))) - - no_constant_loop_sched = true + + no_constant_loop_sched = true model.getAirLoopHVACs.sort.each do |air_loop_hvac| - avail_sched = air_loop_hvac.availabilitySchedule #got an error checking this for initialization + avail_sched = air_loop_hvac.availabilitySchedule #got an error checking this for initialization if avail_sched.to_ScheduleConstant.is_initialized - no_constant_loop_sched = false - end - #among unitary systems, check supply fan operating mode for constant schedules + no_constant_loop_sched = false + end + #among unitary systems, check supply fan operating mode for constant schedules if UnoccupiedOAControlsTest.air_loop_hvac_unitary_system?(air_loop_hvac) air_loop_hvac.supplyComponents.each do |component| obj_type = component.iddObjectType.valueName.to_s @@ -290,15 +291,15 @@ def test_constant_air_loop_sched when 'OS_AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypass' component = component.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get component.getSupplyAirFanOperatingModeSchedule - if setMinimumOutdoorAirSchedule.to_ScheduleConstant.is_initialized - no_constant_loop_sched = false - end - end + if setMinimumOutdoorAirSchedule.to_ScheduleConstant.is_initialized + no_constant_loop_sched = false + end + end end end - end - assert(no_constant_loop_sched) - + end + assert(no_constant_loop_sched) + end -end \ No newline at end of file +end diff --git a/test/resource_measure_tests.txt b/test/resource_measure_tests.txt index 05e9c0f74..f1caced48 100644 --- a/test/resource_measure_tests.txt +++ b/test/resource_measure_tests.txt @@ -1 +1,51 @@ -resources/measures/ChangeBuildingLocation/tests/change_building_location_test.rb \ No newline at end of file +resources/measures/ChangeBuildingLocation/tests/change_building_location_test.rb +resources/measures/add_blinds_to_selected_windows/tests/add_blinds_to_selected_windows_test.rb +resources/measures/add_hvac_nighttime_operation_variability/tests/add_hvac_nighttime_operation_variability_test.rb +resources/measures/add_thermostat_setpoint_variability/tests/add_thermostat_setpoint_variability_test.rb +resources/measures/adjust_occupancy_schedule/tests/adjust_occupancy_schedule_test.rb +resources/measures/create_bar_from_building_type_ratios/tests/create_bar_from_building_type_ratios_test.rb +resources/measures/create_typical_building_from_model/tests/create_typical_building_from_model_test.rb +resources/measures/create_typical_building_from_model/tests/test_hvac.rb +resources/measures/fault_hvac_economizer_changeover_temperature/tests/measure_test.rb +resources/measures/fault_hvac_economizer_damper_stuck/tests/measure_test.rb +resources/measures/hardsize_model/tests/measure_test.rb +resources/measures/prototype_space_type_assignment/tests/prototype_space_type_assignment_test.rb +resources/measures/replace_baseline_windows/tests/replace_baseline_windows_test.rb +resources/measures/set_electric_equipment_bpr/tests/set_electric_equipment_bpr_test.rb +resources/measures/set_exterior_lighting_template/tests/measure_test.rb +resources/measures/set_heating_fuel/tests/measure_test.rb +resources/measures/set_hvac_template/tests/measure_test.rb +resources/measures/set_interior_equipment_template/tests/measure_test.rb +resources/measures/set_interior_lighting_bpr/tests/set_interior_lighting_bpr_test.rb +resources/measures/set_interior_lighting_technology/tests/set_interior_lighting_technology_test.rb +resources/measures/set_nist_infiltration_correlations/tests/nist_infiltration_correlations_test.rb +resources/measures/set_primary_kitchen_equipment/tests/set_primary_kitchen_equipment_test.rb +resources/measures/set_roof_template/tests/measure_test.rb +resources/measures/set_service_water_heating_fuel/tests/measure_test.rb +resources/measures/set_service_water_heating_template/tests/measure_test.rb +resources/measures/set_space_type_load_subcategories/tests/set_space_type_load_subcategories_test.rb +resources/measures/set_wall_template/tests/measure_test.rb +resources/measures/simulation_settings/tests/measure_test.rb +resources/measures/upgrade_advanced_rtu_control/tests/advanced_rtu_control_test.rb +resources/measures/upgrade_df_thermostat_control_load_shed/tests/df_thermostat_control_load_shed_test.rb +resources/measures/upgrade_df_thermostat_control_load_shift/tests/df_thermostat_control_load_shift_test.rb +resources/measures/upgrade_env_exterior_wall_insulation/tests/measure_test.rb +resources/measures/upgrade_env_new_aedg_windows/tests/env_new_aedg_windows_test.rb +resources/measures/upgrade_env_new_aedg_windows/tests/measure_test.rb +resources/measures/upgrade_env_roof_insul_aedg/tests/env_roof_insul_aedg_test.rb +resources/measures/upgrade_env_secondary_windows/tests/measure_test.rb +resources/measures/upgrade_env_window_film/tests/env_window_film_test.rb +resources/measures/upgrade_hvac_add_heat_pump_rtu/tests/measure_test.rb +resources/measures/upgrade_hvac_console_gshp/tests/console_gthp_test.rb +resources/measures/upgrade_hvac_dcv/tests/hvac_dcv_test.rb +resources/measures/upgrade_hvac_doas_hp_minisplits/tests/hvac_doas_hp_minisplits_test.rb +resources/measures/upgrade_hvac_economizer/tests/hvac_economizer_test.rb +resources/measures/upgrade_hvac_exhaust_air_energy_or_heat_recovery/tests/hvac_exhaust_air_energy_or_heat_recovery_test.rb +resources/measures/upgrade_hvac_hydronic_gshp/tests/hydronic_gthp_test.rb +resources/measures/upgrade_hvac_multispeed_minimum_flow/tests/measure_Test.rb +resources/measures/upgrade_hvac_packaged_gshp/tests/packaged_gthp_test.rb +resources/measures/upgrade_hvac_replace_boiler_by_heatpump/tests/add_hpwh_test.rb +resources/measures/upgrade_hvac_vrf_hr_doas/tests/measure_test.rb +resources/measures/upgrade_light_led/tests/light_led_test.rb +resources/measures/upgrade_ppl_electric_kitchen_equipment/tests/kitchen_equip_measure_test.rb +resources/measures/upgrade_unoccupied_oa_controls/tests/unoccupied_oa_controls_measure_test.rb \ No newline at end of file From ec4750cb7acbf5538ba9ce6c05ada0e7fa39b82f Mon Sep 17 00:00:00 2001 From: Wenyi Kuang Date: Thu, 7 Mar 2024 12:17:21 -0700 Subject: [PATCH 4/4] Following with corresponding measure.xml update --- .../hvac_nighttime_oa_controls/measure.xml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/resources/measures/hvac_nighttime_oa_controls/measure.xml b/resources/measures/hvac_nighttime_oa_controls/measure.xml index 0a38153b5..962cece22 100644 --- a/resources/measures/hvac_nighttime_oa_controls/measure.xml +++ b/resources/measures/hvac_nighttime_oa_controls/measure.xml @@ -1,11 +1,12 @@ 3.1 + /App/Comstock/resources/measures/hvac_nighttime_oa_controls/measure.rb:180: Invalid next new_measure e6960929-a4a7-4447-8dc6-d9dfc6b92765 - 10ce1645-8cc4-4cf1-b166-08225bff1811 - 2023-12-06T17:53:33Z - 00000000 + 45b31a96-bf2e-4d1b-bf92-98e12cc4ef66 + 2024-03-07T19:16:12Z + B3180F38 NewMeasure New Measure Replace this text with an explanation of what the measure does in terms that can be understood by a general building professional audience (building owners, architects, engineers, contractors, etc.). This description will be used to create reports aimed at convincing the owner and/or design team to implement the measure in the actual building design. For this reason, the description may include details about how the measure would be implemented, along with explanations of qualitative benefits associated with the measure. It is good practice to include citations in the measure if the description is taken from a known source or if specific benefits are listed. @@ -64,6 +65,12 @@ license CD7F5672 + + README.md + md + readme + 01DF739F + README.md.erb erb @@ -80,11 +87,12 @@ OpenStudio 3.6.1 + 3.6.1 measure.rb rb script - FE47D144 + A62EED52 example_model.osm @@ -96,7 +104,7 @@ new_measure_test.rb rb test - 576EDB23 + E90B7467