lib/openstudio-standards/utilities/template_measure/resources/BTAPMeasureHelper.rb in openstudio-standards-0.5.0 vs lib/openstudio-standards/utilities/template_measure/resources/BTAPMeasureHelper.rb in openstudio-standards-0.6.0.rc1

- old
+ new

@@ -206,11 +206,12 @@ # Test argument ranges. def test_argument_ranges model = OpenStudio::Model::Model.new standard = Standard.build('NECB2015') - standard.model_add_design_days_and_weather_file(model, nil, 'CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.epw') + weather_file_path = OpenstudioStandards::Weather.get_standards_weather_file_path('CAN_AB_Edmonton.Intl.AP.711230_CWEC2020.epw') + OpenstudioStandards::Weather.model_set_building_location(model, weather_file_path: weather_file_path) [true, false].each do |json_input| [true, false].each do |string_double| @use_json_package = json_input @use_string_double = string_double @@ -296,22 +297,21 @@ # helper method to create necb archetype as a starting point for testing. def create_necb_protype_model(building_type, climate_zone, epw_file, template) osm_directory = "#{Dir.pwd}/output/#{building_type}-#{template}-#{climate_zone}-#{epw_file}" FileUtils.mkdir_p osm_directory unless Dir.exist?(osm_directory) - # Get Weather climate zone from lookup - weather = BTAP::Environment::WeatherFile.new(epw_file) - # create model - building_name = "#{template}_#{building_type}" - prototype_creator = Standard.build(building_name) + # Set building location from epw file + weather_file_path = OpenstudioStandards::Weather.get_standards_weather_file_path(epw_file) + OpenstudioStandards::Weather.model_set_building_location(model, weather_file_path: weather_file_path) + + # create model + prototype_creator = Standard.build("#{template}_#{building_type}") model = prototype_creator.model_create_prototype_model(climate_zone, epw_file, osm_directory, @debug, model) - # set weather file to epw_file passed to model. - weather.set_weather_file(model) return model end # Custom way to run the measure in the test. def run_measure(input_arguments, model)