honeybee-openstudio 2.17.0 → 2.17.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/honeybee-openstudio.gemspec +1 -1
- data/lib/files/urbanopt_Gemfile +13 -5
- data/lib/from_openstudio/geometry/face.rb +2 -2
- data/lib/from_openstudio/model.rb +9 -1
- data/lib/measures/from_honeybee_model/measure.rb +16 -0
- data/lib/measures/from_honeybee_model_to_gbxml/measure.rb +7 -0
- data/lib/to_openstudio/model.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4856942358fea802404323b2df581961230c29b0de01d1993742dc2e9c4aaec
|
4
|
+
data.tar.gz: 5749259754899e511dd53f3cb4427986abc78bfb6de7f6af023829db9056c630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 573e2448b710a5591c2b2c648d96d6ee09b226a458b589d3a081f6ba1dd5a04cf42ac84f9e63b43bcfa77c09c54632b08d9c3391b14f502c447de9f18a1ffa72
|
7
|
+
data.tar.gz: 855685ea4d3387be760c97ca56a807bdd6a983be4a528a177784f52cbca182a5d5561eaed9c4ab0a3de71631ddf4633de79174d6bf421ef8c0094a531ca5a566
|
data/README.md
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
|
8
8
|
Library and measures for translating between Honeybee JSON schema and OpenStudio Model schema (OSM).
|
9
9
|
|
10
|
-
|
11
10
|
## Run the measures of this repo using OpenStudio CLI
|
12
11
|
|
13
12
|
Running the measures using OpenStudio CLI requires no installation other than cloning
|
@@ -42,8 +41,8 @@ where the items in parentheses should be replaced with specific file paths:
|
|
42
41
|
|
43
42
|
```
|
44
43
|
|
45
|
-
|
46
44
|
## Local Development
|
45
|
+
|
47
46
|
1. Clone this repo locally
|
48
47
|
```
|
49
48
|
git clone git@github.com:ladybug-tools/honeybee-openstudio-gem
|
data/honeybee-openstudio.gemspec
CHANGED
@@ -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.17.
|
7
|
+
spec.version = '2.17.5'
|
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
|
|
data/lib/files/urbanopt_Gemfile
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
ruby '~> 2.
|
3
|
+
ruby '~> 2.7.0'
|
4
4
|
|
5
5
|
allow_local = ENV['FAVOR_LOCAL_GEMS']
|
6
6
|
|
7
|
+
if allow_local && File.exist?('../openstudio-common-measures-gem')
|
8
|
+
gem 'openstudio-common-measures', path: '../openstudio-common-measures-gem'
|
9
|
+
elsif allow_local
|
10
|
+
gem 'openstudio-common-measures', github: 'NREL/openstudio-common-measures-gem', branch: 'develop'
|
11
|
+
else
|
12
|
+
gem 'openstudio-common-measures', '~> 0.4.0'
|
13
|
+
end
|
14
|
+
|
7
15
|
if allow_local && File.exist?('../openstudio-model-articulation-gem')
|
8
16
|
gem 'openstudio-model-articulation', path: '../openstudio-model-articulation-gem'
|
9
17
|
elsif allow_local
|
10
18
|
gem 'openstudio-model-articulation', github: 'NREL/openstudio-model-articulation-gem', branch: 'develop'
|
11
19
|
else
|
12
|
-
gem 'openstudio-model-articulation', '0.
|
20
|
+
gem 'openstudio-model-articulation', '0.4.0'
|
13
21
|
end
|
14
22
|
|
15
23
|
if allow_local && File.exist?('../urbanopt-geojson-gem')
|
@@ -17,7 +25,7 @@ if allow_local && File.exist?('../urbanopt-geojson-gem')
|
|
17
25
|
elsif allow_local
|
18
26
|
gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
|
19
27
|
else
|
20
|
-
gem 'urbanopt-geojson', '~> 0.
|
28
|
+
gem 'urbanopt-geojson', '~> 0.6.1'
|
21
29
|
end
|
22
30
|
|
23
31
|
if allow_local && File.exist?('../urbanopt-reporting-gem')
|
@@ -25,8 +33,8 @@ if allow_local && File.exist?('../urbanopt-reporting-gem')
|
|
25
33
|
elsif allow_local
|
26
34
|
gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
|
27
35
|
else
|
28
|
-
gem 'urbanopt-reporting', '~> 0.
|
36
|
+
gem 'urbanopt-reporting', '~> 0.4.0'
|
29
37
|
end
|
30
38
|
|
31
39
|
# include the honeybee-openstudio-gem
|
32
|
-
gem 'honeybee-openstudio', '2.
|
40
|
+
gem 'honeybee-openstudio', '2.17.0'
|
@@ -108,7 +108,7 @@ module Honeybee
|
|
108
108
|
|
109
109
|
def self.boundary_condition_from_surface(surface)
|
110
110
|
result = {}
|
111
|
-
|
111
|
+
surface_bc = surface.outsideBoundaryCondition
|
112
112
|
adjacent_surface = surface.adjacentSurface
|
113
113
|
if !adjacent_surface.empty?
|
114
114
|
adjacent_space = clean_identifier(adjacent_surface.get.space.get.nameString)
|
@@ -116,7 +116,7 @@ module Honeybee
|
|
116
116
|
result = {type: 'Surface', boundary_condition_objects: [adjacent_surface, adjacent_space]}
|
117
117
|
elsif surface.isGroundSurface
|
118
118
|
result = {type: 'Ground'}
|
119
|
-
elsif
|
119
|
+
elsif surface_bc == 'Adiabatic'
|
120
120
|
result = {type: 'Adiabatic'}
|
121
121
|
else
|
122
122
|
sun_exposure = (surface.sunExposure == 'SunExposed')
|
@@ -81,7 +81,15 @@ module Honeybee
|
|
81
81
|
translator = OpenStudio::GbXML::GbXMLReverseTranslator.new
|
82
82
|
openstudio_model = translator.loadModel(file)
|
83
83
|
raise "Cannot load gbXML file at '#{}'" if openstudio_model.empty?
|
84
|
-
|
84
|
+
# remove any shade groups that were translated as spaces
|
85
|
+
os_model = openstudio_model.get
|
86
|
+
spaces = os_model.getSpaces()
|
87
|
+
spaces.each do |space|
|
88
|
+
if space.surfaces.length() == 0
|
89
|
+
space.remove()
|
90
|
+
end
|
91
|
+
end
|
92
|
+
self.translate_from_openstudio(os_model)
|
85
93
|
end
|
86
94
|
|
87
95
|
# Create Ladybug Energy Model JSON from IDF file
|
@@ -34,6 +34,9 @@
|
|
34
34
|
|
35
35
|
require 'to_openstudio'
|
36
36
|
|
37
|
+
require 'fileutils'
|
38
|
+
require 'pathname'
|
39
|
+
|
37
40
|
# start the measure
|
38
41
|
class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
39
42
|
# human readable name
|
@@ -96,6 +99,7 @@ class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
|
96
99
|
honeybee_model = Honeybee::Model.read_from_disk(model_json)
|
97
100
|
|
98
101
|
if schedule_csv_dir && !schedule_csv_dir.empty?
|
102
|
+
schedule_csv_dir = Pathname.new(schedule_csv_dir).cleanpath
|
99
103
|
if !Dir.exist?(schedule_csv_dir)
|
100
104
|
runner.registerError("Directory for exported CSV Schedules does not exist '#{schedule_csv_dir}'")
|
101
105
|
return false
|
@@ -106,6 +110,18 @@ class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
|
106
110
|
STDOUT.flush
|
107
111
|
honeybee_model.to_openstudio_model(model)
|
108
112
|
STDOUT.flush
|
113
|
+
|
114
|
+
generated_files_dir = "#{runner.workflow.absoluteRootDir}/generated_files"
|
115
|
+
if schedule_csv_dir && !schedule_csv_dir.empty?
|
116
|
+
if Dir.exist?(schedule_csv_dir)
|
117
|
+
runner.registerInfo("Copying exported schedules from '#{schedule_csv_dir}' to '#{generated_files_dir}'")
|
118
|
+
FileUtils.mkdir_p(generated_files_dir)
|
119
|
+
Dir.glob("#{schedule_csv_dir}/*.csv").each do |file|
|
120
|
+
FileUtils.cp(file, generated_files_dir)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
109
125
|
return true
|
110
126
|
end
|
111
127
|
end
|
@@ -90,6 +90,13 @@ class FromHoneybeeModelToGbxml < OpenStudio::Measure::ModelMeasure
|
|
90
90
|
os_model = honeybee_model.to_openstudio_model(model)
|
91
91
|
STDOUT.flush
|
92
92
|
|
93
|
+
# make sure the zone name is different from the space name to comply with gbXML
|
94
|
+
zones = os_model.getThermalZones()
|
95
|
+
zones.each do |zone|
|
96
|
+
zone_name = zone.name.to_s + '_Zone'
|
97
|
+
zone.setName(zone_name)
|
98
|
+
end
|
99
|
+
|
93
100
|
# convert the OpenStudio model into a gbXML Model
|
94
101
|
output_file_path = runner.getStringArgumentValue('output_file_path', user_arguments)
|
95
102
|
if output_file_path && !output_file_path.empty?
|
data/lib/to_openstudio/model.rb
CHANGED
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.17.
|
4
|
+
version: 2.17.5
|
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-05-
|
14
|
+
date: 2021-05-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|