Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More tests #248

Merged
merged 11 commits into from
Aug 28, 2023
4 changes: 2 additions & 2 deletions lib/measures/urban_geometry_creation/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def arguments(model)
surrounding_buildings.setDefaultValue('ShadingOnly')
args << surrounding_buildings
# not a required argument
scale_footprint_area_by_floor_area = OpenStudio::Ruleset::OSArgument.makeBoolArgument('scale_footprint_area_by_floor_area', false)
scale_footprint_area_by_floor_area.setDisplayName('Scale Footprint Area by the Floor Area?')
scale_footprint_area_by_floor_area = OpenStudio::Measure::OSArgument.makeBoolArgument('scale_footprint_area_by_floor_area', false)
scale_footprint_area_by_floor_area.setDisplayName('Scale Footprint Area by the Floor Area')
scale_footprint_area_by_floor_area.setDescription('If true, the footprint area from GeoJSON will be scaled by the floor_area provided by the user in URBANopt.')
scale_footprint_area_by_floor_area.setDefaultValue(false)
args << scale_footprint_area_by_floor_area
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
require_relative '../measure'
require 'fileutils'

class UrbanGeometryCreationTest < MiniTest::Unit::TestCase
class UrbanGeometryCreationTest < MiniTest::Test
def test_shadowed_case
denver_zoo = OpenStudio::PointLatLon.new(39.749242, -104.951024, 0)
blocky = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
require_relative '../measure'
require 'fileutils'

class UrbanGeometryCreationTest < MiniTest::Unit::TestCase
class UrbanGeometryCreationTest < MiniTest::Test
def test_one_building
# create an instance of the measure
measure = UrbanGeometryCreation.new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require_relative '../measure.rb'
require 'fileutils'

class UrbanGeometryCreationZoningTest < MiniTest::Unit::TestCase
class UrbanGeometryCreationZoningTest < MiniTest::Test
def test_one_building
# create an instance of the measure
measure = UrbanGeometryCreationZoning.new
Expand Down
5 changes: 4 additions & 1 deletion lib/urbanopt/geojson/geo_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def self.from_file(path)
raise('No name found for Building Feature')
end
if feature[:properties][:number_of_stories].nil?
@@logger.warn("Number of stories is required to calculate shading using the UrbanGeometryCreation measure...ignoring #{feature[:properties][:id]} in shading calculations")
@@logger.warn("Number of stories is required to calculate shading using the UrbanGeometryCreation measure.\n" \
"Not validating #{feature[:properties][:id]} against schema and ignoring in shading calculations")
end
feature[:additionalProperties] = true
# In case hpxml_directory present check for fewer properties
Expand All @@ -95,6 +96,8 @@ def self.from_file(path)
if feature[:properties][:name].nil?
raise('No name found for Building Feature')
end
@@logger.warn("OS-HPXML files may not conform to schema, which is usually ok.\n" \
"Not validating #{feature[:properties][:id]} against schema")
# Else validate for all required properties in the schema
else
errors = validate(@@building_schema, properties)
Expand Down
Loading