honeybee-openstudio 2.35.0 → 2.35.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8253cfd61ddf3f1e838d50f9c72d650e4373b3b19347f9975f2efe48c1ed81b9
4
- data.tar.gz: 9d862528a0f8dd57a82964aa50e897096e03dbbc7d3d0ccadcde6bc7e3d4a7c8
3
+ metadata.gz: eadf72cc6184d0f30705481227c69a6bb35a17485856a641a841c797f720bd46
4
+ data.tar.gz: cbff4e6067b9be01c1df2b545c4a181f863f9a51a5c5cc4f2c6bd5a301558e19
5
5
  SHA512:
6
- metadata.gz: ee63cd76ff125f23eada0492a8fe65ddfa6e07a550fdb8683b9595ff3024f48a9526a891be463d0ae4ad1fd96f3385ff00b748deda58041340783f469553a186
7
- data.tar.gz: ac10d61f84602af26558f4a2091cee8200ba1c2be0330cf0ac114035439dc8b6729eee52c9457afed7af2de1102eff23571dfbf3b82558dc214f567e313e2e57
6
+ metadata.gz: 4e91999590b5b8b2f15bca7cc073beafd4d310507064b2eea7e883069fcfb761301d3cf22147ef9cdb1fe11cb6db967d06417d1c82534d7b821ef69cc3dc8300
7
+ data.tar.gz: 6c3aaad16d195b28a4434365d2d94dacd6e639f4baba7ff016b53c16bb0d31105157b59c9417ee5c0d2f9b25f5a735fad265751e771a82e131e9a089482323f4
@@ -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.35.0'
7
+ spec.version = '2.35.2'
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
 
@@ -112,8 +112,8 @@ module Honeybee
112
112
  end
113
113
 
114
114
  # Create Honeybee Model JSON from SDD file
115
- def translate_from_sdd_file(file)
116
- translator = OpenStudio::SDD::ReverseTranslator.new
115
+ def self.translate_from_sdd_file(file)
116
+ translator = OpenStudio::SDD::SddReverseTranslator.new
117
117
  openstudio_model = translator.loadModel(file)
118
118
  raise "Cannot load SDD file at '#{}'" if openstudio_model.empty?
119
119
  self.translate_from_openstudio(openstudio_model.get)
@@ -37,6 +37,7 @@ require 'to_openstudio'
37
37
  require 'fileutils'
38
38
  require 'pathname'
39
39
  require 'json'
40
+ require 'open3'
40
41
 
41
42
  # start the measure
42
43
  class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
@@ -133,7 +134,12 @@ class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
133
134
  model.save(osm_path, true)
134
135
  # call the Ironbug console to add the HVAC to the OSM
135
136
  ironbug_exe = '"' + $ironbug_exe + '"'
136
- system(ironbug_exe + ' "' + osm_path + '" "' + hvac_json_path + '"')
137
+ ib_cmd = ironbug_exe + ' "' + osm_path + '" "' + hvac_json_path + '"'
138
+ stdout, stderr, status = Open3.capture3(ib_cmd)
139
+ if status.exitstatus != 0
140
+ runner.registerError('Failed to apply IronBug HVAC:' + stderr)
141
+ return false
142
+ end
137
143
  # load the new model
138
144
  translator = OpenStudio::OSVersion::VersionTranslator.new
139
145
  o_model = translator.loadModel(osm_path)
@@ -162,61 +162,61 @@ module Honeybee
162
162
 
163
163
  return result
164
164
  end
165
- end # Door
166
165
 
167
- def to_openstudio_shade(openstudio_model, shading_surface_group)
168
- # get the vertices from the door
169
- if @hash[:geometry][:vertices].nil?
170
- hb_verts = @hash[:geometry][:boundary]
171
- else
172
- hb_verts = @hash[:geometry][:vertices]
173
- end
166
+ def to_openstudio_shade(openstudio_model, shading_surface_group)
167
+ # get the vertices from the door
168
+ if @hash[:geometry][:vertices].nil?
169
+ hb_verts = @hash[:geometry][:boundary]
170
+ else
171
+ hb_verts = @hash[:geometry][:vertices]
172
+ end
174
173
 
175
- # create the openstudio shading surface
176
- os_vertices = OpenStudio::Point3dVector.new
177
- hb_verts.each do |vertex|
178
- os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
179
- end
174
+ # create the openstudio shading surface
175
+ os_vertices = OpenStudio::Point3dVector.new
176
+ hb_verts.each do |vertex|
177
+ os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
178
+ end
180
179
 
181
- os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
182
- os_shading_surface.setName(@hash[:identifier])
183
- unless @hash[:display_name].nil?
184
- os_shading_surface.setDisplayName(@hash[:display_name])
185
- end
180
+ os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
181
+ os_shading_surface.setName(@hash[:identifier])
182
+ unless @hash[:display_name].nil?
183
+ os_shading_surface.setDisplayName(@hash[:display_name])
184
+ end
186
185
 
187
- # get the approriate construction id
188
- construction_id = nil
189
- if @hash[:properties].key?(:energy) && @hash[:properties][:energy][:construction]
190
- construction_id = @hash[:properties][:energy][:construction]
191
- elsif @hash[:is_glass] == true
192
- construction_id = 'Generic Double Pane'
193
- else
194
- construction_id = 'Generic Exterior Door'
195
- end
186
+ # get the approriate construction id
187
+ construction_id = nil
188
+ if @hash[:properties].key?(:energy) && @hash[:properties][:energy][:construction]
189
+ construction_id = @hash[:properties][:energy][:construction]
190
+ elsif @hash[:is_glass] == true
191
+ construction_id = 'Generic Double Pane'
192
+ else
193
+ construction_id = 'Generic Exterior Door'
194
+ end
196
195
 
197
- # assign the construction
198
- unless construction_id.nil?
199
- construction = openstudio_model.getConstructionByName(construction_id)
200
- unless construction.empty?
201
- os_construction = construction.get
202
- os_shading_surface.setConstruction(os_construction)
196
+ # assign the construction
197
+ unless construction_id.nil?
198
+ construction = openstudio_model.getConstructionByName(construction_id)
199
+ unless construction.empty?
200
+ os_construction = construction.get
201
+ os_shading_surface.setConstruction(os_construction)
202
+ end
203
203
  end
204
- end
205
204
 
206
- # add a transmittance schedule if a value is found
207
- if @hash[:transmit]
208
- schedule_identifier = 'Constant ' + @hash[:transmit] + ' Transmittance'
209
- schedule = openstudio_model.getScheduleByName(schedule_identifier)
210
- unless schedule.empty?
211
- os_schedule = schedule.get
212
- os_shading_surface.setTransmittanceSchedule(os_schedule)
205
+ # add a transmittance schedule if a value is found
206
+ if @hash[:transmit]
207
+ schedule_identifier = 'Constant ' + @hash[:transmit] + ' Transmittance'
208
+ schedule = openstudio_model.getScheduleByName(schedule_identifier)
209
+ unless schedule.empty?
210
+ os_schedule = schedule.get
211
+ os_shading_surface.setTransmittanceSchedule(os_schedule)
212
+ end
213
213
  end
214
- end
215
214
 
216
- # add the shade to the group
217
- os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
215
+ # add the shade to the group
216
+ os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
218
217
 
219
- os_shading_surface
220
- end
218
+ os_shading_surface
219
+ end
221
220
 
221
+ end # Door
222
222
  end # Honeybee
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.35.0
4
+ version: 2.35.2
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: 2023-08-09 00:00:00.000000000 Z
14
+ date: 2023-11-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json_pure