openstudio-extension 0.3.0 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/CHANGELOG.md +34 -0
  4. data/Gemfile +5 -0
  5. data/LICENSE.md +1 -1
  6. data/Rakefile +1 -1
  7. data/doc_templates/LICENSE.md +1 -1
  8. data/doc_templates/copyright_erb.txt +1 -1
  9. data/doc_templates/copyright_js.txt +1 -1
  10. data/doc_templates/copyright_ruby.txt +1 -1
  11. data/init_templates/gemspec.txt +7 -5
  12. data/init_templates/openstudio_module.rb +1 -1
  13. data/init_templates/spec.rb +1 -1
  14. data/init_templates/spec_helper.rb +1 -1
  15. data/init_templates/template_gemfile.txt +1 -4
  16. data/init_templates/version.rb +1 -1
  17. data/lib/change_log.rb +1 -1
  18. data/lib/measures/openstudio_extension_test_measure/LICENSE.md +1 -1
  19. data/lib/measures/openstudio_extension_test_measure/measure.rb +1 -1
  20. data/lib/measures/openstudio_extension_test_measure/measure.xml +12 -12
  21. data/lib/measures/openstudio_extension_test_measure/resources/os_lib_helper_methods.rb +15 -2
  22. data/lib/openstudio-extension.rb +1 -1
  23. data/lib/openstudio/extension.rb +1 -1
  24. data/lib/openstudio/extension/core/CreateResults.rb +1 -1
  25. data/lib/openstudio/extension/core/check_air_sys_temps.rb +1 -1
  26. data/lib/openstudio/extension/core/check_calibration.rb +1 -1
  27. data/lib/openstudio/extension/core/check_cond_zns.rb +1 -1
  28. data/lib/openstudio/extension/core/check_domestic_hot_water.rb +1 -1
  29. data/lib/openstudio/extension/core/check_envelope_conductance.rb +1 -1
  30. data/lib/openstudio/extension/core/check_eui_by_end_use.rb +1 -1
  31. data/lib/openstudio/extension/core/check_eui_reasonableness.rb +1 -1
  32. data/lib/openstudio/extension/core/check_fan_pwr.rb +1 -1
  33. data/lib/openstudio/extension/core/check_internal_loads.rb +1 -1
  34. data/lib/openstudio/extension/core/check_mech_sys_capacity.rb +1 -1
  35. data/lib/openstudio/extension/core/check_mech_sys_efficiency.rb +1 -1
  36. data/lib/openstudio/extension/core/check_mech_sys_part_load_eff.rb +1 -1
  37. data/lib/openstudio/extension/core/check_mech_sys_type.rb +1 -1
  38. data/lib/openstudio/extension/core/check_part_loads.rb +1 -1
  39. data/lib/openstudio/extension/core/check_placeholder.rb +1 -1
  40. data/lib/openstudio/extension/core/check_plant_cap.rb +1 -1
  41. data/lib/openstudio/extension/core/check_plant_temps.rb +1 -1
  42. data/lib/openstudio/extension/core/check_plenum_loads.rb +1 -1
  43. data/lib/openstudio/extension/core/check_pump_pwr.rb +1 -1
  44. data/lib/openstudio/extension/core/check_sch_coord.rb +1 -1
  45. data/lib/openstudio/extension/core/check_schedules.rb +1 -1
  46. data/lib/openstudio/extension/core/check_simultaneous_heating_and_cooling.rb +1 -1
  47. data/lib/openstudio/extension/core/check_supply_air_and_thermostat_temp_difference.rb +1 -1
  48. data/lib/openstudio/extension/core/check_weather_files.rb +1 -1
  49. data/lib/openstudio/extension/core/deer_vintages.rb +1 -1
  50. data/lib/openstudio/extension/core/os_lib_aedg_measures.rb +5 -5
  51. data/lib/openstudio/extension/core/os_lib_constructions.rb +1 -1
  52. data/lib/openstudio/extension/core/os_lib_geometry.rb +1 -1
  53. data/lib/openstudio/extension/core/os_lib_helper_methods.rb +17 -3
  54. data/lib/openstudio/extension/core/os_lib_hvac.rb +1 -1
  55. data/lib/openstudio/extension/core/os_lib_lighting_and_equipment.rb +1 -1
  56. data/lib/openstudio/extension/core/os_lib_model_generation.rb +366 -208
  57. data/lib/openstudio/extension/core/os_lib_model_simplification.rb +1 -1
  58. data/lib/openstudio/extension/core/os_lib_outdoorair_and_infiltration.rb +1 -1
  59. data/lib/openstudio/extension/core/os_lib_reporting_qaqc.rb +1 -1
  60. data/lib/openstudio/extension/core/os_lib_schedules.rb +1 -1
  61. data/lib/openstudio/extension/rake_task.rb +1 -1
  62. data/lib/openstudio/extension/runner.rb +30 -14
  63. data/lib/openstudio/extension/runner_config.rb +1 -1
  64. data/lib/openstudio/extension/version.rb +2 -2
  65. data/openstudio-extension.gemspec +9 -8
  66. metadata +32 -17
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -62,6 +62,8 @@ module OpenStudio
62
62
  # @option options [String] :num_parallel Number of simulations to run in parallel at a time
63
63
  # @option options [String] :run_simulations Set to true to run the simulations
64
64
  # @option options [String] :verbose Set to true to receive extra information while running simulations
65
+ # @option options [String] :gemfile_path Path to gemfile to use
66
+ # @option options [String] :bundle_install_path Path where the bundle should be installed
65
67
  def initialize(dirname = Dir.pwd, bundle_without = [], options = {})
66
68
  # DLM: I am not sure if we want to use the main root directory to create these bundles
67
69
  # had the idea of passing in a Gemfile name/alias and path to Gemfile, then doing the bundle
@@ -71,15 +73,18 @@ module OpenStudio
71
73
 
72
74
  @options = OpenStudio::Extension::RunnerConfig.default_config
73
75
  # ORDER of PRECEDENCE: default config < runner.conf file < options passed in directly
74
- if File.exist?(File.join(dirname, OpenStudio::Extension::RunnerConfig::FILENAME)) && options.empty?
76
+ if File.exist?(File.join(dirname, OpenStudio::Extension::RunnerConfig::FILENAME))
75
77
  puts 'Using runner options from runner.conf file'
76
78
  runner_config = OpenStudio::Extension::RunnerConfig.new(dirname)
77
79
  # use the default values overriden with runner.conf values
78
80
  @options = @options.merge(runner_config.options)
79
81
  end
80
82
 
81
- # use the passed values or defaults overriden by passed options
82
- @options = @options.merge(options)
83
+ if !options.empty?
84
+ puts 'Merging in passed-in options'
85
+ # use the passed values or defaults overriden by passed options
86
+ @options = @options.merge(options)
87
+ end
83
88
 
84
89
  puts "Initializing runner with dirname: '#{dirname}' and options: #{@options}"
85
90
  @dirname = File.absolute_path(dirname)
@@ -88,9 +93,14 @@ module OpenStudio
88
93
  @gemfile_path = !@options.key?(:gemfile_path) || @options[:gemfile_path] === '' ? File.join(@dirname, 'Gemfile') : @options[:gemfile_path]
89
94
  @bundle_install_path = !@options.key?(:bundle_install_path) || @options[:bundle_install_path] === '' ? File.join(@dirname, '.bundle/install/') : @options[:bundle_install_path]
90
95
  @original_dir = Dir.pwd
96
+
97
+ # gemfile directory
98
+ @gemfile_dir = File.dirname(@gemfile_path)
99
+
91
100
  # puts "DIRNAME: #{@dirname}"
92
101
  # puts "@gemfile_path set to: #{@gemfile_path}"
93
102
  # puts "@bundle_install_path set to: #{@bundle_install_path}"
103
+ # puts "@gemfile directory: #{@gemfile_dir}"
94
104
 
95
105
  @bundle_without = bundle_without || []
96
106
  @bundle_without_string = @bundle_without.join(' ')
@@ -106,8 +116,8 @@ module OpenStudio
106
116
  else
107
117
  # there is a gemfile, attempt to create a bundle
108
118
  begin
109
- # go to the directory with the gemfile
110
- Dir.chdir(@dirname)
119
+ # go to the directory with the gemfile to run these commands
120
+ Dir.chdir(@gemfile_dir)
111
121
 
112
122
  # test to see if bundle is installed
113
123
  check_bundle = run_command('bundle -v', get_clean_env)
@@ -119,7 +129,7 @@ module OpenStudio
119
129
 
120
130
  # check existing config
121
131
  needs_config = true
122
- if File.exist?('./.bundle/config')
132
+ if File.exist?('./.bundle/config') # checking wrt gemfile_dir
123
133
  puts 'config exists'
124
134
  needs_config = false
125
135
  config = YAML.load_file('./.bundle/config')
@@ -135,7 +145,7 @@ module OpenStudio
135
145
 
136
146
  # check existing platform
137
147
  needs_platform = true
138
- if File.exist?('Gemfile.lock')
148
+ if File.exist?('Gemfile.lock') # checking wrt gemfile_dir
139
149
  puts 'Gemfile.lock exists'
140
150
  gemfile_lock = Bundler::LockfileParser.new(Bundler.read_file('Gemfile.lock'))
141
151
  if gemfile_lock.platforms.include?('ruby')
@@ -164,9 +174,7 @@ module OpenStudio
164
174
 
165
175
  puts "needs_update = #{needs_update}"
166
176
  if needs_update
167
- # run_command('bundle update', get_clean_env)
168
- # KAF: updated to include specified gemfile_path...this didn't seem to work before
169
- run_command("bundle update --gemfile=#{@gemfile_path}", get_clean_env)
177
+ run_command('bundle update', get_clean_env)
170
178
  end
171
179
  ensure
172
180
  Dir.chdir(@original_dir)
@@ -220,8 +228,7 @@ module OpenStudio
220
228
  result = false
221
229
  original_dir = Dir.pwd
222
230
  begin
223
- Dir.chdir(@dirname)
224
-
231
+ Dir.chdir(@gemfile_dir)
225
232
  # DLM: using popen3 here can result in deadlocks
226
233
  stdout_str, stderr_str, status = Open3.capture3(env, command)
227
234
  if status.success?
@@ -656,7 +663,16 @@ module OpenStudio
656
663
  puts 'simulations are not performed, since to the @options[:run_simulations] is set to false'
657
664
  end
658
665
 
659
- # DLM: this does not always return false for failed CLI runs, consider checking for failed.job file as backup test
666
+ if @options[:run_simulations]
667
+ # Additional checks for failed CLI
668
+ if File.exist?(File.join(run_dir, 'failed.job'))
669
+ result = false
670
+ end
671
+
672
+ if !File.exist?(File.join(run_dir, 'finished.job'))
673
+ result = false
674
+ end
675
+ end
660
676
 
661
677
  return result
662
678
  end
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -1,5 +1,5 @@
1
1
  # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
3
  # All rights reserved.
4
4
  # Redistribution and use in source and binary forms, with or without
5
5
  # modification, are permitted provided that the following conditions are met:
@@ -35,6 +35,6 @@
35
35
 
36
36
  module OpenStudio
37
37
  module Extension
38
- VERSION = '0.3.0'.freeze
38
+ VERSION = '0.4.2'.freeze
39
39
  end
40
40
  end
@@ -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',
@@ -26,15 +26,16 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ['lib']
28
28
 
29
- spec.required_ruby_version = '~> 2.5.0'
29
+ spec.required_ruby_version = '~> 2.7.0'
30
30
 
31
- spec.add_dependency 'bcl', '~> 0.6.1'
32
- spec.add_dependency 'bundler', '~> 2.1'
31
+ spec.add_dependency 'bcl', '~> 0.7.0'
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-workflow', '~> 2.1.0'
35
- spec.add_dependency 'openstudio_measure_tester', '~> 0.2.3'
34
+ 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.13' # for os_lib unit tests
38
39
  spec.add_development_dependency 'rake', '~> 13.0'
39
40
  spec.add_development_dependency 'rspec', '~> 3.9'
40
41
  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.3.0
4
+ version: 0.4.2
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: 2020-09-28 00:00:00.000000000 Z
14
+ date: 2021-04-22 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: bcl
@@ -18,28 +19,28 @@ dependencies:
18
19
  requirements:
19
20
  - - "~>"
20
21
  - !ruby/object:Gem::Version
21
- version: 0.6.1
22
+ version: 0.7.0
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.6.1
29
+ version: 0.7.0
29
30
  - !ruby/object:Gem::Dependency
30
31
  name: bundler
31
32
  requirement: !ruby/object:Gem::Requirement
32
33
  requirements:
33
- - - "~>"
34
+ - - ">="
34
35
  - !ruby/object:Gem::Version
35
- version: '2.1'
36
+ version: 2.1.0
36
37
  type: :runtime
37
38
  prerelease: false
38
39
  version_requirements: !ruby/object:Gem::Requirement
39
40
  requirements:
40
- - - "~>"
41
+ - - ">="
41
42
  - !ruby/object:Gem::Version
42
- version: '2.1'
43
+ version: 2.1.0
43
44
  - !ruby/object:Gem::Dependency
44
45
  name: octokit
45
46
  requirement: !ruby/object:Gem::Requirement
@@ -60,28 +61,28 @@ dependencies:
60
61
  requirements:
61
62
  - - "~>"
62
63
  - !ruby/object:Gem::Version
63
- version: 2.1.0
64
+ version: 2.2.0
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: 2.1.0
71
+ version: 2.2.0
71
72
  - !ruby/object:Gem::Dependency
72
73
  name: openstudio_measure_tester
73
74
  requirement: !ruby/object:Gem::Requirement
74
75
  requirements:
75
76
  - - "~>"
76
77
  - !ruby/object:Gem::Version
77
- version: 0.2.3
78
+ version: 0.3.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: 0.2.3
85
+ version: 0.3.0
85
86
  - !ruby/object:Gem::Dependency
86
87
  name: parallel
87
88
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +97,20 @@ dependencies:
96
97
  - - "~>"
97
98
  - !ruby/object:Gem::Version
98
99
  version: 1.19.1
100
+ - !ruby/object:Gem::Dependency
101
+ name: openstudio-standards
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: 0.2.13
107
+ type: :development
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: 0.2.13
99
114
  - !ruby/object:Gem::Dependency
100
115
  name: rake
101
116
  requirement: !ruby/object:Gem::Requirement
@@ -125,11 +140,12 @@ dependencies:
125
140
  - !ruby/object:Gem::Version
126
141
  version: '3.9'
127
142
  description: openstudio base gem for creating generic extensions with encapsulated
128
- data and measures.
143
+ data and measures. Also contains ruby libraries that required by many measures.
129
144
  email:
130
145
  - katherine.fleming@nrel.gov
131
146
  - nicholas.long@nrel.gov
132
147
  - daniel.macumber@nrel.gov
148
+ - david.goldwasser@nrel.gov
133
149
  executables: []
134
150
  extensions: []
135
151
  extra_rdoc_files: []
@@ -217,7 +233,7 @@ licenses: []
217
233
  metadata:
218
234
  bug_tracker_uri: https://github.com/NREL/openstudio-extension-gem/issues
219
235
  changelog_uri: https://github.com/NREL/openstudio-extension-gem/blob/develop/CHANGELOG.md
220
- source_code_uri: https://github.com/NREL/openstudio-extension-gem/tree/v0.3.0
236
+ source_code_uri: https://github.com/NREL/openstudio-extension-gem/tree/v0.4.2
221
237
  post_install_message:
222
238
  rdoc_options: []
223
239
  require_paths:
@@ -226,15 +242,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
242
  requirements:
227
243
  - - "~>"
228
244
  - !ruby/object:Gem::Version
229
- version: 2.5.0
245
+ version: 2.7.0
230
246
  required_rubygems_version: !ruby/object:Gem::Requirement
231
247
  requirements:
232
248
  - - ">="
233
249
  - !ruby/object:Gem::Version
234
250
  version: '0'
235
251
  requirements: []
236
- rubyforge_project:
237
- rubygems_version: 2.7.6.2
252
+ rubygems_version: 3.1.4
238
253
  signing_key:
239
254
  specification_version: 4
240
255
  summary: openstudio base gem for creating generic extensions with encapsulated data