honeybee-openstudio 2.18.0 → 2.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe82ab879bf620ce30c665948e97a2b078e8b3c5899cbecea1ae0cc0b319c80e
4
- data.tar.gz: c86bad1a3e7fe7a0c7e8ccbe2900774a561a46056dae0450ed2998d2e29213b4
3
+ metadata.gz: 360f33826c9c5ac0030753392e25e8c49b9be52b68ec03da684fd20503c3e1f8
4
+ data.tar.gz: b8d57eab2e20d6dcb19220dcca07091ffc768bd1686fa6f156a013fa5470b863
5
5
  SHA512:
6
- metadata.gz: a86ca8992989da3f1f4a5642b55ece1c920e0378a82d8bf55e6362546375cc9fb66f1d0d4e69e74c3803678a77c168b87b733f58a2851b2eafebac0db4386190
7
- data.tar.gz: 67740da44c34b3408f248a7be3d6a02fb1c9c76524dec2a7cf9fda9755ee923baa443f5f65b136c0d0fcb4d7ca956a8ffe9130715b1369f3413a7534ad34f88f
6
+ metadata.gz: 39d194113026357c05405ee505e7f4b39711fd6cf45536195aa515fff2a7cc6dbfb22592fac28fb6c359c5e1458573697723377348be1bf90034fbf7df7262cc
7
+ data.tar.gz: 95fcfdd2b144d870cebbe2e88bf2a3a139b9ae93c9fa2c0906eee93870e4d280472639ecaf19fcbd8188d09af5866e62f9f8c9f34e84717439b0fcce95a70d5a
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'honeybee-openstudio'
7
- spec.version = '2.18.0'
7
+ spec.version = '2.18.1'
8
8
  spec.authors = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
9
9
  spec.email = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
10
10
 
@@ -71,7 +71,10 @@ module Honeybee
71
71
 
72
72
  construction = sub_surface.construction
73
73
  if !construction.empty?
74
- hash[:construction] = construction.get.nameString
74
+ constr_id = construction.get.nameString
75
+ unless $window_constructions[constr_id].nil?
76
+ hash[:construction] = constr_id
77
+ end
75
78
  end
76
79
 
77
80
  hash
@@ -71,7 +71,12 @@ module Honeybee
71
71
 
72
72
  construction = sub_surface.construction
73
73
  if !construction.empty?
74
- hash[:construction] = construction.get.nameString
74
+ constr_id = construction.get.nameString
75
+ if hash[:is_glass] && !$window_constructions[constr_id].nil?
76
+ hash[:construction] = constr_id
77
+ elsif !hash[:is_glass] && !$opaque_constructions[constr_id].nil?
78
+ hash[:construction] = constr_id
79
+ end
75
80
  end
76
81
 
77
82
  hash
@@ -73,7 +73,10 @@ module Honeybee
73
73
 
74
74
  construction = surface.construction
75
75
  if !construction.empty?
76
- hash[:construction] = construction.get.nameString
76
+ constr_id = construction.get.nameString
77
+ unless $opaque_constructions[constr_id].nil?
78
+ hash[:construction] = constr_id
79
+ end
77
80
  end
78
81
 
79
82
  hash
@@ -63,10 +63,10 @@ module Honeybee
63
63
  if !construction.empty?
64
64
  const_name = construction.get.nameString
65
65
  hash[:construction] = const_name
66
- unless $shade_construction.has_key?(const_name)
66
+ unless $shade_constructions.has_key?(const_name)
67
67
  const_obj = construction.get
68
68
  const = const_obj.to_LayeredConstruction.get
69
- $shade_construction[const_name] = const
69
+ $shade_constructions[const_name] = const
70
70
  end
71
71
  end
72
72
 
@@ -61,8 +61,10 @@ module Honeybee
61
61
  hash[:tolerance] = 0.01
62
62
  hash[:angle_tolerance] = 1.0
63
63
 
64
- # Hash for all shade constructions in the model
65
- $shade_construction = {}
64
+ # Hashes for all constructions in the model
65
+ $opaque_constructions = {}
66
+ $window_constructions = {}
67
+ $shade_constructions = {}
66
68
  hash[:properties] = properties_from_model(openstudio_model)
67
69
 
68
70
  rooms = rooms_from_model(openstudio_model)
@@ -71,8 +73,8 @@ module Honeybee
71
73
  orphaned_shades = orphaned_shades_from_model(openstudio_model)
72
74
  hash[:orphaned_shades] = orphaned_shades if !orphaned_shades.empty?
73
75
 
74
- unless $shade_construction.empty?
75
- shade_constructions_from_model($shade_construction).each do |shade_const|
76
+ unless $shade_constructions.empty?
77
+ shade_constructions_from_model($shade_constructions).each do |shade_const|
76
78
  hash[:properties][:energy][:constructions] << shade_const
77
79
  end
78
80
  end
@@ -215,16 +217,22 @@ module Honeybee
215
217
  window_construction = false
216
218
  opaque_construction = false
217
219
  material = construction.layers[0]
218
- if material.to_StandardGlazing.is_initialized or material.to_SimpleGlazing.is_initialized
219
- window_construction = true
220
- elsif material.to_StandardOpaqueMaterial.is_initialized or material.to_MasslessOpaqueMaterial.is_initialized
221
- opaque_construction = true
222
- end
223
- if window_construction == true
224
- result << WindowConstructionAbridged.from_construction(construction)
225
- end
226
- if opaque_construction == true
227
- result << OpaqueConstructionAbridged.from_construction(construction)
220
+ unless material.nil?
221
+ if material.to_StandardGlazing.is_initialized or material.to_SimpleGlazing.is_initialized
222
+ window_construction = true
223
+ elsif material.to_StandardOpaqueMaterial.is_initialized or material.to_MasslessOpaqueMaterial.is_initialized
224
+ opaque_construction = true
225
+ end
226
+ if window_construction == true
227
+ constr_hash = WindowConstructionAbridged.from_construction(construction)
228
+ $window_constructions[constr_hash[:identifier]] = constr_hash
229
+ result << constr_hash
230
+ end
231
+ if opaque_construction == true
232
+ constr_hash = OpaqueConstructionAbridged.from_construction(construction)
233
+ $opaque_constructions[constr_hash[:identifier]] = constr_hash
234
+ result << constr_hash
235
+ end
228
236
  end
229
237
  end
230
238
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybee-openstudio
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.0
4
+ version: 2.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanushree Charan
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-06-12 00:00:00.000000000 Z
14
+ date: 2021-06-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler