openstudio-extension 0.4.0 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/CHANGELOG.md +24 -0
- data/Gemfile +3 -1
- data/Jenkinsfile +1 -1
- data/README.md +12 -10
- data/Rakefile +3 -3
- data/lib/change_log.rb +1 -1
- data/lib/openstudio/extension/core/os_lib_helper_methods.rb +2 -1
- data/lib/openstudio/extension/core/os_lib_model_generation.rb +14 -1
- data/lib/openstudio/extension/rake_task.rb +16 -13
- data/lib/openstudio/extension/runner.rb +18 -22
- data/lib/openstudio/extension/version.rb +1 -1
- data/lib/openstudio/extension.rb +5 -9
- data/openstudio-extension.gemspec +8 -6
- metadata +16 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07fb8e05dbcb58025bd9f81eece27010cefe13ec967b48bdd307ccfe30bda2d0
|
4
|
+
data.tar.gz: cec559244c8d8897765a220883af3249decd5faeca6feae5163708ff8f883a80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e437dec7e77dbcfd30853384b16cc7791165a498f75ca96a016a24bf0cc01e83b5872aa1b2e95d062a082cdf9bf8aeed3a91fd7cb19be56e8113f37abd8a2cd
|
7
|
+
data.tar.gz: 6234de082434647a2910623c9a1ae732088eb6706fc447883da09332dbd8704661583d23a8e02769bf90d5470bccf244ecde93a8411a1b1c2963c71e32f5ad7e
|
data/.rubocop.yml
CHANGED
@@ -5,6 +5,7 @@ AllCops:
|
|
5
5
|
- lib/measures/**/resources/*
|
6
6
|
- lib/openstudio/extension/core/**/*
|
7
7
|
|
8
|
+
require: rubocop-performance
|
8
9
|
inherit_from:
|
9
|
-
- http://s3.amazonaws.com/openstudio-resources/styles/
|
10
|
+
- http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v4.yml
|
10
11
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
# OpenStudio Extension Gem
|
2
2
|
|
3
|
+
## Version 0.4.4
|
4
|
+
|
5
|
+
* Update BCL gem to version 0.7.1 which upgrades REXML and Spreadsheet with security patches
|
6
|
+
* Minor updates to documentation
|
7
|
+
|
8
|
+
## Version 0.4.3
|
9
|
+
|
10
|
+
* Update measure tester gem which upgrades Rubocop to 1.15
|
11
|
+
* Update styles to v4 based on new version of Rubocop
|
12
|
+
|
13
|
+
## Version 0.4.2
|
14
|
+
|
15
|
+
* Fixes [#113](https://github.com/NREL/openstudio-extension-gem/issues/113) Fix bad args behavior on bar_from_building_type_ratios
|
16
|
+
* Fixes [#103](https://github.com/NREL/openstudio-extension-gem/issues/103) make check_upstream_measure_for_arg more robust for non string arguments
|
17
|
+
* Updatd version of openstudio-standards for development to openstudio-standards 0.2.13
|
18
|
+
* Added ASHRAE 90.1 2016 and 2019 to get_doe_templates method in os_lib_model_generation.rb file. This method is used by a number of measures to generate allowable argument values
|
19
|
+
|
20
|
+
## Version 0.4.1
|
21
|
+
|
22
|
+
* Fixed [#95]( https://github.com/NREL/openstudio-extension-gem/issues/95 ), Extend exceptions on standards error messages for curves used on multiple objects
|
23
|
+
* Fixed [#113]( https://github.com/NREL/openstudio-extension-gem/issues/113 ), Fix bad args behavior on bar_from_building_type_ratios
|
24
|
+
* Fixed [#111]( https://github.com/NREL/openstudio-extension-gem/pull/111 ), night cycling change - for 0.4.x
|
25
|
+
* Updated version of openstudio-standards for development to openstudio-standards 0.2.13.rc3
|
26
|
+
|
3
27
|
## Version 0.4.0
|
4
28
|
|
5
29
|
* Fix merging of options on initialization. Options hash will overwrite the default config AND the runner.conf files.
|
data/Gemfile
CHANGED
@@ -2,5 +2,7 @@ source 'http://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in openstudio-extension.gemspec
|
4
4
|
|
5
|
-
|
5
|
+
# line below used for testing when need to test against branch instead of release of standards. Should be commented out prior to merge to develop
|
6
|
+
# gem 'openstudio-standards', github: 'NREL/openstudio-standards', branch: 'fix/901_2016_2019_properties' # for os_lib unit tests
|
6
7
|
|
8
|
+
gemspec
|
data/Jenkinsfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
//Jenkins pipelines are stored in shared libaries. Please see: https://github.com/NREL/cbci_jenkins_libs
|
2
2
|
|
3
|
-
@Library('cbci_shared_libs
|
3
|
+
@Library('cbci_shared_libs') _
|
4
4
|
|
5
5
|
// Build for PR to develop branch only.
|
6
6
|
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) { // check if set
|
data/README.md
CHANGED
@@ -31,14 +31,15 @@ Each OpenStudio extension gem should define its own module name to ensure that t
|
|
31
31
|
|
32
32
|
## Installation
|
33
33
|
|
34
|
-
To use this and other extension gems, you will need Ruby 2.
|
34
|
+
To use the latest version of this and other extension gems, you will need Ruby 2.7.x and OpenStudio 3.1.0 or greater.
|
35
35
|
|
36
36
|
### Windows Installation
|
37
|
-
Install Ruby using the [RubyInstaller](https://rubyinstaller.org/downloads/archives/) for [Ruby 2.
|
37
|
+
Install Ruby with Devkit using the [RubyInstaller](https://rubyinstaller.org/downloads/archives/) for [Ruby 2.7.2 (x64)](
|
38
|
+
https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-devkit-2.7.2-1-x64.exe).
|
38
39
|
|
39
|
-
|
40
|
+
Make sure that you select **option 3: MSYS2 and MINGW development toolchain** during the installation process.
|
40
41
|
|
41
|
-
Check the ruby installation returns the correct Ruby version (2.
|
42
|
+
Check the ruby installation returns the correct Ruby version (2.7.x):
|
42
43
|
```
|
43
44
|
ruby -v
|
44
45
|
```
|
@@ -48,10 +49,10 @@ Install bundler from the command line
|
|
48
49
|
gem install bundler -v 2.1
|
49
50
|
```
|
50
51
|
|
51
|
-
Install OpenStudio. Create a file ```C:\ruby-2.
|
52
|
+
Install OpenStudio. Create a file ```C:\ruby-2.7.2-1-x64-mingw32\lib\ruby\site_ruby\openstudio.rb``` and point it to your OpenStudio installation by editing the contents. E.g.:
|
52
53
|
|
53
54
|
```ruby
|
54
|
-
require 'C:\openstudio-3.
|
55
|
+
require 'C:\openstudio-3.1.0\Ruby\openstudio.rb'
|
55
56
|
```
|
56
57
|
|
57
58
|
Verify your OpenStudio and Ruby configuration:
|
@@ -65,7 +66,7 @@ rbenv can be installed via [Homebrew](https://brew.sh/):
|
|
65
66
|
```
|
66
67
|
brew install rbenv
|
67
68
|
rbenv init
|
68
|
-
rbenv install 2.
|
69
|
+
rbenv install 2.7.2
|
69
70
|
```
|
70
71
|
|
71
72
|
Also install bundler
|
@@ -76,9 +77,9 @@ gem install bundler -v 2.1
|
|
76
77
|
Install [OpenStudio](https://www.openstudio.net/downloads).
|
77
78
|
|
78
79
|
Add the RUBYLIB environment variable to your `bash_profile` (or similar) file. It should point to the Ruby folder within
|
79
|
-
the OpenStudio Application you just downloaded (replace 3.
|
80
|
+
the OpenStudio Application you just downloaded (replace 3.1.0 with the version you are using):
|
80
81
|
```
|
81
|
-
export RUBYLIB=/Applications/OpenStudio-3.
|
82
|
+
export RUBYLIB=/Applications/OpenStudio-3.1.0/Ruby
|
82
83
|
```
|
83
84
|
|
84
85
|
|
@@ -182,9 +183,10 @@ The following table contains all current extension gems.
|
|
182
183
|
| OpenStudio Calibration Gem | openstudio-calibration | https://github.com/NREL/openstudio-calibration-gem |
|
183
184
|
| OpenStudio EE Gem | openstudio-ee | https://github.com/NREL/openstudio-ee-gem |
|
184
185
|
| OpenStudio District Systems Gem | openstudio-district-systems | https://github.com/NREL/openstudio-district-systems-gem |
|
186
|
+
| OpenStudio Load Flexibility Measures Gem | openstudio-load-flexibility-measures | https://github.com/NREL/openstudio-load-flexibility-measures-gem |
|
185
187
|
| URBANopt Core Gem | urbanopt-core | https://github.com/urbanopt/urbanopt-core-gem |
|
186
188
|
| URBANopt GeoJSON Gem | urbanopt-geojson | https://github.com/urbanopt/urbanopt-geojson-gem |
|
187
|
-
| URBANopt
|
189
|
+
| URBANopt Reporting Gem | urbanopt-reporting | https://github.com/urbanopt/urbanopt-reporting-gem |
|
188
190
|
| BuildingSync Gem | buildingsync | https://github.com/BuildingSync/BuildingSync-gem |
|
189
191
|
|
190
192
|
### Initializing a new Extension Gem
|
data/Rakefile
CHANGED
@@ -45,10 +45,10 @@ desc 'Initialize a new gem'
|
|
45
45
|
task :init_new_gem do
|
46
46
|
puts 'Initializing a new extension gem'
|
47
47
|
print "\n Enter the name of the new gem directory (ex: openstudio-something-gem. Should end with '-gem'): "
|
48
|
-
gem_name =
|
48
|
+
gem_name = $stdin.gets.chomp
|
49
49
|
|
50
50
|
print "\n Enter the path (full or relative to this repo) where you want the new gem directory to be created: "
|
51
|
-
dir_path =
|
51
|
+
dir_path = $stdin.gets.chomp
|
52
52
|
|
53
53
|
# check if directory already exists at path, if so error
|
54
54
|
full_dir_name = dir_path + gem_name
|
@@ -61,7 +61,7 @@ task :init_new_gem do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
# copy file structure
|
64
|
-
FileUtils.cp('.gitignore', full_dir_name
|
64
|
+
FileUtils.cp('.gitignore', "#{full_dir_name}/.gitignore")
|
65
65
|
FileUtils.cp_r(File.join(File.dirname(__FILE__), 'init_templates/template_gemfile.txt'), File.join(full_dir_name, 'Gemfile'))
|
66
66
|
FileUtils.cp_r(File.join(File.dirname(__FILE__), 'doc_templates'), full_dir_name)
|
67
67
|
|
data/lib/change_log.rb
CHANGED
@@ -144,7 +144,7 @@ class ChangeLog
|
|
144
144
|
puts "Total Open Issues: #{@total_open_issues.length}"
|
145
145
|
puts "Total Open Pull Requests: #{@total_open_pull_requests.length}"
|
146
146
|
puts "\nDate Range: #{@start_date.strftime('%m/%d/%y')} - #{@end_date.strftime('%m/%d/%y')}:"
|
147
|
-
puts "\nNew Issues: #{@new_issues.length} (
|
147
|
+
puts "\nNew Issues: #{@new_issues.length} (#{@new_issues.map(&:number).join(', ')})"
|
148
148
|
|
149
149
|
puts "\nClosed Issues: #{@closed_issues.length}"
|
150
150
|
@closed_issues.each { |issue| puts print_issue(issue) }
|
@@ -233,7 +233,8 @@ module OsLib_HelperMethods
|
|
233
233
|
msg.logChannel.include?('runmanager') || # RunManager messages
|
234
234
|
msg.logChannel.include?('setFileExtension') || # .ddy extension unexpected
|
235
235
|
msg.logChannel.include?('Translator') || # Forward translator and geometry translator
|
236
|
-
msg.logMessage.include?('UseWeatherFile') # 'UseWeatherFile' is not yet a supported option for YearDescription
|
236
|
+
msg.logMessage.include?('UseWeatherFile') || # 'UseWeatherFile' is not yet a supported option for YearDescription
|
237
|
+
msg.logMessage.include?('has multiple parents') # 'has multiple parents' is thrown for various types of curves if used in multiple objects
|
237
238
|
|
238
239
|
# Report the message in the correct way
|
239
240
|
if msg.logLevel == OpenStudio::Info
|
@@ -158,6 +158,8 @@ module OsLib_ModelGeneration
|
|
158
158
|
array << '90.1-2007'
|
159
159
|
array << '90.1-2010'
|
160
160
|
array << '90.1-2013'
|
161
|
+
array << '90.1-2016'
|
162
|
+
array << '90.1-2019'
|
161
163
|
array << 'ComStock DOE Ref Pre-1980'
|
162
164
|
array << 'ComStock DOE Ref 1980-2004'
|
163
165
|
array << 'ComStock 90.1-2004'
|
@@ -1728,6 +1730,7 @@ module OsLib_ModelGeneration
|
|
1728
1730
|
|
1729
1731
|
# prep arguments
|
1730
1732
|
args = bar_arg_check_setup(model,runner,user_arguments)
|
1733
|
+
if !args then return false end
|
1731
1734
|
|
1732
1735
|
# check that sum of fractions for b,c, and d is less than 1.0 (so something is left for primary building type)
|
1733
1736
|
bldg_type_a_fract_bldg_area = 1.0 - args['bldg_type_b_fract_bldg_area'] - args['bldg_type_c_fract_bldg_area'] - args['bldg_type_d_fract_bldg_area']
|
@@ -1808,8 +1811,9 @@ module OsLib_ModelGeneration
|
|
1808
1811
|
|
1809
1812
|
# do not setup arguments if they were already passed in to this method
|
1810
1813
|
if args.nil?
|
1811
|
-
|
1814
|
+
# prep arguments
|
1812
1815
|
args = bar_arg_check_setup(model,runner,user_arguments,false) # false stops it from checking args on used in bar_from_building_type_ratios
|
1816
|
+
if !args then return false end
|
1813
1817
|
|
1814
1818
|
# identify primary building type for building form defaults
|
1815
1819
|
primary_building_type = "PrimarySchool" # see what building type represents the most floro area
|
@@ -3248,6 +3252,15 @@ module OsLib_ModelGeneration
|
|
3248
3252
|
end
|
3249
3253
|
end
|
3250
3254
|
|
3255
|
+
# change night cycling control to "Thermostat" cycling and increase thermostat tolerance to 1.99999
|
3256
|
+
manager_night_cycles = model.getAvailabilityManagerNightCycles
|
3257
|
+
|
3258
|
+
manager_night_cycles.each do |night_cycle|
|
3259
|
+
night_cycle.setThermostatTolerance(1.9999)
|
3260
|
+
night_cycle.setCyclingRunTimeControlType("Thermostat")
|
3261
|
+
runner.registerInfo(" night_cycle == #{night_cycle}")
|
3262
|
+
end
|
3263
|
+
|
3251
3264
|
# report final condition of model
|
3252
3265
|
runner.registerFinalCondition("The building finished with #{model.getModelObjects.size} objects.")
|
3253
3266
|
|
@@ -55,7 +55,7 @@ module OpenStudio
|
|
55
55
|
@root_dir = @extension.root_dir
|
56
56
|
# Catch if measures_dir is nil, then just make it an empty string
|
57
57
|
@measures_dir = @extension.measures_dir || ''
|
58
|
-
@staged_path = @measures_dir
|
58
|
+
@staged_path = "#{@measures_dir}/staged"
|
59
59
|
@core_dir = @extension.core_dir
|
60
60
|
@doc_templates_dir = @extension.doc_templates_dir
|
61
61
|
@files_dir = @extension.files_dir
|
@@ -201,9 +201,9 @@ module OpenStudio
|
|
201
201
|
end
|
202
202
|
|
203
203
|
# create new and existing directories
|
204
|
-
FileUtils.mkdir_p(@staged_path
|
205
|
-
FileUtils.mkdir_p(@staged_path
|
206
|
-
FileUtils.mkdir_p(@staged_path
|
204
|
+
FileUtils.mkdir_p("#{@staged_path}/update")
|
205
|
+
FileUtils.mkdir_p("#{@staged_path}/push/component")
|
206
|
+
FileUtils.mkdir_p("#{@staged_path}/push/measure")
|
207
207
|
|
208
208
|
# keep track of noop, update, push
|
209
209
|
noops = 0
|
@@ -215,6 +215,7 @@ module OpenStudio
|
|
215
215
|
|
216
216
|
dirs.each do |dir|
|
217
217
|
next if dir.include?('Rakefile') || File.basename(dir) == 'staged'
|
218
|
+
|
218
219
|
current_d = Dir.pwd
|
219
220
|
content_name = File.basename(dir)
|
220
221
|
puts '', '---'
|
@@ -235,6 +236,7 @@ module OpenStudio
|
|
235
236
|
next if file.to_s.start_with?('tests/test') # From openstudio-measure-tester-gem
|
236
237
|
next if file.to_s.start_with?('tests/coverage') # From openstudio-measure-tester-gem
|
237
238
|
next if file.to_s.start_with?('test_results') # From openstudio-measure-tester-gem
|
239
|
+
|
238
240
|
paths << file.to_s
|
239
241
|
if file.to_s =~ /^.{0,2}component.xml$/ || file.to_s =~ /^.{0,2}measure.xml$/
|
240
242
|
if file.to_s.match?(/^.{0,2}component.xml$/)
|
@@ -246,21 +248,22 @@ module OpenStudio
|
|
246
248
|
end
|
247
249
|
puts "UUID: #{uuid}, VID: #{vid}"
|
248
250
|
|
249
|
-
#
|
251
|
+
# NOTE: if uuid is missing, will assume new content
|
250
252
|
action = bcl.search_by_uuid(uuid, vid)
|
251
253
|
puts "#{content_name} ACTION TO TAKE: #{action}"
|
252
254
|
# new content functionality needs to know if measure or component. update is agnostic.
|
253
|
-
|
255
|
+
case action
|
256
|
+
when 'noop' # ignore up-to-date content
|
254
257
|
puts " - WARNING: local #{content_name} uuid and vid match BCL... no update will be performed"
|
255
258
|
noops += 1
|
256
259
|
next
|
257
|
-
|
260
|
+
when 'update'
|
258
261
|
# puts "#{content_name} labeled as update for BCL"
|
259
|
-
destination = @staged_path
|
262
|
+
destination = "#{@staged_path}/#{action}/#{content_name}.tar.gz"
|
260
263
|
updates += 1
|
261
|
-
|
264
|
+
when 'push'
|
262
265
|
# puts "#{content_name} labeled as new content for BCL"
|
263
|
-
destination = @staged_path
|
266
|
+
destination = "#{@staged_path}/#{action}/#{content_type}/#{content_name}.tar.gz"
|
264
267
|
new_ones += 1
|
265
268
|
end
|
266
269
|
|
@@ -309,7 +312,7 @@ module OpenStudio
|
|
309
312
|
puts item.split('/').last
|
310
313
|
total_count += 1
|
311
314
|
|
312
|
-
receipt_file = File.dirname(item)
|
315
|
+
receipt_file = "#{File.dirname(item)}/#{File.basename(item, '.tar.gz')}.receipt"
|
313
316
|
if !reset && File.exist?(receipt_file)
|
314
317
|
skipped += 1
|
315
318
|
puts 'SKIP: receipt file found'
|
@@ -333,7 +336,7 @@ module OpenStudio
|
|
333
336
|
|
334
337
|
# grab all the updated content (measures and components) tar files and push to bcl
|
335
338
|
items = []
|
336
|
-
paths = Pathname.glob(@staged_path
|
339
|
+
paths = Pathname.glob("#{@staged_path}/update/*.tar.gz")
|
337
340
|
paths.each do |path|
|
338
341
|
# puts path
|
339
342
|
items << path.to_s
|
@@ -342,7 +345,7 @@ module OpenStudio
|
|
342
345
|
puts item.split('/').last
|
343
346
|
total_count += 1
|
344
347
|
|
345
|
-
receipt_file = File.dirname(item)
|
348
|
+
receipt_file = "#{File.dirname(item)}/#{File.basename(item, '.tar.gz')}.receipt"
|
346
349
|
if !reset && File.exist?(receipt_file)
|
347
350
|
skipped += 1
|
348
351
|
puts 'SKIP: receipt file found'
|
@@ -121,15 +121,15 @@ module OpenStudio
|
|
121
121
|
|
122
122
|
# test to see if bundle is installed
|
123
123
|
check_bundle = run_command('bundle -v', get_clean_env)
|
124
|
-
if !check_bundle
|
125
|
-
raise "Failed to run command 'bundle -v', check that bundle is installed"
|
124
|
+
if !check_bundle && !File.exist?(@dirname)
|
125
|
+
raise "Failed to run command 'bundle -v', check that bundle is installed"
|
126
126
|
end
|
127
127
|
|
128
128
|
# TODO: check that ruby version is correct
|
129
129
|
|
130
130
|
# check existing config
|
131
131
|
needs_config = true
|
132
|
-
if File.exist?('./.bundle/config')
|
132
|
+
if File.exist?('./.bundle/config') # checking wrt gemfile_dir
|
133
133
|
puts 'config exists'
|
134
134
|
needs_config = false
|
135
135
|
config = YAML.load_file('./.bundle/config')
|
@@ -166,10 +166,8 @@ module OpenStudio
|
|
166
166
|
end
|
167
167
|
|
168
168
|
needs_update = needs_config || needs_platform
|
169
|
-
if !needs_update
|
170
|
-
|
171
|
-
needs_update = true
|
172
|
-
end
|
169
|
+
if !needs_update && (!File.exist?('Gemfile.lock') || File.mtime(@gemfile_path) > File.mtime('Gemfile.lock'))
|
170
|
+
needs_update = true
|
173
171
|
end
|
174
172
|
|
175
173
|
puts "needs_update = #{needs_update}"
|
@@ -241,7 +239,7 @@ module OpenStudio
|
|
241
239
|
puts "Error running command: '#{command}'"
|
242
240
|
puts "stdout: #{stdout_str}"
|
243
241
|
puts "stderr: #{stderr_str}"
|
244
|
-
|
242
|
+
$stdout.flush
|
245
243
|
result = false
|
246
244
|
end
|
247
245
|
ensure
|
@@ -318,10 +316,10 @@ module OpenStudio
|
|
318
316
|
|
319
317
|
puts 'SYSTEM CALL:'
|
320
318
|
puts the_call
|
321
|
-
|
319
|
+
$stdout.flush
|
322
320
|
result = run_command(the_call, get_clean_env)
|
323
321
|
puts "DONE, result = #{result}"
|
324
|
-
|
322
|
+
$stdout.flush
|
325
323
|
|
326
324
|
return result
|
327
325
|
end
|
@@ -358,10 +356,10 @@ module OpenStudio
|
|
358
356
|
|
359
357
|
puts 'SYSTEM CALL:'
|
360
358
|
puts the_call
|
361
|
-
|
359
|
+
$stdout.flush
|
362
360
|
result &&= run_command(the_call, get_clean_env)
|
363
361
|
puts "DONE, result = #{result}"
|
364
|
-
|
362
|
+
$stdout.flush
|
365
363
|
end
|
366
364
|
|
367
365
|
return result
|
@@ -425,7 +423,7 @@ module OpenStudio
|
|
425
423
|
measures = Dir.glob(File.join(measures_dir, '**/**/resources/*.rb'))
|
426
424
|
end
|
427
425
|
|
428
|
-
#
|
426
|
+
# NOTE: some older measures like AEDG use 'OsLib_SomeName' instead of 'os_lib_some_name'
|
429
427
|
# this script isn't replacing those copies
|
430
428
|
|
431
429
|
# loop through resource files
|
@@ -523,11 +521,9 @@ module OpenStudio
|
|
523
521
|
return false
|
524
522
|
end
|
525
523
|
|
526
|
-
if File.exist?(File.join(doc_templates_dir, 'LICENSE.md'))
|
527
|
-
|
528
|
-
|
529
|
-
FileUtils.cp(File.join(doc_templates_dir, 'LICENSE.md'), File.join(root_dir, 'LICENSE.md'))
|
530
|
-
end
|
524
|
+
if File.exist?(File.join(doc_templates_dir, 'LICENSE.md')) && File.exist?(File.join(root_dir, 'LICENSE.md'))
|
525
|
+
puts 'updating LICENSE.md in root dir'
|
526
|
+
FileUtils.cp(File.join(doc_templates_dir, 'LICENSE.md'), File.join(root_dir, 'LICENSE.md'))
|
531
527
|
end
|
532
528
|
|
533
529
|
ruby_regex = /^\#\s?[\#\*]{12,}.*copyright.*?\#\s?[\#\*]{12,}\s*$/mi
|
@@ -593,7 +589,7 @@ module OpenStudio
|
|
593
589
|
puts ' CANNOT add license to file automatically, add it manually and it will update automatically in the future'
|
594
590
|
next
|
595
591
|
end
|
596
|
-
File.open(dir_file, 'w') { |write| write << f.insert(0, path[:license]
|
592
|
+
File.open(dir_file, 'w') { |write| write << f.insert(0, "#{path[:license]}\n") }
|
597
593
|
end
|
598
594
|
end
|
599
595
|
end
|
@@ -631,7 +627,7 @@ module OpenStudio
|
|
631
627
|
|
632
628
|
if @options[:run_simulations]
|
633
629
|
cli = OpenStudio.getOpenStudioCLI
|
634
|
-
out_log = run_osw_path
|
630
|
+
out_log = "#{run_osw_path}.log"
|
635
631
|
# if Gem.win_platform?
|
636
632
|
# # out_log = "nul"
|
637
633
|
# else
|
@@ -655,10 +651,10 @@ module OpenStudio
|
|
655
651
|
|
656
652
|
puts 'SYSTEM CALL:'
|
657
653
|
puts the_call
|
658
|
-
|
654
|
+
$stdout.flush
|
659
655
|
result = run_command(the_call, get_clean_env)
|
660
656
|
puts "DONE, result = #{result}"
|
661
|
-
|
657
|
+
$stdout.flush
|
662
658
|
else
|
663
659
|
puts 'simulations are not performed, since to the @options[:run_simulations] is set to false'
|
664
660
|
end
|
data/lib/openstudio/extension.rb
CHANGED
@@ -209,11 +209,9 @@ module OpenStudio
|
|
209
209
|
def self.set_measure_argument(osw, measure_dir_name, argument_name, argument_value, step_name = nil)
|
210
210
|
result = false
|
211
211
|
osw[:steps].each do |step|
|
212
|
-
if step[:measure_dir_name] == measure_dir_name
|
213
|
-
|
214
|
-
|
215
|
-
result = true
|
216
|
-
end
|
212
|
+
if step[:measure_dir_name] == measure_dir_name && (step_name.nil? || step[:name] == step_name)
|
213
|
+
step[:arguments][argument_name.to_sym] = argument_value
|
214
|
+
result = true
|
217
215
|
end
|
218
216
|
end
|
219
217
|
|
@@ -239,10 +237,8 @@ module OpenStudio
|
|
239
237
|
def self.measure_in_osw(osw, measure_dir_name, step_name = nil)
|
240
238
|
result = false
|
241
239
|
osw[:steps].each do |step|
|
242
|
-
if step[:measure_dir_name] == measure_dir_name
|
243
|
-
|
244
|
-
result = true
|
245
|
-
end
|
240
|
+
if step[:measure_dir_name] == measure_dir_name && (step_name.nil? || step[:name] == step_name)
|
241
|
+
result = true
|
246
242
|
end
|
247
243
|
end
|
248
244
|
|
@@ -6,12 +6,12 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'openstudio-extension'
|
7
7
|
spec.version = OpenStudio::Extension::VERSION
|
8
8
|
spec.platform = Gem::Platform::RUBY
|
9
|
-
spec.authors = ['Katherine Fleming', 'Nicholas Long', 'Daniel Macumber']
|
10
|
-
spec.email = ['katherine.fleming@nrel.gov', 'nicholas.long@nrel.gov', 'daniel.macumber@nrel.gov']
|
9
|
+
spec.authors = ['Katherine Fleming', 'Nicholas Long', 'Daniel Macumber', 'David Goldwasser']
|
10
|
+
spec.email = ['katherine.fleming@nrel.gov', 'nicholas.long@nrel.gov', 'daniel.macumber@nrel.gov', 'david.goldwasser@nrel.gov']
|
11
11
|
|
12
12
|
spec.homepage = 'https://openstudio.net'
|
13
13
|
spec.summary = 'openstudio base gem for creating generic extensions with encapsulated data and measures.'
|
14
|
-
spec.description = 'openstudio base gem for creating generic extensions with encapsulated data and measures.'
|
14
|
+
spec.description = 'openstudio base gem for creating generic extensions with encapsulated data and measures. Also contains ruby libraries that required by many measures.'
|
15
15
|
spec.metadata = {
|
16
16
|
'bug_tracker_uri' => 'https://github.com/NREL/openstudio-extension-gem/issues',
|
17
17
|
'changelog_uri' => 'https://github.com/NREL/openstudio-extension-gem/blob/develop/CHANGELOG.md',
|
@@ -28,14 +28,16 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.required_ruby_version = '~> 2.7.0'
|
30
30
|
|
31
|
-
spec.add_dependency 'bcl', '~> 0.7.
|
31
|
+
spec.add_dependency 'bcl', '~> 0.7.1'
|
32
32
|
spec.add_dependency 'bundler', '>= 2.1.0'
|
33
33
|
spec.add_dependency 'octokit', '~> 4.18.0' # for change logs
|
34
|
+
spec.add_dependency 'openstudio_measure_tester', '~> 0.3.1'
|
34
35
|
spec.add_dependency 'openstudio-workflow', '~> 2.2.0'
|
35
|
-
spec.add_dependency 'openstudio_measure_tester', '~> 0.3.0'
|
36
36
|
spec.add_dependency 'parallel', '~> 1.19.1'
|
37
37
|
|
38
|
-
spec.add_development_dependency 'openstudio-standards', '~> 0.2.
|
38
|
+
spec.add_development_dependency 'openstudio-standards', '~> 0.2.13' # for os_lib unit tests
|
39
39
|
spec.add_development_dependency 'rake', '~> 13.0'
|
40
40
|
spec.add_development_dependency 'rspec', '~> 3.9'
|
41
|
+
|
42
|
+
|
41
43
|
end
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstudio-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katherine Fleming
|
8
8
|
- Nicholas Long
|
9
9
|
- Daniel Macumber
|
10
|
+
- David Goldwasser
|
10
11
|
autorequire:
|
11
12
|
bindir: exe
|
12
13
|
cert_chain: []
|
13
|
-
date: 2021-
|
14
|
+
date: 2021-09-03 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: bcl
|
@@ -18,14 +19,14 @@ dependencies:
|
|
18
19
|
requirements:
|
19
20
|
- - "~>"
|
20
21
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.7.
|
22
|
+
version: 0.7.1
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
26
|
requirements:
|
26
27
|
- - "~>"
|
27
28
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.7.
|
29
|
+
version: 0.7.1
|
29
30
|
- !ruby/object:Gem::Dependency
|
30
31
|
name: bundler
|
31
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -55,33 +56,33 @@ dependencies:
|
|
55
56
|
- !ruby/object:Gem::Version
|
56
57
|
version: 4.18.0
|
57
58
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
59
|
+
name: openstudio_measure_tester
|
59
60
|
requirement: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
62
|
- - "~>"
|
62
63
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
64
|
+
version: 0.3.1
|
64
65
|
type: :runtime
|
65
66
|
prerelease: false
|
66
67
|
version_requirements: !ruby/object:Gem::Requirement
|
67
68
|
requirements:
|
68
69
|
- - "~>"
|
69
70
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
71
|
+
version: 0.3.1
|
71
72
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
73
|
+
name: openstudio-workflow
|
73
74
|
requirement: !ruby/object:Gem::Requirement
|
74
75
|
requirements:
|
75
76
|
- - "~>"
|
76
77
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
78
|
+
version: 2.2.0
|
78
79
|
type: :runtime
|
79
80
|
prerelease: false
|
80
81
|
version_requirements: !ruby/object:Gem::Requirement
|
81
82
|
requirements:
|
82
83
|
- - "~>"
|
83
84
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
85
|
+
version: 2.2.0
|
85
86
|
- !ruby/object:Gem::Dependency
|
86
87
|
name: parallel
|
87
88
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,14 +103,14 @@ dependencies:
|
|
102
103
|
requirements:
|
103
104
|
- - "~>"
|
104
105
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.2.
|
106
|
+
version: 0.2.13
|
106
107
|
type: :development
|
107
108
|
prerelease: false
|
108
109
|
version_requirements: !ruby/object:Gem::Requirement
|
109
110
|
requirements:
|
110
111
|
- - "~>"
|
111
112
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.2.
|
113
|
+
version: 0.2.13
|
113
114
|
- !ruby/object:Gem::Dependency
|
114
115
|
name: rake
|
115
116
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,11 +140,12 @@ dependencies:
|
|
139
140
|
- !ruby/object:Gem::Version
|
140
141
|
version: '3.9'
|
141
142
|
description: openstudio base gem for creating generic extensions with encapsulated
|
142
|
-
data and measures.
|
143
|
+
data and measures. Also contains ruby libraries that required by many measures.
|
143
144
|
email:
|
144
145
|
- katherine.fleming@nrel.gov
|
145
146
|
- nicholas.long@nrel.gov
|
146
147
|
- daniel.macumber@nrel.gov
|
148
|
+
- david.goldwasser@nrel.gov
|
147
149
|
executables: []
|
148
150
|
extensions: []
|
149
151
|
extra_rdoc_files: []
|
@@ -231,7 +233,7 @@ licenses: []
|
|
231
233
|
metadata:
|
232
234
|
bug_tracker_uri: https://github.com/NREL/openstudio-extension-gem/issues
|
233
235
|
changelog_uri: https://github.com/NREL/openstudio-extension-gem/blob/develop/CHANGELOG.md
|
234
|
-
source_code_uri: https://github.com/NREL/openstudio-extension-gem/tree/v0.4.
|
236
|
+
source_code_uri: https://github.com/NREL/openstudio-extension-gem/tree/v0.4.4
|
235
237
|
post_install_message:
|
236
238
|
rdoc_options: []
|
237
239
|
require_paths:
|