honeybee-openstudio 2.23.3 → 2.23.7

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: 7e45179d0b62e6863ab40aa357fad8601ba8e66770756b652647784027b2548a
4
- data.tar.gz: fd1e685397b0acca36ffcbb18fc9bfc5aed66236f30e37323caa76e033c78127
3
+ metadata.gz: 37bac7a5ba65cf8d92aaf98bfa2edc7b5778091b666ae9f3b5f00aa8c50bd478
4
+ data.tar.gz: 37955c43078610c4167847805469d4172475eaa8025082ed87b179b168284648
5
5
  SHA512:
6
- metadata.gz: 938a7678b59f42e72187d2241c20b65479b6c7ae0daaae7c51cb92b35779c5470475ff6cd631b49a37eeb34dc6fee5558319979feb5048c50a11a1a407a09cb5
7
- data.tar.gz: e39f4f8851d6f4c9fc15683b987c0a9f8fd2ecfb44f53c2d93eda9d40f27b7f25b81797ea5b5debcafb9ddef60ad2688c37ba5dffdc9c0e68e706a494ebf36fd
6
+ metadata.gz: 6562498061cef3f37bc83a3dfd8f5bb22e913d8f724d449c245a6cd1032916c9fe875101b41033a643680384c443fa94278dbaa32c40ea747ecf285b8d77118a
7
+ data.tar.gz: c59a06fa704b4312d73959d0edb848c867290f87061fcc4d8decb4a34ee11dff5570016714681cf4940aea9012cc1c6230c400ef9aef5d0a3f349a65192ee8b1
@@ -33,7 +33,7 @@ jobs:
33
33
  - name: set up node # we need node for for semantic release
34
34
  uses: actions/setup-node@v2.1.2
35
35
  with:
36
- node-version: 14.2.0
36
+ node-version: 14.17.0
37
37
  - name: install semantic-release
38
38
  run:
39
39
  npm install @semantic-release/exec
@@ -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.23.3'
7
+ spec.version = '2.23.7'
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
 
@@ -34,7 +34,7 @@ require 'openstudio/workflow/adapters/output_adapter'
34
34
  # Local file based workflow
35
35
  class HoneybeeAdapter < OpenStudio::Workflow::OutputAdapters
36
36
  def initialize(options = {})
37
- puts "viiiiiiiiiiiiizzzzzzzzz!"
37
+
38
38
  STDOUT.flush
39
39
  super
40
40
  end
@@ -72,7 +72,7 @@ module Honeybee
72
72
  unless sub_surface.isConstructionDefaulted
73
73
  construction = sub_surface.construction
74
74
  if !construction.empty?
75
- constr_id = construction.get.nameString
75
+ constr_id = clean_identifier(construction.get.nameString)
76
76
  unless $window_constructions[constr_id].nil?
77
77
  hash[:construction] = constr_id
78
78
  end
@@ -72,7 +72,7 @@ module Honeybee
72
72
  unless sub_surface.isConstructionDefaulted
73
73
  construction = sub_surface.construction
74
74
  if !construction.empty?
75
- constr_id = construction.get.nameString
75
+ constr_id = clean_identifier(construction.get.nameString)
76
76
  if hash[:is_glass] && !$window_constructions[constr_id].nil?
77
77
  hash[:construction] = constr_id
78
78
  elsif !hash[:is_glass] && !$opaque_constructions[constr_id].nil?
@@ -74,7 +74,7 @@ module Honeybee
74
74
  unless surface.isConstructionDefaulted
75
75
  construction = surface.construction
76
76
  if !construction.empty?
77
- constr_id = construction.get.nameString
77
+ constr_id = clean_identifier(construction.get.nameString)
78
78
  unless $opaque_constructions[constr_id].nil?
79
79
  hash[:construction] = constr_id
80
80
  end
@@ -112,7 +112,7 @@ module Honeybee
112
112
  def self.story_from_space(space)
113
113
  story = space.buildingStory
114
114
  if !story.empty?
115
- return story.get.nameString
115
+ return clean_identifier(story.get.nameString)
116
116
  end
117
117
  nil
118
118
  end
@@ -62,7 +62,7 @@ module Honeybee
62
62
  unless shading_surface.isConstructionDefaulted
63
63
  construction = shading_surface.construction
64
64
  if !construction.empty?
65
- const_name = construction.get.nameString
65
+ const_name = clean_identifier(construction.get.nameString)
66
66
  hash[:construction] = const_name
67
67
  unless $shade_constructions.has_key?(const_name)
68
68
  const_obj = construction.get
@@ -74,7 +74,10 @@ module Honeybee
74
74
 
75
75
  transmittance_schedule = shading_surface.transmittanceSchedule
76
76
  if !transmittance_schedule.empty?
77
- hash[:transmittance_schedule] = transmittance_schedule.get.nameString
77
+ trans_sch_name = clean_identifier(transmittance_schedule.get.nameString)
78
+ unless $schedules[trans_sch_name].nil?
79
+ hash[:transmittance_schedule] = trans_sch_name
80
+ end
78
81
  end
79
82
 
80
83
  hash
