openstudio-calibration 0.4.0 → 0.6.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: 333b762599adb79b796439d113959cc6925c82d8e4efed47579aec7ce2748394
4
+ data.tar.gz: 50bc1780606d0a715692e305f6b3a29b196965b91abb109ce534e46d688d43af
5
5
  SHA512:
6
- metadata.gz: 1d343cc7da0a62b54e7509e014bd88c1bcea4477c624580f8425c4610b7b750ef7ae83254e876241161986253f807536e4791abb0430672f7aec27429d15f8f4
7
- data.tar.gz: 471684d460cc78da4319df65734f3268148f215c0394643e15beaf1f9b4c389dfe0938dd695d76b04c620f455f14893de153f2ec9f008161be9613840f073f8b
6
+ metadata.gz: 6316a5449e432e7615f77681ecfd28d6773f6e3ee25633f2a8ca38ae177563a78909fd2f2c2ec9ff689a813709f67db0f43116a162f641fbe26e540073196d5e
7
+ data.tar.gz: 45c713f0c6a32482532b4012654af15d942a4674394f16e9acd2df806fb287e3c2e23472af18427778c294fda68dd25734d467c7c358bc32cadda9dc97a5a7cc
data/.gitignore CHANGED
@@ -28,3 +28,4 @@
28
28
  lib/measures/.rubocop.yml
29
29
  lib/test/*
30
30
  test_results/
31
+ /lib/measures/*/output/
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,18 @@
1
1
  # OpenStudio Calibration Measures Gem
2
2
 
3
+ ## Version 0.6.0
4
+ * Support for OpenStudio 3.4 (upgrade to standards gem 0.2.16, no extension gem upgrade)
5
+
6
+ ## Version 0.5.1
7
+ * Fixed [#24]( https://github.com/NREL/openstudio-calibration-gem/pull/24 ), HardSizeHvac: undefined method `runSizingRun'
8
+ * Fixed [#42]( https://github.com/NREL/openstudio-calibration-gem/pull/42 ), Update reporting measures in repo to pass in model = nil
9
+ * Fixed [#43]( https://github.com/NREL/openstudio-calibration-gem/pull/43 ), Check all measures in this repo for multiple tags
10
+
11
+ ## Version 0.5.0
12
+ * Support for OpenStudio 3.3 (upgrade to extension gem 0.5.1 and standards gem 0.2.15)
13
+ - Fixed [#35]( https://github.com/NREL/openstudio-calibration-gem/pull/35 ), adding compatibility matrix and contribution policy
14
+ - Fixed [#38]( https://github.com/NREL/openstudio-calibration-gem/pull/38 ), Add hoo var method argment to change hours of operation measure
15
+
3
16
  ## Version 0.4.0
4
17
 
5
18
  * 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,16 +20,32 @@ 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.6.0 | 3.4 | 2.7 |
28
+ | 0.5.0 | 3.3 | 2.7 |
29
+ | 0.4.0 - 0.4.2 | 3.2 | 2.7 |
30
+ | 0.3.0 - 0.3.1 | 3.1 | 2.5 |
31
+ | 0.2.0 | 3.0 | 2.5 |
32
+ | 0.1.4 and below | 2.9 and below | 2.2.4 |
33
+
34
+ # Contributing
35
+
36
+ Please review the [OpenStudio Contribution Policy](https://openstudio.net/openstudio-contribution-policy) if you would like to contribute code to this gem.
24
37
 
25
- To be filled out later.
26
38
 
27
39
  # Releasing
28
40
 
29
41
  * Update CHANGELOG.md
30
- * Run `rake rubocop:auto_correct`
42
+ * Run `rake openstudio:rubocop:auto_correct`
43
+ * Run `rake openstudio:update_copyright`
44
+ * Run `rake openstudio:update_measures` (this has to be done last since prior tasks alter measure files)
45
+ * Update version in `readme.md`
46
+ * Update version in `openstudio-calibration-measures.gemspec`
31
47
  * Update version in `/lib/openstudio/calibration_measures/version.rb`
32
48
  * Create PR to master, after tests and reviews complete, then merge
33
49
  * Locally - from the master branch, run `rake release`
34
- * 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.
50
+ * 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.
35
51
 
@@ -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>
@@ -3,9 +3,9 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>exterior_wall_thermal_properties_multiplier</name>
5
5
  <uid>6ab39cf2-1f9e-4570-a797-360a814aaa74</uid>
6
- <version_id>f6eb026d-b992-42cc-a11e-f6d8f2794127</version_id>
7
- <version_modified>20210304T152734Z</version_modified>
8
- <xml_checksum>31085437</xml_checksum>
6
+ <version_id>cc91b451-1ab1-4b68-9bef-d4e7575e6500</version_id>
7
+ <version_modified>20220223T012552Z</version_modified>
8
+ <xml_checksum>EB1A0C08</xml_checksum>
9
9
  <class_name>ExteriorWallThermalPropertiesMultiplier</class_name>
10
10
  <display_name>Exterior Wall Thermal Properties Multiplier</display_name>
11
11
  <description>Change exterior walls by altering the thermal resistance, density, and solar absorptance of the wall constructions by a Multiplier</description>
@@ -40,7 +40,6 @@
40
40
  <provenances />
41
41
  <tags>
42
42
  <tag>Envelope.Opaque</tag>
43
- <tag>Calibration</tag>
44
43
  </tags>
45
44
  <attributes>
46
45
  <attribute>
@@ -3,9 +3,9 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>exterior_wall_thermal_properties_percent_change</name>
5
5
  <uid>6ab39cf2-1f9e-4570-a797-360a814aaa64</uid>
6
- <version_id>90e96c89-f488-4f6a-a12d-1f15e0c3f304</version_id>
7
- <version_modified>20210304T152734Z</version_modified>
8
- <xml_checksum>31085437</xml_checksum>
6
+ <version_id>900fc466-62cd-4726-8917-164d0e5c670f</version_id>
7
+ <version_modified>20220223T012552Z</version_modified>
8
+ <xml_checksum>EB1A0C08</xml_checksum>
9
9
  <class_name>ExteriorWallThermalPropertiesPercentChange</class_name>
10
10
  <display_name>Exterior Wall Thermal Percent Change</display_name>
11
11
  <description>Change exterior walls by altering the thermal resistance, density, and solar absorptance of the wall constructions by a Percent Change</description>
@@ -40,7 +40,6 @@
40
40
  <provenances />
41
41
  <tags>
42
42
  <tag>Envelope.Opaque</tag>
43
- <tag>Calibration</tag>
44
43
  </tags>
45
44
  <attributes>
46
45
  <attribute>
@@ -66,13 +66,15 @@ class HardSizeHVAC < OpenStudio::Measure::ModelMeasure
66
66
  def run(model, runner, user_arguments)
67
67
  super(model, runner, user_arguments)
68
68
 
69
- # Require the HVAC sizing library
70
- # require_relative 'resources/HVACSizing.Model'
69
+ # Make the standard applier
70
+ standard = Standard.build('90.1-2004') # template choice doesn't matter
71
71
 
72
- # Run a sizing run and attach the resulting
73
- # sql file to the model. Hard sizing methods
74
- # won't work unless the model has a sql file.
75
- model.runSizingRun(Dir.pwd.to_s)
72
+ # Perform a sizing run (2.5.1 and later)
73
+ sizing_run_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/SR1').to_s
74
+ runner.registerInfo("Performing sizing run at #{sizing_run_path}.")
75
+ if standard.model_run_sizing_run(model, sizing_run_path) == false
76
+ return false
77
+ end
76
78
 
77
79
  # Hard sizing every object in the model.
78
80
  model.applySizingValues
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>hard_size_hvac</name>
5
5
  <uid>d7da749f-6318-4077-b502-25994a713b27</uid>
6
- <version_id>962f9f66-5795-4157-a3ee-7a335d81b576</version_id>
7
- <version_modified>20210304T152734Z</version_modified>
6
+ <version_id>0647d2b3-e8b0-4529-962f-dbb85d4945fa</version_id>
7
+ <version_modified>20220223T145950Z</version_modified>
8
8
  <xml_checksum>2B526343</xml_checksum>
9
9
  <class_name>HardSizeHVAC</class_name>
10
10
  <display_name>Hard Size HVAC</display_name>
@@ -71,12 +71,24 @@
71
71
  <version>
72
72
  <software_program>OpenStudio</software_program>
73
73
  <identifier>1.5.0</identifier>
74
- <min_compatible>1.5.0</min_compatible>
74
+ <min_compatible>2.5.1</min_compatible>
75
75
  </version>
76
76
  <filename>measure.rb</filename>
77
77
  <filetype>rb</filetype>
78
78
  <usage_type>script</usage_type>
79
- <checksum>63C57B08</checksum>
79
+ <checksum>0920138B</checksum>
80
+ </file>
81
+ <file>
82
+ <filename>small_office.osm</filename>
83
+ <filetype>osm</filetype>
84
+ <usage_type>test</usage_type>
85
+ <checksum>0FB2ACC8</checksum>
86
+ </file>
87
+ <file>
88
+ <filename>hard_size_hvac_test.rb</filename>
89
+ <filetype>rb</filetype>
90
+ <usage_type>test</usage_type>
91
+ <checksum>FA5BB28D</checksum>
80
92
  </file>
81
93
  </files>
82
94
  </measure>
@@ -3,9 +3,9 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>roof_thermal_properties_multiplier</name>
5
5
  <uid>6c4eb22b-770f-456c-bcd1-084cfad89eeb</uid>
6
- <version_id>9bd50108-91e3-43b5-a78e-8ccc0217b3af</version_id>
7
- <version_modified>20210304T152739Z</version_modified>
8
- <xml_checksum>31085437</xml_checksum>
6
+ <version_id>5fbeb5c9-bf38-4798-876e-ec5f23962ef0</version_id>
7
+ <version_modified>20220223T012552Z</version_modified>
8
+ <xml_checksum>EB1A0C08</xml_checksum>
9
9
  <class_name>RoofThermalPropertiesMultiplier</class_name>
10
10
  <display_name>Roof Thermal Properties Multiplier</display_name>
11
11
  <description>Change Roof by altering the thermal resistance, density, and solar absorptance of the wall constructions by a Multiplier</description>
@@ -40,7 +40,6 @@
40
40
  <provenances />
41
41
  <tags>
42
42
  <tag>Envelope.Opaque</tag>
43
- <tag>Calibration</tag>
44
43
  </tags>
45
44
  <attributes>
46
45
  <attribute>
@@ -3,9 +3,9 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>roof_thermal_properties_percent_change</name>
5
5
  <uid>07516685-60fd-4da8-9872-1154a995047d</uid>
6
- <version_id>aa00c9cc-3008-44d9-90c8-a50bac1cec43</version_id>
7
- <version_modified>20210304T152739Z</version_modified>
8
- <xml_checksum>31085437</xml_checksum>
6
+ <version_id>19d0d728-74c8-4344-94ea-af1f1e406f16</version_id>
7
+ <version_modified>20220223T012552Z</version_modified>
8
+ <xml_checksum>EB1A0C08</xml_checksum>
9
9
  <class_name>RoofThermalPropertiesPercentChange</class_name>
10
10
  <display_name>Roof Thermal Properties Percent Change</display_name>
11
11
  <description>Change Roof by altering the thermal resistance, density, and solar absorptance of the wall constructions by a Percent Change</description>
@@ -40,7 +40,6 @@
40
40
  <provenances />
41
41
  <tags>
42
42
  <tag>Envelope.Opaque</tag>
43
- <tag>Calibration</tag>
44
43
  </tags>
45
44
  <attributes>
46
45
  <attribute>
@@ -2,16 +2,16 @@
2
2
 
3
3
  ###### (Automatically generated documentation)
4
4
 
5
- #
5
+ # TimeSeries Objective Function
6
6
 
7
7
  ## Description
8
-
8
+ Creates Objective Function from Timeseries Data
9
9
 
10
10
  ## Modeler Description
11
-
11
+ Creates Objective Function from Timeseries Data. The measure applies a Norm at each timestep between the difference of CSV metered data and SQL model data. A timeseries plot can also be created. Possible outputs are 'cvrmse', 'nmbe', 'simdata' = sum of the simulated data, 'csvdata' = sum of metered data, 'diff' = P Norm between the metered and simulated data if Norm is 1 or 2, else its just the Difference.
12
12
 
13
13
  ## Measure Type
14
- ModelMeasure
14
+ ReportingMeasure
15
15
 
16
16
  ## Taxonomy
17
17
 
@@ -19,9 +19,175 @@ ModelMeasure
19
19
  ## Arguments
20
20
 
21
21
 
22
+ ### Path to CSV file for the metered data
23
+ Path to CSV file including file name.
24
+ **Name:** csv_name,
25
+ **Type:** String,
26
+ **Units:** ,
27
+ **Required:** true,
28
+ **Model Dependent:** false
29
+
30
+ ### CSV Time Header
31
+ CSV Time Header Value. Used to determine the timestamp column in the CSV file
32
+ **Name:** csv_time_header,
33
+ **Type:** String,
34
+ **Units:** ,
35
+ **Required:** true,
36
+ **Model Dependent:** false
37
+
38
+ ### CSV variable name
39
+ CSV variable name. Used to determine the variable column in the CSV file
40
+ **Name:** csv_var,
41
+ **Type:** String,
42
+ **Units:** ,
43
+ **Required:** true,
44
+ **Model Dependent:** false
45
+
46
+ ### Convert Units
47
+ Convert Units in Metered Data
48
+ **Name:** convert_data,
49
+ **Type:** Choice,
50
+ **Units:** ,
51
+ **Required:** true,
52
+ **Model Dependent:** false
53
+
54
+ ### CSV variable display name
55
+ CSV variable display name. Not yet Implemented
56
+ **Name:** csv_var_dn,
57
+ **Type:** String,
58
+ **Units:** ,
59
+ **Required:** true,
60
+ **Model Dependent:** false
61
+
62
+ ### Year in csv data timestamp
63
+ Is the Year in the csv data timestamp => mm:dd:yy or mm:dd (true/false)
64
+ **Name:** year,
65
+ **Type:** Boolean,
66
+ **Units:** ,
67
+ **Required:** true,
68
+ **Model Dependent:** false
69
+
70
+ ### Seconds in csv data timestamp
71
+ Is the Seconds in the csv data timestamp => hh:mm:ss or hh:mm (true/false)
72
+ **Name:** seconds,
73
+ **Type:** Boolean,
74
+ **Units:** ,
75
+ **Required:** true,
76
+ **Model Dependent:** false
77
+
78
+ ### SQL key value
79
+ SQL key value for the SQL query to find the variable in the SQL file
80
+ **Name:** key_value,
81
+ **Type:** String,
82
+ **Units:** ,
83
+ **Required:** true,
84
+ **Model Dependent:** false
85
+
86
+ ### TimeSeries Name
87
+ TimeSeries Name for the SQL query to find the variable in the SQL file
88
+ **Name:** timeseries_name,
89
+ **Type:** String,
90
+ **Units:** ,
91
+ **Required:** true,
92
+ **Model Dependent:** false
93
+
94
+ ### Reporting Frequency
95
+ Reporting Frequency for SQL Query
96
+ **Name:** reporting_frequency,
97
+ **Type:** Choice,
98
+ **Units:** ,
99
+ **Required:** true,
100
+ **Model Dependent:** false
101
+
102
+ ### Environment Period
103
+ Environment Period for SQL query
104
+ **Name:** environment_period,
105
+ **Type:** String,
106
+ **Units:** ,
107
+ **Required:** true,
108
+ **Model Dependent:** false
109
+
110
+ ### Norm of the difference of csv and sql
111
+ Norm of the difference of csv and sql. 1 is absolute value. 2 is euclidean distance. 3 is raw difference.
112
+ **Name:** norm,
113
+ **Type:** Double,
114
+ **Units:** ,
115
+ **Required:** true,
116
+ **Model Dependent:** false
117
+
118
+ ### Scale factor to apply to the difference
119
+ Scale factor to apply to the difference (1 is no scale)
120
+ **Name:** scale,
121
+ **Type:** Double,
122
+ **Units:** ,
123
+ **Required:** true,
124
+ **Model Dependent:** false
125
+
126
+ ### Find Available data in the SQL file
127
+ Will RegisterInfo all the 'EnvPeriod', 'ReportingFrequencies', 'VariableNames', 'KeyValues' in the SQL file. Useful for debugging SQL issues.
128
+ **Name:** find_avail,
129
+ **Type:** Boolean,
130
+ **Units:** ,
131
+ **Required:** true,
132
+ **Model Dependent:** false
133
+
134
+ ### algorithm_download
135
+ Make JSON data available for algorithm_download (true/false)
136
+ **Name:** algorithm_download,
137
+ **Type:** Boolean,
138
+ **Units:** ,
139
+ **Required:** true,
140
+ **Model Dependent:** false
141
+
142
+ ### plot_flag timeseries data
143
+ Create plot of timeseries data (true/false)
144
+ **Name:** plot_flag,
145
+ **Type:** Boolean,
146
+ **Units:** ,
147
+ **Required:** true,
148
+ **Model Dependent:** false
149
+
150
+ ### Plot name
151
+ Name to include in reporting file name.
152
+ **Name:** plot_name,
153
+ **Type:** String,
154
+ **Units:** ,
155
+ **Required:** true,
156
+ **Model Dependent:** false
157
+
158
+ ### verbose_messages
159
+ verbose messages. Useful for debugging but MAJOR Performance Hit.
160
+ **Name:** verbose_messages,
161
+ **Type:** Boolean,
162
+ **Units:** ,
163
+ **Required:** true,
164
+ **Model Dependent:** false
165
+
166
+ ### warning_messages
167
+ Warn on missing data.
168
+ **Name:** warning_messages,
169
+ **Type:** Boolean,
170
+ **Units:** ,
171
+ **Required:** true,
172
+ **Model Dependent:** false
173
+
174
+ ### add_first_zero_for_plots
175
+ Add a point of zero value to the plot at the beginning of the runperiod.
176
+ **Name:** add_first_zero_for_plots,
177
+ **Type:** Boolean,
178
+ **Units:** ,
179
+ **Required:** true,
180
+ **Model Dependent:** false
181
+
182
+ ### add_last_zero_for_plots
183
+ Add a point of zero value to the plot at the end of the runperiod.
184
+ **Name:** add_last_zero_for_plots,
185
+ **Type:** Boolean,
186
+ **Units:** ,
187
+ **Required:** true,
188
+ **Model Dependent:** false
22
189
 
23
190
 
24
- This measure does not have any user arguments
25
191
 
26
192
 
27
193
 
@@ -59,7 +59,7 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
59
59
  end
60
60
 
61
61
  # define the arguments that the user will input
62
- def arguments
62
+ def arguments(model = nil)
63
63
  args = OpenStudio::Measure::OSArgumentVector.new
64
64
 
65
65
  # the name of the sql file