openstudio-extension 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbd3f65a4f467a9beee5439e58dbeddc445da4dfeb606d23547865a57d461d06
4
- data.tar.gz: 4f7c9792f4f9bc5419caff2aa57a4bd8dcdb4252ad8d77b8e6b28b50eedeeb99
3
+ metadata.gz: 6c5468ce39e3e858462a84b10da6eaf36ef110c8d6722256619eee95c4f0032c
4
+ data.tar.gz: d536d3216133d81b115ef61eab4ebc04c31d5842a23463674f038d1c65f92501
5
5
  SHA512:
6
- metadata.gz: 61f585def76ef5d6998892f74fe8338744df5c90cdb26b906a04dbc5c53e7cfa1524c23e6636b3fd08acfcb8a2a0b9378473c24253265a320585b576ac9c4692
7
- data.tar.gz: 6842e2d7eb60fd4d047d26e8b2e2e286819d3ed63a904f436bb1b8a28c2f469efcae2876eebf3372aad12716859d77350129f354a0336f8b4aedd31415cc953f
6
+ metadata.gz: f9305edc0f0a8fa54ba0ec4e0a4243f219a8d701018ec4dea4a2fb9662d1fe61f88923dce2abbe5c42e0f2f58a7dfc0eb3de3c632e7de3f3f160e728f032ea1e
7
+ data.tar.gz: 77b9a0cdba958bda77d308847c92478ba4ee2a8d20884af8498cc1982782b16a8f5fa38f5c9e59ed9a2badaa55527dbacd77e549d123533315500776c52e8c50
@@ -1,5 +1,13 @@
1
1
  # OpenStudio Extension Gem
2
2
 
3
+ ## Version 0.2.4
4
+
5
+ * Fixed upload of measures to BCL using rake tasks.
6
+ * Support economizer modeling when create_typical measure is split into two parts
7
+
8
+ Closed Issues: 1
9
+ - Fixed [#64]( https://github.com/NREL/openstudio-extension-gem/issues/64 ), README updates
10
+
3
11
  ## Version 0.2.3
4
12
 
5
13
  * Use new version of rubocop style from S3
data/README.md CHANGED
@@ -146,14 +146,17 @@ Common Rake Tasks that are available to derivative extension gems include:
146
146
 
147
147
  | Rake Task | Description |
148
148
  | --------- | ----------- |
149
+ | openstudio:bcl:test_login | Test BCL login |
150
+ | openstudio:bcl:search_measures | Search BCL |
151
+ | openstudio:bcl:stage[reset] | Copy the measures/components to a staging location |
152
+ | openstudio:bcl:push | Upload measures from the staging location |
153
+ | openstudio:change_log[start_date,end_date,apikey] | Print the change log from GitHub. Specify dates in yyyy-mm-dd format |
149
154
  | openstudio:list_measures | List all measures in the calling gem |
150
155
  | openstudio:measures:add_license | Add License File to measures in the calling gem |
151
156
  | openstudio:measures:add_readme | Add README.md.erb file if it and the README markdown file do not already exist for a measure |
152
157
  | openstudio:measures:copy_resources | Copy the resources files to individual measures in the calling gem |
153
158
  | openstudio:measures:update_copyright | Update copyright on measure files in the calling gem |
154
159
  | openstudio`:runner:`init | Create a runner.conf file running simulations |
155
- | openstudio:stage_bcl | Copy the measures to a location that can be uploaded to BCL |
156
- | openstudio:push_bcl | Upload measures from the specified location to the BCL |
157
160
  | openstudio:test_with_docker | Use openstudio docker image to run tests |
158
161
  | openstudio:test_with_openstudio | Use openstudio system ruby to run tests |
159
162
  | openstudio:update_measures | Run the CLI task to check for measure updates and update the measure xml files |
@@ -176,8 +179,12 @@ The following table contains all current extension gems.
176
179
  | OpenStudio Common Measures Gem | openstudio-common-measures | https://github.com/NREL/openstudio-common-measures-gem |
177
180
  | OpenStudio Model Articulation Gem | openstudio-model-articulation | https://github.com/NREL/openstudio-model-articulation-gem |
178
181
  | OpenStudio AEDG Gem | openstudio-aedg | https://github.com/NREL/openstudio-aedg-gem |
182
+ | OpenStudio Calibration Gem | openstudio-calibration | https://github.com/NREL/openstudio-calibration-gem |
183
+ | OpenStudio EE Gem | openstudio-ee | https://github.com/NREL/openstudio-ee-gem |
179
184
  | OpenStudio District Systems Gem | openstudio-district-systems | https://github.com/NREL/openstudio-district-systems-gem |
180
- | UrbanOpt GeoJSON Gem | urbanopt-geojson | https://github.com/urbanopt/urbanopt-geojson-gem |
185
+ | URBANopt Core Gem | urbanopt-core | https://github.com/urbanopt/urbanopt-core-gem |
186
+ | URBANopt GeoJSON Gem | urbanopt-geojson | https://github.com/urbanopt/urbanopt-geojson-gem |
187
+ | URBANopt Scenario Gem | urbanopt-scenario | https://github.com/urbanopt/urbanopt-scenario-gem |
181
188
  | BuildingSync Gem | buildingsync | https://github.com/BuildingSync/BuildingSync-gem |
182
189
 
183
190
  ### Initializing a new Extension Gem
@@ -236,8 +243,6 @@ Or install it yourself as:
236
243
 
237
244
  # TODO
238
245
 
239
- - [ ] Rake task ```stage_bcl``` _DLM: BCL gem should be a development dependency only until we can reduce its dependencies and remove native dependencies? should probably put it into a special group so we can bundle without it in openstudio-gems._
240
- - [ ] Rake task ```push_bcl``` _DLM: how do we want to test this?
241
246
  - [ ] Capture useful output from Travis (measure dashboard results, log files, zip of build products, etc) and put it somewhere (s3? naming convention?)
242
247
  - [ ] ```Extension::files_dir``` _DLM: I think this can have a default implementation, right?_
243
248
  - [ ] ```Extension::minimum_openstudio_version``` _DLM: should we rename? should people overwrite this in their class?_
@@ -226,5 +226,26 @@ module OpenStudio
226
226
 
227
227
  return osw
228
228
  end
229
+
230
+ ##
231
+ # Module method used to check whether a measure is present in an OSW file
232
+ ##
233
+ # @param [Hash] in_osw Initial OSW object as a Hash, keys should be symbolized
234
+ # @param [String] measure_dir_name Directory name of measure to set argument on
235
+ # @param [String] step_name Optional argument, if present used to further identify the measure
236
+ #
237
+ # @return [Boolean] true or false
238
+ def self.measure_in_osw(osw, measure_dir_name, step_name = nil)
239
+ result = false
240
+ osw[:steps].each do |step|
241
+ if step[:measure_dir_name] == measure_dir_name
242
+ if step_name.nil? || step[:name] == step_name
243
+ result = true
244
+ end
245
+ end
246
+ end
247
+
248
+ return result
249
+ end
229
250
  end
230
251
  end
@@ -2560,6 +2560,19 @@ module OsLib_ModelGeneration
2560
2560
  # Make the standard applier
2561
2561
  standard = Standard.build((args['template']).to_s)
2562
2562
 
2563
+ # validate climate zone
2564
+ if !args.has_key?('climate_zone') || args['climate_zone'] == 'Lookup From Model'
2565
+ climate_zone = standard.model_get_building_climate_zone_and_building_type(model)['climate_zone']
2566
+ runner.registerInfo("Using climate zone #{climate_zone} from model")
2567
+ else
2568
+ climate_zone = args['climate_zone']
2569
+ runner.registerInfo("Using climate zone #{climate_zone} from user arguments")
2570
+ end
2571
+ if climate_zone == ''
2572
+ runner.registerError("Could not determine climate zone from measure arguments or model.")
2573
+ return false
2574
+ end
2575
+
2563
2576
  # make sure daylight savings is turned on up prior to any sizing runs being done.
2564
2577
  if args['enable_dst']
2565
2578
  start_date = '2nd Sunday in March'
@@ -2646,13 +2659,6 @@ module OsLib_ModelGeneration
2646
2659
  else
2647
2660
  is_residential = 'No'
2648
2661
  end
2649
- if !args.has_key?('climate_zone') || args['climate_zone'] == 'Lookup From Model'
2650
- climate_zone = standard.model_get_building_climate_zone_and_building_type(model)['climate_zone']
2651
- runner.registerInfo("Using climate zone #{climate_zone} from model")
2652
- else
2653
- climate_zone = args['climate_zone']
2654
- runner.registerInfo("Using climate zone #{climate_zone} from user arguments")
2655
- end
2656
2662
  bldg_def_const_set = standard.model_add_construction_set(model, climate_zone, lookup_building_type, nil, is_residential)
2657
2663
  if bldg_def_const_set.is_initialized
2658
2664
  bldg_def_const_set = bldg_def_const_set.get
@@ -2797,16 +2803,25 @@ module OsLib_ModelGeneration
2797
2803
  end
2798
2804
  end
2799
2805
 
2800
- # TODO: - when add methods below add bool to enable/disable them with default value to true
2806
+ # add_daylighting_controls (since outdated measure don't have this default to true if arg not found)
2807
+ if !args.has_key?('add_daylighting_controls')
2808
+ args['add_daylighting_controls'] = true
2809
+ end
2810
+ if args['add_daylighting_controls']
2811
+ # remove add_daylighting_controls objects
2812
+ if args['remove_objects']
2813
+ model.getDaylightingControls.each(&:remove)
2814
+ end
2801
2815
 
2802
- # add daylight controls, need to perform a sizing run for 2010
2803
- if args['template'] == '90.1-2010'
2804
- if standard.model_run_sizing_run(model, "#{Dir.pwd}/SRvt") == false
2805
- log_messages_to_runner(runner, debug = true)
2806
- return false
2816
+ # add daylight controls, need to perform a sizing run for 2010
2817
+ if args['template'] == '90.1-2010'
2818
+ if standard.model_run_sizing_run(model, "#{Dir.pwd}/SRvt") == false
2819
+ log_messages_to_runner(runner, debug = true)
2820
+ return false
2821
+ end
2807
2822
  end
2808
- end
2809
2823
  standard.model_add_daylighting_controls(model)
2824
+ end
2810
2825
 
2811
2826
  # add refrigeration
2812
2827
  if args['add_refrigeration']
@@ -3034,20 +3049,6 @@ module OsLib_ModelGeneration
3034
3049
  end
3035
3050
  end
3036
3051
 
3037
- # add internal mass
3038
- if args['add_internal_mass']
3039
-
3040
- if args['remove_objects']
3041
- model.getSpaceLoads.each do |instance|
3042
- next unless instance.to_InternalMass.is_initialized
3043
- instance.remove
3044
- end
3045
- end
3046
-
3047
- # add internal mass to conditioned spaces; needs to happen after thermostats are applied
3048
- standard.model_add_internal_mass(model, primary_bldg_type)
3049
- end
3050
-
3051
3052
  # set unmet hours tolerance
3052
3053
  unmet_hrs_tol_r = args['unmet_hours_tolerance']
3053
3054
  unmet_hrs_tol_k = OpenStudio.convert(unmet_hrs_tol_r, 'R', 'K').get
@@ -138,7 +138,7 @@ module OpenStudio
138
138
  runner.update_copyright(@root_dir, @doc_templates_dir)
139
139
  end
140
140
 
141
- desc 'Print the change log from GitHub'
141
+ desc 'Print the change log from GitHub. Date format: yyyy-mm-dd'
142
142
  task :change_log, [:start_date, :end_date, :apikey] do |t, args|
143
143
  require 'change_log'
144
144
  cl = ChangeLog.new(@github_repo, *args)
@@ -334,6 +334,36 @@ module OpenStudio
334
334
  # grab all the updated content (measures and components) tar files and push to bcl
335
335
  items = []
336
336
  paths = Pathname.glob(@staged_path.to_s + '/update/*.tar.gz')
337
+ paths.each do |path|
338
+ # puts path
339
+ items << path.to_s
340
+ end
341
+ items.each do |item|
342
+ puts item.split('/').last
343
+ total_count += 1
344
+
345
+ receipt_file = File.dirname(item) + '/' + File.basename(item, '.tar.gz') + '.receipt'
346
+ if !reset && File.exist?(receipt_file)
347
+ skipped += 1
348
+ puts 'SKIP: receipt file found'
349
+ next
350
+ end
351
+
352
+ valid, res = bcl.update_content(item, true)
353
+ if valid
354
+ successes += 1
355
+ else
356
+ errors += 1
357
+ if res.key?(:error)
358
+ puts " ERROR MESSAGE: #{res[:error]}"
359
+ else
360
+ puts "ERROR MESSAGE: #{res.inspect.chomp}"
361
+ end
362
+ end
363
+ puts '', '---'
364
+ end
365
+
366
+ puts "****UPLOAD DONE**** #{total_count} total, #{successes} success, #{errors} failures, #{skipped} skipped"
337
367
  end
338
368
  end
339
369
  end
@@ -35,6 +35,6 @@
35
35
 
36
36
  module OpenStudio
37
37
  module Extension
38
- VERSION = '0.2.3'.freeze
38
+ VERSION = '0.2.4'.freeze
39
39
  end
40
40
  end
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency 'bundler', '~> 2.1'
33
33
  spec.add_dependency 'octokit', '~> 4.18.0' # for change logs
34
34
  spec.add_dependency 'openstudio-workflow', '~> 2.0.0'
35
- spec.add_dependency 'openstudio_measure_tester', '~> 0.2.2'
35
+ spec.add_dependency 'openstudio_measure_tester', '~> 0.2.3'
36
36
  spec.add_dependency 'parallel', '~> 1.19.1'
37
37
 
38
38
  spec.add_development_dependency 'rake', '~> 13.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katherine Fleming
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-05-11 00:00:00.000000000 Z
13
+ date: 2020-06-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bcl
@@ -74,14 +74,14 @@ dependencies:
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: 0.2.2
77
+ version: 0.2.3
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: 0.2.2
84
+ version: 0.2.3
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: parallel
87
87
  requirement: !ruby/object:Gem::Requirement
@@ -218,7 +218,7 @@ licenses: []
218
218
  metadata:
219
219
  bug_tracker_uri: https://github.com/NREL/openstudio-extension-gem/issues
220
220
  changelog_uri: https://github.com/NREL/openstudio-extension-gem/blob/develop/CHANGELOG.md
221
- source_code_uri: https://github.com/NREL/openstudio-extension-gem/tree/v0.2.3
221
+ source_code_uri: https://github.com/NREL/openstudio-extension-gem/tree/v0.2.4
222
222
  post_install_message:
223
223
  rdoc_options: []
224
224
  require_paths: