openstudio-model-articulation 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/Rakefile +20 -1
  4. data/lib/measures/AssignConstructionSetToBuilding/measure.rb +2 -0
  5. data/lib/measures/AssignSpaceTypeBySpaceName/measure.rb +2 -0
  6. data/lib/measures/AssignSpaceTypeToBuilding/measure.rb +2 -0
  7. data/lib/measures/AssignSpacesToStories/measure.rb +2 -0
  8. data/lib/measures/BarAspectRatioSlicedBySpaceType/measure.rb +2 -0
  9. data/lib/measures/BarAspectRatioSlicedBySpaceType/measure.xml +0 -6
  10. data/lib/measures/BarAspectRatioSlicedBySpaceType/resources/os_lib_cofee.rb +2 -0
  11. data/lib/measures/BarAspectRatioStudy/measure.rb +2 -0
  12. data/lib/measures/CleanupSpaceOrigins/measure.rb +2 -0
  13. data/lib/measures/FindAndReplaceObjectNames/measure.rb +2 -0
  14. data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.rb +2 -0
  15. data/lib/measures/InjectOsmGeometryIntoAnExternalIdf/measure.xml +9 -9
  16. data/lib/measures/RemoveHardAssignedConstructions/measure.rb +2 -0
  17. data/lib/measures/RenameSpaceSurfacesBasedonParentSpaceandOrientation/measure.rb +2 -0
  18. data/lib/measures/RotateBuilding/measure.rb +2 -0
  19. data/lib/measures/SetExtWallToGroundBoundaryConditionByStory/measure.rb +2 -0
  20. data/lib/measures/SetInteriorWallsAndFloorsToAdiabatic/measure.rb +2 -0
  21. data/lib/measures/SetInteriorWallsToSelectedConstruction/measure.rb +2 -0
  22. data/lib/measures/SetWindowToWallRatioByFacade/measure.rb +21 -31
  23. data/lib/measures/SetWindowToWallRatioByFacade/measure.xml +4 -4
  24. data/lib/measures/SimplifyGeometryToSlicedBar/measure.rb +2 -0
  25. data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_cofee.rb +2 -0
  26. data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_geometry.rb +2 -0
  27. data/lib/measures/SimplifyGeometryToSlicedBar/resources/os_lib_helper_methods.rb +3 -1
  28. data/lib/measures/SpaceTypeAndConstructionSetWizard/measure.rb +2 -0
  29. data/lib/measures/SpaceTypeAndConstructionSetWizard/measure.xml +1 -1
  30. data/lib/measures/SurfaceMatching/measure.rb +2 -0
  31. data/lib/measures/blended_space_type_from_floor_area_ratios/measure.rb +2 -0
  32. data/lib/measures/blended_space_type_from_model/measure.rb +2 -0
  33. data/lib/measures/blended_space_type_from_model/resources/os_lib_model_simplification.rb +2 -0
  34. data/lib/measures/clone_building_from_external_model/measure.rb +2 -0
  35. data/lib/measures/clone_building_from_external_model/measure.xml +4 -4
  36. data/lib/measures/create_DOE_prototype_building/measure.rb +8 -1
  37. data/lib/measures/create_DOE_prototype_building/measure.xml +2 -2
  38. data/lib/measures/create_and_assign_thermal_zones_for_unassigned_spaces/measure.rb +2 -0
  39. data/lib/measures/create_bar_from_building_type_ratios/measure.rb +3 -1
  40. data/lib/measures/create_bar_from_deer_building_type_ratios/measure.rb +2 -0
  41. data/lib/measures/create_bar_from_doe_building_type_ratios/measure.rb +2 -0
  42. data/lib/measures/create_bar_from_model/measure.rb +2 -0
  43. data/lib/measures/create_baseline_building/measure.rb +3 -1
  44. data/lib/measures/create_baseline_building/measure.xml +2 -2
  45. data/lib/measures/create_deer_prototype_building/measure.rb +2 -0
  46. data/lib/measures/create_deer_prototype_building/measure.xml +2 -2
  47. data/lib/measures/create_deer_prototype_building/resources/deer_building_types.rb +2 -0
  48. data/lib/measures/create_parametric_schedules/measure.rb +2 -0
  49. data/lib/measures/create_typical_building_from_model/measure.rb +2 -0
  50. data/lib/measures/create_typical_building_from_model/measure.xml +11 -11
  51. data/lib/measures/create_typical_building_from_model/resources/Model.hvac.rb +3 -1
  52. data/lib/measures/create_typical_deer_building_from_model/measure.rb +2 -0
  53. data/lib/measures/create_typical_deer_building_from_model/measure.xml +11 -11
  54. data/lib/measures/create_typical_deer_building_from_model/resources/Model.hvac.rb +3 -1
  55. data/lib/measures/create_typical_doe_building_from_model/measure.rb +2 -0
  56. data/lib/measures/create_typical_doe_building_from_model/measure.xml +19 -19
  57. data/lib/measures/create_typical_doe_building_from_model/resources/Model.hvac.rb +3 -1
  58. data/lib/measures/deer_space_type_and_construction_set_wizard/measure.rb +2 -0
  59. data/lib/measures/find_and_replace_in_all_thermal_zone_names/measure.rb +2 -0
  60. data/lib/measures/make_shading_surfaces_based_on_zone_multipliers/measure.rb +2 -0
  61. data/lib/measures/merge_floorspace_js_with_model/measure.rb +2 -0
  62. data/lib/measures/merge_floorspace_js_with_model/measure.xml +9 -15
  63. data/lib/measures/merge_spaces_from_external_file/measure.rb +2 -0
  64. data/lib/measures/merge_spaces_from_external_file/measure.xml +4 -4
  65. data/lib/measures/merge_spaces_from_external_file/resources/ScheduleTranslator.rb +6 -4
  66. data/lib/measures/radiance_measure/measure.rb +2 -0
  67. data/lib/measures/radiance_measure/measure.xml +9 -9
  68. data/lib/measures/radiant_slab_with_doas/LICENSE.md +27 -0
  69. data/lib/measures/radiant_slab_with_doas/README.md +156 -0
  70. data/lib/measures/radiant_slab_with_doas/README.md.erb +42 -0
  71. data/lib/measures/radiant_slab_with_doas/measure.rb +406 -0
  72. data/lib/measures/radiant_slab_with_doas/measure.xml +346 -0
  73. data/lib/measures/replace_geometry_by_story/measure.rb +2 -0
  74. data/lib/measures/scale_geometry/measure.rb +2 -0
  75. data/lib/openstudio/model_articulation/version.rb +1 -1
  76. metadata +12 -8
  77. data/lib/measures/merge_floorspace_js_with_model/docs/.gitkeep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e708b3df293c1aeae3dad691814dc041b3a3717f6bdec257d12053a1a272ec29
4
- data.tar.gz: 26c06c5f6e6a7ccfd8d32d789c0fe1a6db84ffc489c23793cf480ec7224fcf47
3
+ metadata.gz: ba519a8dc1aaa822a60d944a97d548f9ab33b0dd5be3833d274453bbd523d785
4
+ data.tar.gz: 05aa260fa5e8a14aeca00d85a9f0bb30a1a04a55f9545650d71b0230ac366b88
5
5
  SHA512:
6
- metadata.gz: 9635598056aaee1e853136ad938176a5c73fea13b3c6931ebe4d58b156bf7bf87f906247f39abf31ac4a47a63b2468776c8045706bd75757c019d58b7a002c9d
7
- data.tar.gz: ec11f7fae93230715cefed4f1e9ad7bd64bfb883575a41a57beb2d2ff28eddac5d551e8a6150a22833c9ec40bdad04f49ef745b1ecc2cb460e87022c8bb24cb6
6
+ metadata.gz: 14f1b3be45603f98d6f9f1268888a29c10dc6e2218b440717863e3118260b9eed133320f9332fe02bee4a1d11337a329caa673f737b5e57baaa3a643b02469b0
7
+ data.tar.gz: 344bb6bcbc66ffde8aff858b7829599de5cbfca0d4efcbbbac3a91e3a45f6ca6630b5393075222e2259b3ba261b00a9211f02c161c036222037878e6ae0853f1
@@ -1,5 +1,26 @@
1
1
  # OpenStudio Model Articulation Gems
2
2
 
3
+ ## Version 0.2.1
4
+ * Add rubocop to Rakefile
5
+ * Updates the following in lib/measures:
6
+ * BarAspectRationSlicedBySpaceType
7
+ * InjectOsmGeometryIntoAnExternalIdf
8
+ * SetWindowToWallRatioByFacade
9
+ * SpaceTypeAndConstructionSetWizard
10
+ * clone_building_from_external_model
11
+ * create_DOE_prototype_building
12
+ * create_baseline_building
13
+ * create_deer_prototype_building
14
+ * create_typical_building_from_model
15
+ * create_typical_deer_building_from_model
16
+ * create_typical_doe_building_from_model
17
+ * merge_floorspace_js_with_model
18
+ * merge_spaces_from_external_file
19
+ * radiance_measure
20
+ * Adds the following to lib/measures:
21
+ * radiant_slab_with_doas
22
+
23
+
3
24
  ## Version 0.2.0
4
25
 
5
26
  * Support for OpenStudio 3.0
data/Rakefile CHANGED
@@ -38,13 +38,32 @@ require 'rspec/core/rake_task'
38
38
 
39
39
  RSpec::Core::RakeTask.new(:spec)
40
40
 
41
+ require 'rubocop/rake_task'
42
+ RuboCop::RakeTask.new
43
+
41
44
  # Load in the rake tasks from the base extension gem
42
45
  require 'openstudio/extension/rake_task'
43
46
  require 'openstudio/model_articulation'
44
47
  rake_task = OpenStudio::Extension::RakeTask.new
45
- rake_task.set_extension_class(OpenStudio::ModelArticulation::Extension)
48
+ rake_task.set_extension_class(OpenStudio::ModelArticulation::Extension, 'nrel/openstudio-model-articulation-gem')
46
49
 
47
50
  require 'openstudio_measure_tester/rake_task'
48
51
  OpenStudioMeasureTester::RakeTask.new
49
52
 
50
53
  task default: :spec
54
+
55
+ desc 'Delete measure test output'
56
+ task :delete_measure_test_outputs do
57
+ require 'fileutils'
58
+
59
+ puts 'Deleting tests/output directory from measures.'
60
+
61
+ # get measures in repo
62
+ measures = Dir.glob('**/**/**/measure.rb')
63
+
64
+ # create unique list of parent directories for measures.
65
+ measures.each do |i|
66
+ FileUtils.rm_rf(i.gsub('measure.rb', 'tests/output'))
67
+ end
68
+ puts 'deleteting test outputs'
69
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -85,12 +85,6 @@
85
85
  <usage_type>test</usage_type>
86
86
  <checksum>3FDFD18A</checksum>
87
87
  </file>
88
- <file>
89
- <filename>test.osm</filename>
90
- <filetype>osm</filetype>
91
- <usage_type>test</usage_type>
92
- <checksum>60715087</checksum>
93
- </file>
94
88
  <file>
95
89
  <filename>README.md</filename>
96
90
  <filetype>md</filetype>
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>inject_osm_geometry_into_an_external_idf</name>
5
5
  <uid>633cd1c5-5b55-4b50-ab20-cf2d2f7ddff8</uid>
6
- <version_id>3f37233f-eeaf-47d0-8a13-27c86aaf7b0b</version_id>
7
- <version_modified>20200509T155937Z</version_modified>
6
+ <version_id>280b80cc-c941-463b-bfd1-dbc3bd969f25</version_id>
7
+ <version_modified>20200624T003817Z</version_modified>
8
8
  <xml_checksum>3BE1CF9C</xml_checksum>
9
9
  <class_name>InjectOsmGeometryIntoAnExternalIdf</class_name>
10
10
  <display_name>InjectOsmGeometryIntoAnExternalIdf</display_name>
@@ -136,7 +136,7 @@ Constructions and other resources won?t be moved back and forth but the surface
136
136
  <checksum>56ED3E65</checksum>
137
137
  </file>
138
138
  <file>
139
- <filename>test.osw</filename>
139
+ <filename>measure_test.osw</filename>
140
140
  <filetype>osw</filetype>
141
141
  <usage_type>test</usage_type>
142
142
  <checksum>F5FABCCF</checksum>
@@ -159,12 +159,6 @@ Constructions and other resources won?t be moved back and forth but the surface
159
159
  <usage_type>readme</usage_type>
160
160
  <checksum>6FF2AF68</checksum>
161
161
  </file>
162
- <file>
163
- <filename>InjectOsmGeometryIntoAnExternalIdf_Test.rb</filename>
164
- <filetype>rb</filetype>
165
- <usage_type>test</usage_type>
166
- <checksum>91289177</checksum>
167
- </file>
168
162
  <file>
169
163
  <version>
170
164
  <software_program>OpenStudio</software_program>
@@ -176,5 +170,11 @@ Constructions and other resources won?t be moved back and forth but the surface
176
170
  <usage_type>script</usage_type>
177
171
  <checksum>A76C44E1</checksum>
178
172
  </file>
173
+ <file>
174
+ <filename>InjectOsmGeometryIntoAnExternalIdf_Test.rb</filename>
175
+ <filetype>rb</filetype>
176
+ <usage_type>test</usage_type>
177
+ <checksum>A4070AAC</checksum>
178
+ </file>
179
179
  </files>
180
180
  </measure>
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -176,7 +178,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
176
178
 
177
179
  # calculate initial envelope cost as negative value
178
180
  envelope_cost = 0
179
- constructions = model.getConstructions
181
+ constructions = model.getConstructions.sort
180
182
  constructions.each do |construction|
181
183
  const_llcs = construction.lifeCycleCosts
182
184
  const_llcs.each do |const_llc|
@@ -190,14 +192,14 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
190
192
  if exl_spaces_not_incl_fl_area
191
193
  # loop through spaces to gather surfaces.
192
194
  surfaces = []
193
- model.getSpaces.each do |space|
195
+ model.getSpaces.sort.each do |space|
194
196
  next if !space.partofTotalFloorArea
195
- space.surfaces.each do |surface|
197
+ space.surfaces.sort.each do |surface|
196
198
  surfaces << surface
197
199
  end
198
200
  end
199
201
  else
200
- surfaces = model.getSurfaces
202
+ surfaces = model.getSurfaces.sort
201
203
  end
202
204
 
203
205
  # used for new sub surfaces to find target construction
@@ -205,7 +207,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
205
207
  orig_sub_surf_const_for_target_all_ext = {}
206
208
 
207
209
  # pre-loop through sub-surfaces to store constructions
208
- model.getSubSurfaces.each do |sub_surf|
210
+ model.getSubSurfaces.sort.each do |sub_surf|
209
211
  # store constructions for entire building
210
212
  next if sub_surf.subSurfaceType == 'Door' || sub_surf.subSurfaceType == 'OverheadDoor'
211
213
  if sub_surf.construction.is_initialized
@@ -248,7 +250,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
248
250
  # hash for sub surfaces removed from non rectangular surfaces
249
251
  non_rect_parent = {}
250
252
 
251
- surfaces.each do |s|
253
+ surfaces.sort.each do |s|
252
254
  next if s.surfaceType != 'Wall'
253
255
  next if s.outsideBoundaryCondition != 'Outdoors'
254
256
  if s.space.empty?
@@ -296,7 +298,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
296
298
  # loop through sub surfaces and add area including multiplier
297
299
  ext_window_area = 0
298
300
  has_doors = false
299
- s.subSurfaces.each do |subSurface|
301
+ s.subSurfaces.sort.each do |subSurface|
300
302
  # stop if non window or glass door
301
303
  if subSurface.subSurfaceType == 'Door' || subSurface.subSurfaceType == 'OverheadDoor'
302
304
  if split_at_doors == 'Remove Doors'
@@ -321,7 +323,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
321
323
  split_surfaces = s.splitSurfaceForSubSurfaces.to_a # frozen array
322
324
 
323
325
  # add original surface to new surfaces
324
- split_surfaces.each do |ss|
326
+ split_surfaces.sort.each do |ss|
325
327
  all_surfaces << ss
326
328
  end
327
329
  end
@@ -329,7 +331,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
329
331
  if wwr > 0 && triangulate
330
332
 
331
333
  all_surfaces2 = []
332
- all_surfaces.each do |ss|
334
+ all_surfaces.sort.each do |ss|
333
335
  # see if surface is rectangular (only checking non rotated on vertical wall)
334
336
  # todo - add in more robust rectangle check that can look for rotate and tilted rectangles
335
337
  rect_tri = false
@@ -350,7 +352,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
350
352
  end
351
353
 
352
354
  has_doors = false
353
- ss.subSurfaces.each do |subSurface|
355
+ ss.subSurfaces.sort.each do |subSurface|
354
356
  if subSurface.subSurfaceType == 'Door' || subSurface.subSurfaceType == 'OverheadDoor'
355
357
  has_doors = true
356
358
  end
@@ -366,7 +368,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
366
368
 
367
369
  # get construction from sub-surfaces and then delete them
368
370
  pre_tri_sub_const = {}
369
- ss.subSurfaces.each do |subSurface|
371
+ ss.subSurfaces.sort.each do |subSurface|
370
372
  if subSurface.construction.is_initialized && !subSurface.isConstructionDefaulted
371
373
  if pre_tri_sub_const.key?(subSurface.construction.get)
372
374
  pre_tri_sub_const[subSurface.construction.get] = subSurface.grossArea
@@ -398,9 +400,9 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
398
400
  end
399
401
 
400
402
  # add windows
401
- all_surfaces2.each do |ss|
403
+ all_surfaces2.sort.each do |ss|
402
404
  orig_sub_surf_constructions = {}
403
- ss.subSurfaces.each do |sub_surf|
405
+ ss.subSurfaces.sort.each do |sub_surf|
404
406
  next if sub_surf.subSurfaceType == 'Door' || sub_surf.subSurfaceType == 'OverheadDoor'
405
407
  if sub_surf.construction.is_initialized
406
408
  if orig_sub_surf_constructions.key?(sub_surf.construction.get)
@@ -414,7 +416,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
414
416
  # remove windows if ratio 0 or add in other cases
415
417
  if wwr == 0
416
418
  # remove all sub surfaces
417
- ss.subSurfaces.each(&:remove)
419
+ ss.subSurfaces.sort.each(&:remove)
418
420
  new_window = []
419
421
  window_confirmed = true
420
422
  else
@@ -522,7 +524,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
522
524
  end
523
525
 
524
526
  # data for final condition wwr
525
- surfaces.each do |s|
527
+ surfaces.sort.each do |s|
526
528
  next if s.surfaceType != 'Wall'
527
529
  next if s.outsideBoundaryCondition != 'Outdoors'
528
530
  if s.space.empty?
@@ -565,7 +567,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
565
567
 
566
568
  # loop through sub surfaces and add area including multiplier
567
569
  ext_window_area = 0
568
- s.subSurfaces.each do |subSurface| # onlky one and should have multiplier of 1
570
+ s.subSurfaces.sort.each do |subSurface| # onlky one and should have multiplier of 1
569
571
  ext_window_area += subSurface.grossArea * subSurface.multiplier * zone_multiplier
570
572
  end
571
573
 
@@ -573,27 +575,15 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
573
575
  final_ext_window_area += ext_window_area
574
576
  end
575
577
 
576
- # short def to make numbers pretty (converts 4125001.25641 to 4,125,001.26 or 4,125,001). The definition be called through this measure
577
- def neat_numbers(number, roundto = 2) # round to 0 or 2)
578
- # round to zero or two decimals
579
- if roundto == 2
580
- number = format '%.2f', number
581
- else
582
- number = number.round
583
- end
584
- # regex to add commas
585
- number.to_s.reverse.gsub(/([0-9]{3}(?=([0-9])))/, '\\1,').reverse
586
- end
587
-
588
578
  # get delta in ft^2 for final - starting window area
589
579
  increase_window_area_si = OpenStudio::Quantity.new(final_ext_window_area - starting_ext_window_area, unit_area_si)
590
580
  increase_window_area_ip = OpenStudio.convert(increase_window_area_si, unit_area_ip).get
591
581
 
592
582
  # calculate final envelope cost as positive value
593
- constructions = model.getConstructions
583
+ constructions = model.getConstructions.sort
594
584
  constructions.each do |construction|
595
585
  const_llcs = construction.lifeCycleCosts
596
- const_llcs.each do |const_llc|
586
+ const_llcs.sort.each do |const_llc|
597
587
  if const_llc.category == 'Construction'
598
588
  envelope_cost += const_llc.totalCost
599
589
  end
@@ -602,7 +592,7 @@ class SetWindowToWallRatioByFacade < OpenStudio::Measure::ModelMeasure
602
592
 
603
593
  # report final condition
604
594
  final_wwr = format('%.02f', (final_ext_window_area / final_gross_ext_wall_area))
605
- runner.registerFinalCondition("The model's final window to wall ratio for #{facade} facing exterior walls is #{final_wwr}. Window area increased by #{neat_numbers(increase_window_area_ip.value, 0)} (ft^2). The material and construction costs increased by $#{neat_numbers(envelope_cost, 0)}.")
595
+ runner.registerFinalCondition("The model's final window to wall ratio for #{facade} facing exterior walls is #{final_wwr}. Window area increased by #{OpenStudio.toNeatString(increase_window_area_ip.value, 0)} (ft^2). The material and construction costs increased by $#{OpenStudio.toNeatString(envelope_cost, 0)}.")
606
596
 
607
597
  return true
608
598
  end
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>set_window_to_wall_ratio_by_facade</name>
5
5
  <uid>c567a0bf-a7d9-4a06-afe9-bf7df79e6bf8</uid>
6
- <version_id>69309ebe-fd01-407e-9332-ff5e0848a670</version_id>
7
- <version_modified>20200421T224712Z</version_modified>
6
+ <version_id>ba8a1d2e-0d49-4e86-9aba-f4d55097f358</version_id>
7
+ <version_modified>20200928T200703Z</version_modified>
8
8
  <xml_checksum>6DE831F7</xml_checksum>
9
9
  <class_name>SetWindowToWallRatioByFacade</class_name>
10
10
  <display_name>Set Window to Wall Ratio by Facade</display_name>
@@ -233,13 +233,13 @@ The measure doesn?t have any cost or lifecycle arguments, however If lifecycle o
233
233
  <filename>measure.rb</filename>
234
234
  <filetype>rb</filetype>
235
235
  <usage_type>script</usage_type>
236
- <checksum>FCC2E4DD</checksum>
236
+ <checksum>CB9895D2</checksum>
237
237
  </file>
238
238
  <file>
239
239
  <filename>SetWindowToWallRatioByFacade_Test.rb</filename>
240
240
  <filetype>rb</filetype>
241
241
  <usage_type>test</usage_type>
242
- <checksum>580F468D</checksum>
242
+ <checksum>268FC2B7</checksum>
243
243
  </file>
244
244
  </files>
245
245
  </measure>
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # *******************************************************************************
2
4
  # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
5
  # All rights reserved.