@@ -64,7 +64,8 @@ module Honeybee
64
64
  hash[:tolerance] = 0.01
65
65
  hash[:angle_tolerance] = 1.0
66
66
 
67
- # Hashes for all constructions in the model
67
+ # Hashes for all shcedules and constructions in the model
68
+ $schedules = {}
68
69
  $opaque_constructions = {}
69
70
  $window_constructions = {}
70
71
  $shade_constructions = {}
@@ -282,7 +283,9 @@ module Honeybee
282
283
  def self.scheduleruleset_from_model(openstudio_model)
283
284
  result = []
284
285
  openstudio_model.getScheduleRulesets.each do |sch_ruleset|
285
- result << ScheduleRulesetAbridged.from_schedule_ruleset(sch_ruleset)
286
+ sched_hash = ScheduleRulesetAbridged.from_schedule_ruleset(sch_ruleset)
287
+ $schedules[sched_hash[:identifier]] = sched_hash
288
+ result << sched_hash
286
289
  end
287
290
  result
288
291
  end
@@ -37,7 +37,7 @@ module Honeybee
37
37
  def self.from_design_day(design_day)
38
38
  hash = {}
39
39
  hash[:type] = 'DesignDay'
40
- hash[:name] = design_day.nameString
40
+ hash[:name] = clean_identifier(design_day.nameString)
41
41
  hash[:day_type] = day_type_from_design_day(design_day)
42
42
  hash[:dry_bulb_condition] = dry_bulb_condition_from_design_day(design_day)
43
43
  hash[:humidity_condition] = humidity_condition_from_design_day(design_day)
@@ -83,4 +83,3 @@
83
83
  </file>
84
84
  </files>
85
85
  </measure>
86
- <error>cannot load such file -- honeybee/simulation/parameter</error>
@@ -86,13 +86,13 @@ module Honeybee
86
86
  shd_mat_name = openstudio_model.getMaterialByName(@hash[:shade_material])
87
87
  unless shd_mat_name.empty?
88
88
  @shade_material = shd_mat_name.get
89
- obj_type = @shade_material.iddObject.name
89
+ obj_type = @shade_material.iddObject.name.to_s
90
90
  end
91
91
  unless @shade_material.nil?
92
- if obj_type == 'OS:WindowMaterial:StandardGlazing'
92
+ if obj_type == 'OS:WindowMaterial:StandardGlazing' || obj_type == 'OS:WindowMaterial:Glazing'
93
93
  if @shade_location == 'Interior'
94
94
  os_materials[-1] = @shade_material
95
- elsif @shade_location == 'Exterior' | os_materials.length < 2
95
+ elsif @shade_location == 'Exterior' || os_materials.length < 2
96
96
  os_materials[0] = @shade_material
97
97
  else # middle glass pane
98
98
  os_materials[-3] = @shade_material
@@ -150,9 +150,9 @@ module Honeybee
150
150
 
151
151
  # figure out the shading type
152
152
  unless @shade_material.nil?
153
- obj_type = @shade_material.iddObject.name
153
+ obj_type = @shade_material.iddObject.name.to_s
154
154
  end
155
- if obj_type == 'OS:WindowMaterial:StandardGlazing'
155
+ if obj_type == 'OS:WindowMaterial:StandardGlazing' || obj_type == 'OS:WindowMaterial:Glazing'
156
156
  shd_type = 'SwitchableGlazing'
157
157
  elsif obj_type == 'OS:WindowMaterial:Blind'
158
158
  if @shade_location == 'Between'
@@ -43,9 +43,16 @@ module Honeybee
43
43
  end
44
44
 
45
45
  def to_openstudio(openstudio_model)
46
+ # get the vertices from the face
47
+ if @hash[:geometry][:vertices].nil?
48
+ hb_verts = @hash[:geometry][:boundary]
49
+ else
50
+ hb_verts = @hash[:geometry][:vertices]
51
+ end
52
+
46
53
  # reorder the vertices to ensure they start from the upper-left corner
47
54
  os_vertices = OpenStudio::Point3dVector.new
48
- @hash[:geometry][:boundary].each do |vertex|
55
+ hb_verts.each do |vertex|
49
56
  os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
50
57
  end
51
58
  reordered_vertices = OpenStudio.reorderULC(os_vertices)
@@ -43,9 +43,16 @@ module Honeybee
43
43
  end
44
44
 
45
45
  def to_openstudio(openstudio_model)
46
+ # get the vertices from the face
47
+ if @hash[:geometry][:vertices].nil?
48
+ hb_verts = @hash[:geometry][:boundary]
49
+ else
50
+ hb_verts = @hash[:geometry][:vertices]
51
+ end
52
+
46
53
  # create the openstudio shading surface
47
54
  os_vertices = OpenStudio::Point3dVector.new
48
- @hash[:geometry][:boundary].each do |vertex|
55
+ hb_verts.each do |vertex|
49
56
  os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
50
57
  end
51
58
  reordered_vertices = OpenStudio.reorderULC(os_vertices)
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.23.3
4
+ version: 2.23.7
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-09-16 00:00:00.000000000 Z
14
+ date: 2021-09-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler