openstudio-load-flexibility-measures 0.4.0 → 0.5.0

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: ba9d3616f380a2d146dbcf715762d0bfc5e7e69e044a35aad45ea13348d3bda1
4
- data.tar.gz: d80e555d5f0f1d7de0c311439d55cd5dfc94a9c3a6fff3ae08cbf9d05603b81c
3
+ metadata.gz: 58c0563232be8b88f9766cd0ca55fc83f282b141cc13dc55bdde3b24124c4c20
4
+ data.tar.gz: aaaea1cd2ec323627f0920bd06793100f4915699f8ab8095674153dbaf19eb80
5
5
  SHA512:
6
- metadata.gz: 380c25229c694f6fc82581bdc81f70be63891fdd15d8f28efb27e198b1859202f25cd9474f968d354a455e55b34034718f795211278bff4f8f633acfbf4347f3
7
- data.tar.gz: 618b69125cc4d8f06f8399aeef4d770c6db63efed4d285c0ef5da4e83e4dab92852ca46b8a99ca7385d9ee439bfbfb0dc356891154d6477f22d7a3fd22650b71
6
+ metadata.gz: 833b28b174e78831ce682c558b0f6c4e99da74183b60e6fd2dd11c9f6f6178729b6ce2a5a30a51de3a962e79eb8bfa4d66e5712df85877f3bcce39f625a2d2e6
7
+ data.tar.gz: b53231a2296561ba29e069733f0e41fda1b5003d1d1fca852e2c1728dd33741b2bf20a6cf9a2ee06daa3d203af614a658ceb940ce9cc9a99548892e0f3728bef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # OpenStudio Load Flexibility Measures Gem
2
2
 
3
+ ## Version 0.5.0
4
+ * Updated OS Standards dependency to 0.2.16
5
+ * Fixed [#41](https://github.com/NREL/openstudio-load-flexibility-measures-gem/issues/41), Error in applying add_hpwh measure with "non-simplified" options to MF prototype building in OS 3.3
6
+
3
7
  ## Version 0.4.0
4
8
  * Updated OS Extension dependency to 0.5.1
5
9
  * Updated OS Standards dependency to 0.2.15
data/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted
4
+ provided that the following conditions are met:
5
+
6
+ (1) Redistributions of source code must retain the above copyright notice, this list of conditions
7
+ and the following disclaimer.
8
+
9
+ (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
10
+ and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+ (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
13
+ or promote products derived from this software without specific prior written permission from the
14
+ respective party.
15
+
16
+ (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
17
+ derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
18
+ designation without specific prior written permission from Alliance for Sustainable Energy, LLC.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
21
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
23
+ OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
25
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -31,6 +31,7 @@ Detailed instructions for usage are included in each measure's respective README
31
31
 
32
32
  |OpenStudio Load Flexibility Measures Gem|OpenStudio|Ruby|
33
33
  |:--------------:|:----------:|:--------:|
34
+ | 0.5 | 3.4 | 2.7 |
34
35
  | 0.4 | 3.2 | 2.7 |
35
36
  | 0.3.2 | 3.2 | 2.7 |
36
37
  | 0.2.0 - 0.2.1 | 3.1 | 2.5 |
@@ -43,11 +44,14 @@ Please review the [OpenStudio Contribution Policy](https://openstudio.net/openst
43
44
 
44
45
  # Releasing
45
46
 
46
- * Update CHANGELOG.md
47
- * Run rake rubocop:auto_correct
48
- * Update version in `/lib/openstudio/openstudio-load-flexibility-measures/version.rb`
47
+ * Update `CHANGELOG.md`
48
+ * Run `rake rubocop:auto_correct`
49
+ * Run `rake openstudio:update_copyright`
50
+ * Run `rake openstudio:update_measures` (this has to be done last since prior tasks alter measure files)
51
+ * Update version in `readme.md`
52
+ * Update version in `openstudio-load-flexibility.gemspec`
53
+ * Update version in `/lib/openstudio/load-flexibility/version.rb`
49
54
  * Create PR to master, after tests and reviews complete, then merge
50
- * Locally - from the master branch, run rake release
51
- * Release via github
55
+ * Locally - from the master branch, run `rake release`
52
56
  * On GitHub, go to the releases page and update the latest release tag. Name it “Version x.y.z” and copy the CHANGELOG entry into the description box.
53
57
 
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>add_central_ice_storage</name>
5
5
  <uid>48f37812-0cb6-4770-b695-beb8d8a5660d</uid>
6
- <version_id>9f1db6c9-821d-4074-808f-f99782d223e9</version_id>
7
- <version_modified>20211110T211234Z</version_modified>
6
+ <version_id>f8f68f4a-4f32-4051-8f1f-0ec842998763</version_id>
7
+ <version_modified>20220505T192248Z</version_modified>
8
8
  <xml_checksum>6394841D</xml_checksum>
9
9
  <class_name>AddCentralIceStorage</class_name>
10
10
  <display_name>Add Central Ice Storage</display_name>
@@ -464,23 +464,23 @@
464
464
  <usage_type>doc</usage_type>
465
465
  <checksum>090841B0</checksum>
466
466
  </file>
467
- <file>
468
- <filename>LICENSE.md</filename>
469
- <filetype>md</filetype>
470
- <usage_type>license</usage_type>
471
- <checksum>E0468DD6</checksum>
472
- </file>
473
467
  <file>
474
468
  <filename>README.md</filename>
475
469
  <filetype>md</filetype>
476
470
  <usage_type>readme</usage_type>
477
471
  <checksum>962B1D2E</checksum>
478
472
  </file>
473
+ <file>
474
+ <filename>LICENSE.md</filename>
475
+ <filetype>md</filetype>
476
+ <usage_type>license</usage_type>
477
+ <checksum>E0468DD6</checksum>
478
+ </file>
479
479
  <file>
480
480
  <filename>OsLib_Schedules.rb</filename>
481
481
  <filetype>rb</filetype>
482
482
  <usage_type>resource</usage_type>
483
- <checksum>3E001F89</checksum>
483
+ <checksum>64AFEC72</checksum>
484
484
  </file>
485
485
  <file>
486
486
  <filename>add_central_ice_storage_test.rb</filename>
@@ -94,6 +94,7 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
94
94
 
95
95
  # find available water heaters and get default volume
96
96
  default_vol = 80.0 # gallons
97
+ wheaters = []
97
98
  wh_names = ['All Water Heaters (Simplified Only)']
98
99
  if !model.getWaterHeaterMixeds.empty?
99
100
  wheaters = model.getWaterHeaterMixeds
@@ -283,6 +284,18 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
283
284
  db_temp = runner.getDoubleArgumentValue('db_temp', user_arguments)
284
285
  sched = runner.getStringArgumentValue('sched', user_arguments)
285
286
 
287
+ # get zone of one was selected
288
+ if zone.to_s != 'N/A - Simplified'
289
+ if model.getThermalZoneByName(zone).is_initialized
290
+ zone = model.getThermalZoneByName(zone).get
291
+ else
292
+ runner.registerError("Could not find zone named #{zone} in the moodel")
293
+ return false
294
+ end
295
+ else
296
+ zone = 'N/A - Simplified'
297
+ end
298
+
286
299
  4.times do |n|
287
300
  flex << runner.getStringArgumentValue("flex#{n}", user_arguments)
288
301
  flex_hrs << runner.getStringArgumentValue("flex_hrs#{n}", user_arguments)
@@ -531,12 +544,11 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
531
544
  # => openstudio-standards/prototypes/common/objects/Prototype.ServiceWaterHeating.rb
532
545
  if type != 'Simplified'
533
546
  # convert zone name from STRING into OS model OBJECT
534
- zone = model.getThermalZoneByName(zone).get
535
547
  hpwh = std.model_add_heatpump_water_heater(model, # model
536
548
  type: type, # type
537
549
  water_heater_capacity: (cap * 1000 / cop), # water_heater_capacity
538
550
  electric_backup_capacity: (bu_cap * 1000), # electric_backup_capacity
539
- water_heater_volume: v, # water_heater_volume
551
+ water_heater_volume: v.to_f, # water_heater_volume
540
552
  service_water_temperature: OpenStudio.convert(140.0, 'F', 'C').get, # service_water_temperature
541
553
  parasitic_fuel_consumption_rate: 3.0, # parasitic_fuel_consumption_rate
542
554
  swh_temp_sch: sched, # swh_temp_sch
@@ -548,7 +560,6 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
548
560
  flowrate_schedule: nil, # flowrate_schedule
549
561
  water_heater_thermal_zone: zone) # water_heater_thermal_zone
550
562
  else
551
- # zone = whtr.ambientTemperatureThermalZone.get
552
563
  hpwh = std.model_add_water_heater(model, # model
553
564
  (cap * 1000), # water_heater_capacity
554
565
  v.to_f, # water_heater_volume
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>add_hpwh</name>
5
5
  <uid>518cde6f-1806-4b9a-bee9-ccaac49c7a53</uid>
6
- <version_id>daec8b02-d60d-467c-bdea-201f81f56b8c</version_id>
7
- <version_modified>20211110T211234Z</version_modified>
6
+ <version_id>67268596-50cb-4f0e-8fc2-9c6b5690ceb3</version_id>
7
+ <version_modified>20220505T192247Z</version_modified>
8
8
  <xml_checksum>A374667A</xml_checksum>
9
9
  <class_name>AddHpwh</class_name>
10
10
  <display_name>Add HPWH for Domestic Hot Water</display_name>
@@ -363,12 +363,6 @@ The flexibility of the system is based on user-defined temperatures and times, w
363
363
  <usage_type>test</usage_type>
364
364
  <checksum>EB637B7E</checksum>
365
365
  </file>
366
- <file>
367
- <filename>LICENSE.md</filename>
368
- <filetype>md</filetype>
369
- <usage_type>license</usage_type>
370
- <checksum>E0468DD6</checksum>
371
- </file>
372
366
  <file>
373
367
  <filename>Flexible Domestic Hot Water Implementation Guide.pdf</filename>
374
368
  <filetype>pdf</filetype>
@@ -381,6 +375,12 @@ The flexibility of the system is based on user-defined temperatures and times, w
381
375
  <usage_type>readme</usage_type>
382
376
  <checksum>5E6E20CF</checksum>
383
377
  </file>
378
+ <file>
379
+ <filename>LICENSE.md</filename>
380
+ <filetype>md</filetype>
381
+ <usage_type>license</usage_type>
382
+ <checksum>E0468DD6</checksum>
383
+ </file>
384
384
  <file>
385
385
  <version>
386
386
  <software_program>OpenStudio</software_program>
@@ -390,13 +390,13 @@ The flexibility of the system is based on user-defined temperatures and times, w
390
390
  <filename>measure.rb</filename>
391
391
  <filetype>rb</filetype>
392
392
  <usage_type>script</usage_type>
393
- <checksum>B90CA863</checksum>
393
+ <checksum>B3DC865B</checksum>
394
394
  </file>
395
395
  <file>
396
396
  <filename>add_hpwh_test.rb</filename>
397
397
  <filetype>rb</filetype>
398
398
  <usage_type>test</usage_type>
399
- <checksum>35D3782E</checksum>
399
+ <checksum>DB9A9CE2</checksum>
400
400
  </file>
401
401
  </files>
402
402
  </measure>
@@ -85,12 +85,12 @@ class AddHpwhTest < Minitest::Test
85
85
  measure.run(model, runner, argument_map)
86
86
  result = runner.result
87
87
 
88
- # assert that it ran correctly
89
- assert_equal('Success', result.value.valueName)
90
-
91
88
  # show the output
92
89
  show_output(result)
93
90
 
91
+ # assert that it ran correctly
92
+ assert_equal('Success', result.value.valueName)
93
+
94
94
  # save the model to test output directory
95
95
  output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
96
96
  model.save(output_file_path, true)
@@ -134,4 +134,104 @@ class AddHpwhTest < Minitest::Test
134
134
  assert_equal('Fail', result.value.valueName)
135
135
  assert(result.errors.size == 1)
136
136
  end
137
+
138
+ def test_custom_args_PumpedCondenser_specific_zone
139
+ # create an instance of the measure
140
+ measure = AddHpwh.new
141
+
142
+ # create runner with empty OSW
143
+ osw = OpenStudio::WorkflowJSON.new
144
+ runner = OpenStudio::Measure::OSRunner.new(osw)
145
+
146
+ # load the test model
147
+ translator = OpenStudio::OSVersion::VersionTranslator.new
148
+ path = "#{File.dirname(__FILE__)}/SmallHotel-2A.osm"
149
+ model = translator.loadModel(path)
150
+ assert(!model.empty?)
151
+ model = model.get
152
+
153
+ # get arguments
154
+ arguments = measure.arguments(model)
155
+ argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
156
+
157
+ # create hash of argument values.
158
+ # If the argument has a default that you want to use, you don't need it in the hash
159
+ args_hash = {}
160
+ args_hash['zone'] = 'FrontOfficeFlr1 ZN'
161
+ args_hash['type'] = 'PumpedCondenser'
162
+ # using defaults values from measure.rb for other arguments
163
+
164
+ # populate argument with specified hash value if specified
165
+ arguments.each do |arg|
166
+ temp_arg_var = arg.clone
167
+ if args_hash.key?(arg.name)
168
+ assert(temp_arg_var.setValue(args_hash[arg.name]))
169
+ end
170
+ argument_map[arg.name] = temp_arg_var
171
+ end
172
+
173
+ # run the measure
174
+ measure.run(model, runner, argument_map)
175
+ result = runner.result
176
+
177
+ # show the output
178
+ show_output(result)
179
+
180
+ # assert that it ran correctly
181
+ assert_equal('Success', result.value.valueName)
182
+
183
+ # save the model to test output directory
184
+ output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
185
+ model.save(output_file_path, true)
186
+ end
187
+
188
+ def test_custom_args_WrappedCondenser_specific_zone
189
+ # create an instance of the measure
190
+ measure = AddHpwh.new
191
+
192
+ # create runner with empty OSW
193
+ osw = OpenStudio::WorkflowJSON.new
194
+ runner = OpenStudio::Measure::OSRunner.new(osw)
195
+
196
+ # load the test model
197
+ translator = OpenStudio::OSVersion::VersionTranslator.new
198
+ path = "#{File.dirname(__FILE__)}/SmallHotel-2A.osm"
199
+ model = translator.loadModel(path)
200
+ assert(!model.empty?)
201
+ model = model.get
202
+
203
+ # get arguments
204
+ arguments = measure.arguments(model)
205
+ argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
206
+
207
+ # create hash of argument values.
208
+ # If the argument has a default that you want to use, you don't need it in the hash
209
+ args_hash = {}
210
+ args_hash['zone'] = 'FrontOfficeFlr1 ZN'
211
+ args_hash['type'] = 'WrappedCondenser'
212
+ # using defaults values from measure.rb for other arguments
213
+
214
+ # populate argument with specified hash value if specified
215
+ arguments.each do |arg|
216
+ temp_arg_var = arg.clone
217
+ if args_hash.key?(arg.name)
218
+ assert(temp_arg_var.setValue(args_hash[arg.name]))
219
+ end
220
+ argument_map[arg.name] = temp_arg_var
221
+ end
222
+
223
+ # run the measure
224
+ measure.run(model, runner, argument_map)
225
+ result = runner.result
226
+
227
+ # show the output
228
+ show_output(result)
229
+
230
+ # assert that it ran correctly
231
+ assert_equal('Success', result.value.valueName)
232
+
233
+ # save the model to test output directory
234
+ output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
235
+ model.save(output_file_path, true)
236
+ end
137
237
  end
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>add_packaged_ice_storage</name>
5
5
  <uid>2aa8c128-53b9-49fd-9aaf-9253a1f05936</uid>
6
- <version_id>e2b362ea-1e2a-44b0-8f2b-add4d320b86d</version_id>
7
- <version_modified>20211110T211235Z</version_modified>
6
+ <version_id>0169e58e-3682-493d-a4a3-60e58eca98d8</version_id>
7
+ <version_modified>20220505T192248Z</version_modified>
8
8
  <xml_checksum>2617824F</xml_checksum>
9
9
  <class_name>AddPackagedIceStorage</class_name>
10
10
  <display_name>Add Packaged Ice Storage</display_name>
@@ -212,18 +212,18 @@ If 'AutoSize' is selected for ice capacity, these inputs set an ice capacity siz
212
212
  <usage_type>test</usage_type>
213
213
  <checksum>DC0DCC4B</checksum>
214
214
  </file>
215
- <file>
216
- <filename>LICENSE.md</filename>
217
- <filetype>md</filetype>
218
- <usage_type>license</usage_type>
219
- <checksum>E0468DD6</checksum>
220
- </file>
221
215
  <file>
222
216
  <filename>README.md</filename>
223
217
  <filetype>md</filetype>
224
218
  <usage_type>readme</usage_type>
225
219
  <checksum>E6FBC489</checksum>
226
220
  </file>
221
+ <file>
222
+ <filename>LICENSE.md</filename>
223
+ <filetype>md</filetype>
224
+ <usage_type>license</usage_type>
225
+ <checksum>E0468DD6</checksum>
226
+ </file>
227
227
  <file>
228
228
  <filename>add_packaged_ice_storage_test.rb</filename>
229
229
  <filetype>rb</filetype>
@@ -35,6 +35,6 @@
35
35
 
36
36
  module OpenStudio
37
37
  module LoadFlexibilityMeasures
38
- VERSION = '0.4.0'.freeze
38
+ VERSION = '0.5.0'.freeze
39
39
  end
40
40
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_dependency 'bundler', '~> 2.1'
27
27
  spec.add_dependency 'openstudio-extension', '~> 0.5.1'
28
- spec.add_dependency 'openstudio-standards', '~> 0.2.15'
28
+ spec.add_dependency 'openstudio-standards', '~> 0.2.16'
29
29
 
30
30
  spec.add_development_dependency 'rake', '~> 13.0'
31
31
  spec.add_development_dependency 'rspec', '~> 3.9'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-load-flexibility-measures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Heine
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-11-17 00:00:00.000000000 Z
12
+ date: 2022-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 0.2.15
48
+ version: 0.2.16
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 0.2.15
55
+ version: 0.2.16
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -109,6 +109,7 @@ files:
109
109
  - CHANGELOG.md
110
110
  - Gemfile
111
111
  - Jenkinsfile
112
+ - LICENSE.md
112
113
  - README.md
113
114
  - Rakefile
114
115
  - doc_templates/LICENSE.md