openstudio-calibration 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: 7194dfd20a78327be74f86f736c0bf86d7d13a63e8a6efbd27b962d711c11553
4
- data.tar.gz: d05a98095f956bcd2951f66d8e7f22c697e4744ad3a1c308587c7ffb1626e687
3
+ metadata.gz: eac9bb4d41324eb6e242acc9992c8537d6e04c0e5070f0f05295b629c3042174
4
+ data.tar.gz: 5a35325a01b65f110289464da004c64d50643442171d50d4c3123ba38afe9f45
5
5
  SHA512:
6
- metadata.gz: 1d343cc7da0a62b54e7509e014bd88c1bcea4477c624580f8425c4610b7b750ef7ae83254e876241161986253f807536e4791abb0430672f7aec27429d15f8f4
7
- data.tar.gz: 471684d460cc78da4319df65734f3268148f215c0394643e15beaf1f9b4c389dfe0938dd695d76b04c620f455f14893de153f2ec9f008161be9613840f073f8b
6
+ metadata.gz: 653b1de03b3e0487e3f4bad95b259f4408da04b7d24387cbed05cdcf1755821111ce4939735521de243bf83248c2df429bcb731cade49a99c056999985ca86f2
7
+ data.tar.gz: fbca18aea610444d1fcc04437ea33b12f8ef17849008d0f9b0d555ae434f1f163746d528fb38f7c35638649523c8c31811310d102a74d52f4c3689fcda2754d7
data/.rubocop.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  AllCops:
2
2
  Exclude:
3
3
  - 'spec/test_measures/**/*'
4
+
5
+ require: rubocop-performance
4
6
  inherit_from:
5
- - http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v3.yml
7
+ - http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v4.yml
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # OpenStudio Calibration Measures Gem
2
2
 
3
+ ## Version 0.5.0
4
+ * Support for OpenStudio 3.3 (upgrade to extension gem 0.5.1 and standards gem 0.2.15)
5
+ - Fixed [#35]( https://github.com/NREL/openstudio-calibration-gem/pull/35 ), adding compatibility matrix and contribution policy
6
+ - Fixed [#38]( https://github.com/NREL/openstudio-calibration-gem/pull/38 ), Add hoo var method argment to change hours of operation measure
7
+
3
8
  ## Version 0.4.0
4
9
 
5
10
  * Support Ruby ~> 2.7
data/Jenkinsfile CHANGED
@@ -1,10 +1,11 @@
1
1
  //Jenkins pipelines are stored in shared libraries. Please see: https://github.com/NREL/cbci_jenkins_libs
2
-
2
+
3
3
  @Library('cbci_shared_libs') _
4
4
 
5
- // Build for PR to develop branch only.
5
+ // Build for PR to develop branch only.
6
6
  if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) { // check if set
7
7
 
8
8
  openstudio_extension_gems()
9
+
10
+ }
9
11
 
10
- }
data/README.md CHANGED
@@ -20,9 +20,20 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install 'openstudio-calibration'
22
22
 
23
- ## Usage
23
+ # Compatibility Matrix
24
+
25
+ |OpenStudio Calibration Gem|OpenStudio|Ruby|
26
+ |:--------------:|:----------:|:--------:|
27
+ | 0.5.0 | 3.3 | 2.7 |
28
+ | 0.4.0 - 0.4.2 | 3.2 | 2.7 |
29
+ | 0.3.0 - 0.3.1 | 3.1 | 2.5 |
30
+ | 0.2.0 | 3.0 | 2.5 |
31
+ | 0.1.4 and below | 2.9 and below | 2.2.4 |
32
+
33
+ # Contributing
34
+
35
+ Please review the [OpenStudio Contribution Policy](https://openstudio.net/openstudio-contribution-policy) if you would like to contribute code to this gem.
24
36
 
25
- To be filled out later.
26
37
 
27
38
  # Releasing
28
39
 
@@ -1,7 +1,6 @@
1
1
  <?xml version="1.0"?>
2
2
  <measure>
3
3
  <schema_version>3.0</schema_version>
4
- <error>wrong number of arguments (given 1, expected 0)</error>
5
4
  <name>calibration_reports</name>
6
5
  <uid>2baede0a-65f3-47ec-b5f6-9c21d0f91aff</uid>
7
6
  <version_id>63aaeb4e-fd54-483b-92f4-7a5d893986bd</version_id>
@@ -1,7 +1,6 @@
1
1
  <?xml version="1.0"?>
2
2
  <measure>
3
3
  <schema_version>3.0</schema_version>
4
- <error>wrong number of arguments (given 1, expected 0)</error>
5
4
  <name>timeseries_objective_function</name>
6
5
  <uid>6804217d-4737-45f3-82df-b81393c29ce3</uid>
7
6
  <version_id>bdebe708-959f-448c-bcfe-085253520b90</version_id>
@@ -1,7 +1,6 @@
1
1
  <?xml version="1.0"?>
2
2
  <measure>
3
3
  <schema_version>3.0</schema_version>
4
- <error>wrong number of arguments (given 1, expected 0)</error>
5
4
  <name>timeseries_plot</name>
6
5
  <uid>6804217d-4737-45f3-82df-b81393c29ce7</uid>
7
6
  <version_id>c5ed3fd0-c97b-418b-9af6-3b960508699e</version_id>
@@ -74,12 +74,6 @@
74
74
  </attribute>
75
75
  </attributes>
76
76
  <files>
77
- <file>
78
- <filename>.gitkeep</filename>
79
- <filetype>gitkeep</filetype>
80
- <usage_type>doc</usage_type>
81
- <checksum>00000000</checksum>
82
- </file>
83
77
  <file>
84
78
  <filename>example_parametric_model.osm</filename>
85
79
  <filetype>osm</filetype>
@@ -118,6 +118,19 @@ This determine what fraction of occupancy be considered operating conditions. Th
118
118
 
119
119
 
120
120
 
121
+ ### Hours of Operation Variable Method for Scheudle Profile Formula.
122
+ If dynamically generate parametric schedules from current ruleset scheudles is selected ,this argument is used to determine if the schedule profile formulas define time of points in a profile as a a specific delta from the star, middle, or end of the horus of operation, or if the delta is fractaionl percentate of the horus fo operation ro non-operation/vacant time.
123
+ **Name:** hoo_var_method,
124
+ **Type:** Choice,
125
+ **Units:** ,
126
+ **Required:** true,
127
+ **Model Dependent:** false
128
+
129
+
130
+ **Choice Display Names** ["fractional", "hours"]
131
+
132
+
133
+
121
134
  ### Use model hours of operation as target
122
135
  The default behavior is for this to be false. This can not be used unless Dynamically generate parametric schedules from current ruleset schedules is set to false and if the schedules in the model already have parametric profiles. When changed to true all of the hours of operation start and duration values will be ignored as the bool to treat those values as relative or absolute. Instead the hours of operation schedules for the model will be used.
123
136
  **Name:** target_hoo_from_model,
@@ -143,6 +143,16 @@ class ShiftHoursOfOperation < OpenStudio::Measure::ModelMeasure
143
143
  fraction_of_daily_occ_range.setUnits('Hours')
144
144
  args << fraction_of_daily_occ_range
145
145
 
146
+ # argument to choose hour of operation variable method
147
+ choices = OpenStudio::StringVector.new
148
+ choices << 'fractional'
149
+ choices << 'hours'
150
+ hoo_var_method = OpenStudio::Measure::OSArgument.makeChoiceArgument('hoo_var_method', choices, true)
151
+ hoo_var_method.setDisplayName('Hours of Operation Variable Method for Scheudle Profile Formula.')
152
+ hoo_var_method.setDescription('If dynamically generate parametric schedules from current ruleset scheudles is selected ,this argument is used to determine if the schedule profile formulas define time of points in a profile as a a specific delta from the star, middle, or end of the horus of operation, or if the delta is fractaionl percentate of the horus fo operation ro non-operation/vacant time.')
153
+ hoo_var_method.setDefaultValue('fractional')
154
+ args << hoo_var_method
155
+
146
156
  # make an argument for target_hoo_from_model
147
157
  # Should only be true when infer_parametric_schedules is false
148
158
  target_hoo_from_model = OpenStudio::Measure::OSArgument.makeBoolArgument('target_hoo_from_model', true)
@@ -359,10 +369,13 @@ class ShiftHoursOfOperation < OpenStudio::Measure::ModelMeasure
359
369
  end
360
370
  else
361
371
  new_hoo_start = hoo_start_dows
362
- if hoo_start_dows + hoo_dur_dows <= 24.0
363
- new_hoo_end = hoo_start_dows + hoo_dur_dows
364
- else
365
- new_hoo_end = hoo_start_dows + hoo_dur_dows - 24.0
372
+ target_dur = hoo_dur_dows
373
+ if new_hoo_start + target_dur < 24.0
374
+ new_hoo_end = new_hoo_start + target_dur
375
+ elsif new_hoo_start + target_dur == 24.0
376
+ new_hoo_end = 0.0
377
+ else # greater than 24
378
+ new_hoo_end = new_hoo_start + target_dur - 24.0
366
379
  end
367
380
  end
368
381
 
@@ -443,11 +456,10 @@ class ShiftHoursOfOperation < OpenStudio::Measure::ModelMeasure
443
456
  end
444
457
 
445
458
  # model_setup_parametric_schedules
446
- # todo - there should be arg here that can have formula based on fraction of day and no hours is argument to gather_inputs_parametric_schedules method. need to update high level methods in standards to support input for this
447
- standard.model_setup_parametric_schedules(model, gather_data_only: false)
459
+ standard.model_setup_parametric_schedules(model, gather_data_only: false, hoo_var_method: args['hoo_var_method'])
448
460
  end
449
461
 
450
- # report final condition of model
462
+ # report initial condition of model
451
463
  hoo_summary_hash = hoo_summary(model, runner, standard)
452
464
  if !hoo_summary_hash[:zero_hoo].empty?
453
465
  runner.registerInitialCondition("Across the building the non-zero hours of operation range from #{hoo_summary_hash[:final_hoo_dur_range].min} hours to #{hoo_summary_hash[:final_hoo_dur_range].max} hours. Start of hours of operation range from #{hoo_summary_hash[:final_hoo_start_range].min} to #{hoo_summary_hash[:final_hoo_start_range].max}. One or more hours of operation schedules used contain a profile with 0 hours of operation.")
@@ -497,7 +509,7 @@ class ShiftHoursOfOperation < OpenStudio::Measure::ModelMeasure
497
509
  runner.registerFinalCondition("Across the building the hours of operation range from #{hoo_summary_hash[:final_hoo_dur_range].min} hours to #{hoo_summary_hash[:final_hoo_dur_range].max} hours. Start of hours of operation range from #{hoo_summary_hash[:final_hoo_start_range].min} to #{hoo_summary_hash[:final_hoo_start_range].max}.")
498
510
  end
499
511
 
500
- # get log messages (if debut in setup is true this will fail for error)
512
+ # get log messages (if debug in setup is true this will fail for error)
501
513
  OsLib_HelperMethods.log_msgs
502
514
 
503
515
  # TODO: - adding hours of operation to a schedule that doesn't have them to start with, like a sunday, can be problematic
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>shift_hours_of_operation</name>
5
5
  <uid>e8ae02a4-4be2-45c3-b85b-2a1d94662653</uid>
6
- <version_id>e49fc9ef-be88-4958-aa01-5c25c5ac37a2</version_id>
7
- <version_modified>20210423T201850Z</version_modified>
6
+ <version_id>25f89d69-3628-4e9f-9cc0-23ed036f451d</version_id>
7
+ <version_modified>20211016T194722Z</version_modified>
8
8
  <xml_checksum>4098406A</xml_checksum>
9
9
  <class_name>ShiftHoursOfOperation</class_name>
10
10
  <display_name>Shift Hours of Operation</display_name>
@@ -119,6 +119,25 @@
119
119
  <model_dependent>false</model_dependent>
120
120
  <default_value>0.25</default_value>
121
121
  </argument>
122
+ <argument>
123
+ <name>hoo_var_method</name>
124
+ <display_name>Hours of Operation Variable Method for Scheudle Profile Formula.</display_name>
125
+ <description>If dynamically generate parametric schedules from current ruleset scheudles is selected ,this argument is used to determine if the schedule profile formulas define time of points in a profile as a a specific delta from the star, middle, or end of the horus of operation, or if the delta is fractaionl percentate of the horus fo operation ro non-operation/vacant time.</description>
126
+ <type>Choice</type>
127
+ <required>true</required>
128
+ <model_dependent>false</model_dependent>
129
+ <default_value>fractional</default_value>
130
+ <choices>
131
+ <choice>
132
+ <value>fractional</value>
133
+ <display_name>fractional</display_name>
134
+ </choice>
135
+ <choice>
136
+ <value>hours</value>
137
+ <display_name>hours</display_name>
138
+ </choice>
139
+ </choices>
140
+ </argument>
122
141
  <argument>
123
142
  <name>target_hoo_from_model</name>
124
143
  <display_name>Use model hours of operation as target</display_name>
@@ -192,12 +211,6 @@
192
211
  </attribute>
193
212
  </attributes>
194
213
  <files>
195
- <file>
196
- <filename>.gitkeep</filename>
197
- <filetype>gitkeep</filetype>
198
- <usage_type>doc</usage_type>
199
- <checksum>00000000</checksum>
200
- </file>
201
214
  <file>
202
215
  <filename>example_model.osm</filename>
203
216
  <filetype>osm</filetype>
@@ -210,12 +223,6 @@
210
223
  <usage_type>readmeerb</usage_type>
211
224
  <checksum>232D0477</checksum>
212
225
  </file>
213
- <file>
214
- <filename>delta_values_false.osm</filename>
215
- <filetype>osm</filetype>
216
- <usage_type>test</usage_type>
217
- <checksum>21CE90F0</checksum>
218
- </file>
219
226
  <file>
220
227
  <filename>target_hoo_from_model.osm</filename>
221
228
  <filetype>osm</filetype>
@@ -228,23 +235,23 @@
228
235
  <usage_type>test</usage_type>
229
236
  <checksum>F2778476</checksum>
230
237
  </file>
231
- <file>
232
- <filename>README.md</filename>
233
- <filetype>md</filetype>
234
- <usage_type>readme</usage_type>
235
- <checksum>88FAD40B</checksum>
236
- </file>
237
238
  <file>
238
239
  <filename>LICENSE.md</filename>
239
240
  <filetype>md</filetype>
240
241
  <usage_type>license</usage_type>
241
242
  <checksum>A21A3ED2</checksum>
242
243
  </file>
244
+ <file>
245
+ <filename>delta_values_false.osm</filename>
246
+ <filetype>osm</filetype>
247
+ <usage_type>test</usage_type>
248
+ <checksum>03619D54</checksum>
249
+ </file>
243
250
  <file>
244
251
  <filename>shift_hours_of_operation_test.rb</filename>
245
252
  <filetype>rb</filetype>
246
253
  <usage_type>test</usage_type>
247
- <checksum>F983E36E</checksum>
254
+ <checksum>B59FCB5E</checksum>
248
255
  </file>
249
256
  <file>
250
257
  <version>
@@ -255,7 +262,19 @@
255
262
  <filename>measure.rb</filename>
256
263
  <filetype>rb</filetype>
257
264
  <usage_type>script</usage_type>
258
- <checksum>FAF9D893</checksum>
265
+ <checksum>09ED4734</checksum>
266
+ </file>
267
+ <file>
268
+ <filename>.gitkeep</filename>
269
+ <filetype>gitkeep</filetype>
270
+ <usage_type>doc</usage_type>
271
+ <checksum>00000000</checksum>
272
+ </file>
273
+ <file>
274
+ <filename>README.md</filename>
275
+ <filetype>md</filetype>
276
+ <usage_type>readme</usage_type>
277
+ <checksum>46CEB194</checksum>
259
278
  </file>
260
279
  </files>
261
280
  </measure>
@@ -35,6 +35,6 @@
35
35
 
36
36
  module OpenStudio
37
37
  module Calibration
38
- VERSION = '0.4.0'.freeze
38
+ VERSION = '0.5.0'.freeze
39
39
  end
40
40
  end
@@ -30,8 +30,8 @@ Gem::Specification.new do |spec|
30
30
  spec.required_ruby_version = '~> 2.7.0'
31
31
 
32
32
  spec.add_dependency 'bundler', '~> 2.1'
33
- spec.add_dependency 'openstudio-extension', '~> 0.4.2'
34
- spec.add_dependency 'openstudio-standards', '~> 0.2.13'
33
+ spec.add_dependency 'openstudio-extension', '~> 0.5.1'
34
+ spec.add_dependency 'openstudio-standards', '~> 0.2.15'
35
35
 
36
36
  spec.add_development_dependency 'rake', '~> 13.0'
37
37
  spec.add_development_dependency 'rspec', '~> 3.9'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-calibration
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
  - Brian Ball
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-04-23 00:00:00.000000000 Z
12
+ date: 2021-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -31,28 +31,28 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.4.2
34
+ version: 0.5.1
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.4.2
41
+ version: 0.5.1
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: openstudio-standards
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 0.2.13
48
+ version: 0.2.15
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.13
55
+ version: 0.2.15
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -296,7 +296,7 @@ licenses: []
296
296
  metadata:
297
297
  bug_tracker_uri: https://github.com/NREL/openstudio-calibration-gem/issues
298
298
  changelog_uri: https://github.com/NREL/openstudio-calibration-gem/blob/develop/CHANGELOG.md
299
- source_code_uri: https://github.com/NREL/openstudio-calibration-gem/tree/v0.4.0
299
+ source_code_uri: https://github.com/NREL/openstudio-calibration-gem/tree/v0.5.0
300
300
  post_install_message:
301
301
  rdoc_options: []
302
302
  require_paths: