urbanopt-reopt 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +27 -0
  3. data/.rakeTasks +7 -0
  4. data/.rdoc_options +37 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +9 -0
  7. data/.travis.yml +22 -0
  8. data/CHANGELOG.md +5 -0
  9. data/Gemfile +67 -0
  10. data/Jenkinsfile +10 -0
  11. data/LICENSE.md +27 -0
  12. data/RDOC_MAIN.md +176 -0
  13. data/README.md +177 -0
  14. data/Rakefile +30 -0
  15. data/deploy_docs.sh +5 -0
  16. data/developer_nrel_key.rb +31 -0
  17. data/doc_templates/LICENSE.md +27 -0
  18. data/doc_templates/README.md.erb +42 -0
  19. data/doc_templates/copyright_erb.txt +31 -0
  20. data/doc_templates/copyright_js.txt +4 -0
  21. data/doc_templates/copyright_ruby.txt +29 -0
  22. data/docs/.gitignore +3 -0
  23. data/docs/.vuepress/components/InnerJsonSchema.vue +78 -0
  24. data/docs/.vuepress/components/JsonSchema.vue +12 -0
  25. data/docs/.vuepress/components/ReoptInputSchema.vue +12 -0
  26. data/docs/.vuepress/components/ReoptOutputSchema.vue +12 -0
  27. data/docs/.vuepress/components/StaticLink.vue +8 -0
  28. data/docs/.vuepress/config.js +16 -0
  29. data/docs/.vuepress/highlight.js +8 -0
  30. data/docs/.vuepress/public/custom_rdoc_styles.css +58 -0
  31. data/docs/.vuepress/utils.js +17 -0
  32. data/docs/README.md +196 -0
  33. data/docs/package-lock.json +254 -0
  34. data/docs/package.json +22 -0
  35. data/docs/schemas/reopt-input-schema.md +57 -0
  36. data/docs/schemas/reopt-output-schema.md +66 -0
  37. data/index.html +1 -0
  38. data/index.md +176 -0
  39. data/lib/files/.gitkeep +0 -0
  40. data/lib/urbanopt/reopt/extension.rb +44 -0
  41. data/lib/urbanopt/reopt/feature_report_adapter.rb +364 -0
  42. data/lib/urbanopt/reopt/reopt_lite_api.rb +230 -0
  43. data/lib/urbanopt/reopt/reopt_logger.rb +42 -0
  44. data/lib/urbanopt/reopt/reopt_post_processor.rb +245 -0
  45. data/lib/urbanopt/reopt/reopt_schema/reopt_input_schema.json +1111 -0
  46. data/lib/urbanopt/reopt/reopt_schema/reopt_output_schema.json +538 -0
  47. data/lib/urbanopt/reopt/scenario/reopt_scenario_csv.rb +115 -0
  48. data/lib/urbanopt/reopt/scenario_report_adapter.rb +404 -0
  49. data/lib/urbanopt/reopt/version.rb +35 -0
  50. data/lib/urbanopt/reopt.rb +36 -0
  51. data/lib/urbanopt/reopt_scenario.rb +31 -0
  52. data/lib/urbanopt-reopt.rb +31 -0
  53. data/urbanopt-reopt.gemspec +33 -0
  54. metadata +194 -0
@@ -0,0 +1,254 @@
1
+ {
2
+ "name": "urbanopt-reopt-gem-docs",
3
+ "version": "0.1.0",
4
+ "lockfileVersion": 1,
5
+ "requires": true,
6
+ "dependencies": {
7
+ "@babel/code-frame": {
8
+ "version": "7.0.0-beta.47",
9
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.47.tgz",
10
+ "integrity": "sha512-W7IeG4MoVf4oUvWfHUx9VG9if3E0xSUDf1urrnNYtC2ow1dz2ptvQ6YsJfyVXDuPTFXz66jkHhzMW7a5Eld7TA==",
11
+ "requires": {
12
+ "@babel/highlight": "7.0.0-beta.47"
13
+ }
14
+ },
15
+ "@babel/core": {
16
+ "version": "7.0.0-beta.47",
17
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.0.0-beta.47.tgz",
18
+ "integrity": "sha512-7EIuAX0UVnCgZ0E9tz9rFK0gd+aovwMA9bul+dnkmBQYLrJdas2EHMUSmaK67i1cyZpvgVvXhHtXJxC7wo3rlQ==",
19
+ "requires": {
20
+ "@babel/code-frame": "7.0.0-beta.47",
21
+ "@babel/generator": "7.0.0-beta.47",
22
+ "@babel/helpers": "7.0.0-beta.47",
23
+ "@babel/template": "7.0.0-beta.47",
24
+ "@babel/traverse": "7.0.0-beta.47",
25
+ "@babel/types": "7.0.0-beta.47",
26
+ "babylon": "7.0.0-beta.47",
27
+ "convert-source-map": "^1.1.0",
28
+ "debug": "^3.1.0",
29
+ "json5": "^0.5.0",
30
+ "lodash": "^4.17.5",
31
+ "micromatch": "^2.3.11",
32
+ "resolve": "^1.3.2",
33
+ "semver": "^5.4.1",
34
+ "source-map": "^0.5.0"
35
+ }
36
+ },
37
+ "@babel/generator": {
38
+ "version": "7.0.0-beta.47",
39
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.47.tgz",
40
+ "integrity": "sha512-fJP+9X+gqgTTZzTqrKJHwebPwt6S/e/4YuyRyKyWHAIirGgUwjRoZgbFci24wwGYMJW7nlkCSwWG7QvCVsG0eg==",
41
+ "requires": {
42
+ "@babel/types": "7.0.0-beta.47",
43
+ "jsesc": "^2.5.1",
44
+ "lodash": "^4.17.5",
45
+ "source-map": "^0.5.0",
46
+ "trim-right": "^1.0.1"
47
+ }
48
+ },
49
+ "@babel/helper-annotate-as-pure": {
50
+ "version": "7.0.0-beta.47",
51
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.47.tgz",
52
+ "integrity": "sha512-Pjxb/PrxyKWc7jcAXlawvNAQMxxY+tSSNC5wxJstJjpO10mocmGzBOqNYjxdvVhMb3d0BEPQ8mR+D65fFpZ+TA==",
53
+ "requires": {
54
+ "@babel/types": "7.0.0-beta.47"
55
+ }
56
+ },
57
+ "@babel/helper-builder-binary-assignment-operator-visitor": {
58
+ "version": "7.0.0-beta.47",
59
+ "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.0.0-beta.47.tgz",
60
+ "integrity": "sha512-nv8d6TcDBb1CJMQzwab/e0rqyqoP9d2AQBjr4GdSiVRpJX4aiLEiLBm2XprdEb/sVIRmmBnVxPXJaHDsS/K2fw==",
61
+ "requires": {
62
+ "@babel/helper-explode-assignable-expression": "7.0.0-beta.47",
63
+ "@babel/types": "7.0.0-beta.47"
64
+ }
65
+ },
66
+ "@babel/helper-call-delegate": {
67
+ "version": "7.0.0-beta.47",
68
+ "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.0.0-beta.47.tgz",
69
+ "integrity": "sha512-Rx9TRmCCEP0pWau9gfR6ubcbbX3nVc4ImNY143ftC70jrKdSv5rS20yz2cmCilDzhexwGZQ3PFwOLKe3C/5aEg==",
70
+ "requires": {
71
+ "@babel/helper-hoist-variables": "7.0.0-beta.47",
72
+ "@babel/traverse": "7.0.0-beta.47",
73
+ "@babel/types": "7.0.0-beta.47"
74
+ }
75
+ },
76
+ "@babel/helper-define-map": {
77
+ "version": "7.0.0-beta.47",
78
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.47.tgz",
79
+ "integrity": "sha512-pLB9RY7GZKcc/frzgfDY/HwdqxWPe60qMAvNUef1V1bDZ8i4AUgxAANgltFzj61t100WGhqaS0xGkALD+9VA+g==",
80
+ "requires": {
81
+ "@babel/helper-function-name": "7.0.0-beta.47",
82
+ "@babel/types": "7.0.0-beta.47",
83
+ "lodash": "^4.17.5"
84
+ }
85
+ },
86
+ "@babel/helper-explode-assignable-expression": {
87
+ "version": "7.0.0-beta.47",
88
+ "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.0.0-beta.47.tgz",
89
+ "integrity": "sha512-1mwk27zmhSuMUcVWxw5ZKiPYfuWXviZNqgA4OvFBloPf9R+dKDhNgP2uUrkHh68ltVVc3Bup1nsbd/2KM5AxEw==",
90
+ "requires": {
91
+ "@babel/traverse": "7.0.0-beta.47",
92
+ "@babel/types": "7.0.0-beta.47"
93
+ }
94
+ },
95
+ "@babel/helper-function-name": {
96
+ "version": "7.0.0-beta.47",
97
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.47.tgz",
98
+ "integrity": "sha512-0LSvt95XCYaOrDA5K68KkTyldKXizDwBnKACdYzQszp1GdbtzmSeGwFU5Ecw86fU6bkYXtDvkFTOQwk/WQSJPw==",
99
+ "requires": {
100
+ "@babel/helper-get-function-arity": "7.0.0-beta.47",
101
+ "@babel/template": "7.0.0-beta.47",
102
+ "@babel/types": "7.0.0-beta.47"
103
+ }
104
+ },
105
+ "@babel/helper-get-function-arity": {
106
+ "version": "7.0.0-beta.47",
107
+ "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.47.tgz",
108
+ "integrity": "sha512-63j0i3YUW8CO//uQc3ACffJdIlYcIlysuHjMF0yzQhqKoQ/CUPv0hf3nBwdRGjiWrr3JcL6++NF4XmXdwSU+fA==",
109
+ "requires": {
110
+ "@babel/types": "7.0.0-beta.47"
111
+ }
112
+ },
113
+ "@babel/helper-hoist-variables": {
114
+ "version": "7.0.0-beta.47",
115
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0-beta.47.tgz",
116
+ "integrity": "sha512-5BcKFhyzrsInlrfO/tGoe6khUuJzGfROD7oozF/5MWsKo/c3gVJfQ5y83lZ4XoTKJt/x4PQlLU0aHd/SJpYONA==",
117
+ "requires": {
118
+ "@babel/types": "7.0.0-beta.47"
119
+ }
120
+ },
121
+ "@babel/helper-member-expression-to-functions": {
122
+ "version": "7.0.0-beta.47",
123
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0-beta.47.tgz",
124
+ "integrity": "sha512-gpipslnZw2hcVGADUtqQII9KF8FPpRZsVUXwKP/0EnWwtujRFSVL+u2Fh+VXODRAxFmTLo6eGcOr/Vfan0MqYw==",
125
+ "requires": {
126
+ "@babel/types": "7.0.0-beta.47"
127
+ }
128
+ },
129
+ "@babel/helper-module-imports": {
130
+ "version": "7.0.0-beta.47",
131
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.47.tgz",
132
+ "integrity": "sha512-Rk43Ty+a6npu9znK22IqFlseStRGWxEHi2cjmLbbi63VGiseofdUtIJI65F9MTCuMTXAX7VbY/ghef1Jp5qpvw==",
133
+ "requires": {
134
+ "@babel/types": "7.0.0-beta.47",
135
+ "lodash": "^4.17.5"
136
+ }
137
+ },
138
+ "@babel/helper-module-transforms": {
139
+ "version": "7.0.0-beta.47",
140
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.0.0-beta.47.tgz",
141
+ "integrity": "sha512-CziMe30ZunAhe6j05oNOFOg7im1lcv3dYuMxrwBYVe9YdP4NHPU7a1wrDBUhaPmyqTIZDwGnFne7k1KP79SeGQ==",
142
+ "requires": {
143
+ "@babel/helper-module-imports": "7.0.0-beta.47",
144
+ "@babel/helper-simple-access": "7.0.0-beta.47",
145
+ "@babel/helper-split-export-declaration": "7.0.0-beta.47",
146
+ "@babel/template": "7.0.0-beta.47",
147
+ "@babel/types": "7.0.0-beta.47",
148
+ "lodash": "^4.17.5"
149
+ }
150
+ },
151
+ "@babel/helper-optimise-call-expression": {
152
+ "version": "7.0.0-beta.47",
153
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0-beta.47.tgz",
154
+ "integrity": "sha512-NhnGhjwrhzGas4A/PoBDEtEPCGJHrzhaT6qGmo1hmkA2orG4UNi7KENC38DhJII0n2oUrKUuzTwgCvxKOTiHbw==",
155
+ "requires": {
156
+ "@babel/types": "7.0.0-beta.47"
157
+ }
158
+ },
159
+ "@babel/helper-plugin-utils": {
160
+ "version": "7.0.0-beta.47",
161
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0-beta.47.tgz",
162
+ "integrity": "sha512-GR67o8boOKVJRKM5Nhk7oVEHpxYy8R00lwu0F82WxxBH+iiT26DqW1e/4w/mo7Bdn1A6l0pNaOlNk1PdM2Hgag=="
163
+ },
164
+ "@babel/helper-regex": {
165
+ "version": "7.0.0-beta.47",
166
+ "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.0.0-beta.47.tgz",
167
+ "integrity": "sha512-dafidvVkjJP5AIWkJspV+7RGj1jeNts0qYvlmVzqAGb6BmQzEldJr6ZPzrmlpW/AW1YJGdw7br2yiwvlCRqDvQ==",
168
+ "requires": {
169
+ "lodash": "^4.17.5"
170
+ }
171
+ },
172
+ "@babel/helper-remap-async-to-generator": {
173
+ "version": "7.0.0-beta.47",
174
+ "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.47.tgz",
175
+ "integrity": "sha512-Nmj3lUHQscD160asav2bZ3sMIjGwGY9r6Vrriy9TqH7bmaClKUKUs5Twv0htFWfOKNFLEeY/MaqiAXylr1GS2w==",
176
+ "requires": {
177
+ "@babel/helper-annotate-as-pure": "7.0.0-beta.47",
178
+ "@babel/helper-wrap-function": "7.0.0-beta.47",
179
+ "@babel/template": "7.0.0-beta.47",
180
+ "@babel/traverse": "7.0.0-beta.47",
181
+ "@babel/types": "7.0.0-beta.47"
182
+ }
183
+ },
184
+ "@babel/helper-replace-supers": {
185
+ "version": "7.0.0-beta.47",
186
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.0.0-beta.47.tgz",
187
+ "integrity": "sha512-yf2JAD1+xNTjavqazqknRgPfd6MbGfvfIcAkxWsPURynAwOMSs4zThED8ImT2d5a97rGPysRJcq1jNh2L0WYxg==",
188
+ "requires": {
189
+ "@babel/helper-member-expression-to-functions": "7.0.0-beta.47",
190
+ "@babel/helper-optimise-call-expression": "7.0.0-beta.47",
191
+ "@babel/traverse": "7.0.0-beta.47",
192
+ "@babel/types": "7.0.0-beta.47"
193
+ }
194
+ },
195
+ "@babel/helper-simple-access": {
196
+ "version": "7.0.0-beta.47",
197
+ "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.0.0-beta.47.tgz",
198
+ "integrity": "sha512-sd2t3QDKjd+hHkJKaC2AX39l6oIil1N548oMZAtV5YHlVGoWWkAVGnPMxRg7ICEjIftCU3ZI6UeaogyEhF8t7Q==",
199
+ "requires": {
200
+ "@babel/template": "7.0.0-beta.47",
201
+ "@babel/types": "7.0.0-beta.47",
202
+ "lodash": "^4.17.5"
203
+ }
204
+ },
205
+ "@babel/helper-split-export-declaration": {
206
+ "version": "7.0.0-beta.47",
207
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.47.tgz",
208
+ "integrity": "sha512-jx8GmxryT6Qy4+24W6M6TnVL9T8bxqdyg5UKHjxBdw0Y2Sano1n0WphUS2seuOugn04W2ZQLqGc0ut8nGe/taA==",
209
+ "requires": {
210
+ "@babel/types": "7.0.0-beta.47"
211
+ }
212
+ },
213
+ "@babel/helper-wrap-function": {
214
+ "version": "7.0.0-beta.47",
215
+ "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.0.0-beta.47.tgz",
216
+ "integrity": "sha512-SAasvh80Mz5q9x15dqH6z8jpM0WTBmxQSNZATSwJwhmWdme6r2gxpufIMr8LwQIJHmXmgNLmvh0zdWSbE/PR4Q==",
217
+ "requires": {
218
+ "@babel/helper-function-name": "7.0.0-beta.47",
219
+ "@babel/template": "7.0.0-beta.47",
220
+ "@babel/traverse": "7.0.0-beta.47",
221
+ "@babel/types": "7.0.0-beta.47"
222
+ }
223
+ },
224
+ "@babel/helpers": {
225
+ "version": "7.0.0-beta.47",
226
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.0.0-beta.47.tgz",
227
+ "integrity": "sha512-uWk7gIua2COEWLwZGxfF5Wq1bgXOt1V6xzWxqeFznrA6F1TUPiAhkK5zORiZEa5RAILp6Mswsn3xFjDyCpp3rQ==",
228
+ "requires": {
229
+ "@babel/template": "7.0.0-beta.47",
230
+ "@babel/traverse": "7.0.0-beta.47",
231
+ "@babel/types": "7.0.0-beta.47"
232
+ }
233
+ },
234
+ "@babel/highlight": {
235
+ "version": "7.0.0-beta.47",
236
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.47.tgz",
237
+ "integrity": "sha512-d505K3Hth1eg0b2swfEF7oFMw3J9M8ceFg0s6dhCSxOOF+07WDvJ0HKT/YbK/Jk9wn8Wyr6HIRAUPKJ9Wfv8Rg==",
238
+ "requires": {
239
+ "chalk": "^2.0.0",
240
+ "esutils": "^2.0.2",
241
+ "js-tokens": "^3.0.0"
242
+ }
243
+ },
244
+ "@babel/plugin-proposal-async-generator-functions": {
245
+ "version": "7.0.0-beta.47",
246
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.47.tgz",
247
+ "integrity": "sha512-TQMLYVIqQ0MqVS1Z7jsuv3HlEetLo/7EnDY9mGBZ4c4/WLD/mu+tFuLiK2/2QH5wgi5viRfJGs/+L5TaDzxWng==",
248
+ "requires": {
249
+ "@babel/helper-plugin-utils": "7.0.0-beta.47",
250
+ "@babel/helper-remap-async-to-generator": "7.0.0-beta.47",
251
+ "@babel/plugin-syntax-async-generators": "7.0.0-beta.47"
252
+ }
253
+ },
254
+ "@babel/plugin-proposal-
data/docs/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "urbanopt-reopt-gem-docs",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "dev": "vuepress dev",
8
+ "build": "vuepress build",
9
+ "deploy": "gh-pages -d .vuepress/dist"
10
+ },
11
+ "author": "NREL",
12
+ "dependencies": {
13
+ "highlight.js": "^9.15.6",
14
+ "json-schema-ref-parser": "^6.1.0",
15
+ "json-schema-view-js": "git+https://git@github.com/bgschiller/json-schema-view-js.git",
16
+ "vuepress": "^0.14.10",
17
+ "webpack-dev-middleware": "^3.6.0"
18
+ },
19
+ "devDependencies": {
20
+ "gh-pages": "^2.0.1"
21
+ }
22
+ }
@@ -0,0 +1,57 @@
1
+ # REopt Lite Inputs Schema
2
+
3
+ The following shows the complete set of inputs to the REopt Lite AP which is called internally by the REopt Gem. You may refer to the data dictionary below in creating similarly formatted .json files containing alternatives to the defaults for optional parameters (i.e. specific utility rate, installed cost assumptions, solar PV losses, ...). The URBANopt REopt Gem will overwrite latitude, longitude, land_acres, roof_squarefeet, and loads_kw where possible from attributes of a Scenario Report and FeatureReports.
4
+
5
+ ## Data Dictionary
6
+
7
+ <ReoptInputSchema />
8
+
9
+ ## Required Inputs
10
+
11
+ The only required parameters to the REopt Lite API (called internally by the gem) are:
12
+ - *latitude*
13
+ - *longitude*
14
+ - *urdb_response*
15
+ Or one of the following sets: *urdb_label*; *blended_monthly_rates_us_dollars_per_kwh*; *blended_annual_demand_charges_us_dollars_per_kw* **and** *blended_annual_rates_us_dollars_per_kwh*
16
+
17
+ - *loads_kw*
18
+
19
+ Or one of the following sets: *doe_reference_name* **and** *annual_kwh*, *doe_reference_name* **and** *monthly_totals_kwh*
20
+
21
+ The gem sources *latitude*, *longitude* and *loads_kw* from a Feature or Scenario Report directly. If no specific *urdb_response* or *urdb_label* is specified as an custom assumption (see below), then a constant rate of $0.13/kWh with no demand charge is provided by the gem as a default to the REopt API.
22
+
23
+ Otherwise, all non-required input parameters will be filled in with default values unless otherwise specified. For an example of a minimally viable REopt Lite input, see:
24
+
25
+
26
+ ```
27
+ {
28
+ "Scenario": {
29
+ "Site":{
30
+ "latiude":45,
31
+ "longitude":-110,
32
+ "ElectricTariff": {
33
+ "urdb_label":"594976725457a37b1175d089"
34
+ },
35
+ "LoadProfile":{
36
+ "doe_reference_name":"Hospital",
37
+ "annual_kwh":1000000
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## Setting Custom Assumptions
45
+
46
+ If you wish to use custom input parameters, other than default values, you have a couple of options.
47
+
48
+ * 1) Custom hashes, formatted as described above, can be directly paramaterized when invoking _reopt_json_from_scenario_report_ or _reopt_jsons_from_scenario_feature_reports_ from a **URBANopt::REopt::ScenarioReportAdapter**, or _reopt_json_from_feature_report_ from a **URBANopt::REopt::FeatureReportAdapter**.
49
+
50
+ * 2) Paths to custom hashes, formatted as described above and saved as JSON files in a common folder, can be specified in the input REopt Scenario CSV. See the [example project](https://github.com/TK-23/urbanopt-example-geojson-reopt-project.git) for more information on how to do this.
51
+
52
+
53
+ <style type="text/css">
54
+ .content { max-width: 1200px !important; }
55
+ span.default { color: yellow !important; }
56
+ .description { color: #E0E0E0 !important; }
57
+ </style>
@@ -0,0 +1,66 @@
1
+ # REopt Lite Outputs Schema
2
+
3
+ When the gem calls the REopt Lite APUI it recieves the following complete set of results described in the data dictionary below. Only those needed to update a Feature or Scenario Report's distributed_generation attibute set and timeseries CSV are pulled from the reponse and transferred to the Feature or Scenario Report. You may choose to modify the code to include more or less of the full REopt Lite response.
4
+
5
+ ## Data Dictionary
6
+ <ReoptOutputSchema />
7
+
8
+ ## Updated from the Data Dictionary
9
+
10
+ ### Distributed Generation Attributes
11
+ The REopt Lite API updates the distributed_generation attributes of a Scenario or Feature Report as shown in an example below.
12
+
13
+ ```
14
+ "distributed_generation": {
15
+ "lcc_us_dollars": 100000000.0,
16
+ "npv_us_dollars": 10000000.0,
17
+ "year_one_energy_cost_us_dollars": 7000000.0,
18
+ "year_one_demand_cost_us_dollars": 3000000.0,
19
+ "year_one_bill_us_dollars": 10000000.0,
20
+ "total_energy_cost_us_dollars": 70000000.0,
21
+ "solar_pv": {
22
+ "size_kw": 30000.0
23
+ },
24
+ "wind": {
25
+ "size_kw": 0.0
26
+ },
27
+ "generator": {
28
+ "size_kw": 0.0
29
+ },
30
+ "storage": {
31
+ "size_kw": 2000.0,
32
+ "size_kwh": 5000.0
33
+ }
34
+ }
35
+ ```
36
+
37
+ ### Timeseries CSV
38
+ REopt Lite API responses also map dispatches to the following columns in an updated timeseries CSV for a Feature or Scenario Report.
39
+
40
+ | output | unit |
41
+ | -----------------------------------------| ------- |
42
+ | ElectricityProduced:Total | kWh |
43
+ | Electricity:Load:Total | kWh |
44
+ | Electricity:Grid:ToLoad | kWh |
45
+ | Electricity:Grid:ToBattery | kWh |
46
+ | Electricity:Storage:ToLoad | kWh |
47
+ | Electricity:Storage:ToGrid | kWh |
48
+ | Electricity:Storage:StateOfCharge | kWh |
49
+ | ElectricityProduced:Generator:Total | kWh |
50
+ | ElectricityProduced:Generator:ToBattery | kWh |
51
+ | ElectricityProduced:Generator:ToLoad | kWh |
52
+ | ElectricityProduced:Generator:ToGrid | kWh |
53
+ | ElectricityProduced:PV:Total | kWh |
54
+ | ElectricityProduced:PV:ToBattery | kWh |
55
+ | ElectricityProduced:PV:ToLoad | kWh |
56
+ | ElectricityProduced:PV:ToGrid | kWh |
57
+ | ElectricityProduced:Wind:Total | kWh |
58
+ | ElectricityProduced:Wind:ToBattery | kWh |
59
+ | ElectricityProduced:Wind:ToLoad | kWh |
60
+ | ElectricityProduced:Wind:ToGrid | kWh |
61
+
62
+ <style type="text/css">
63
+ .content { max-width: 1200px !important; }
64
+ span.default { color: yellow !important; }
65
+ .description { color: #E0E0E0 !important; }
66
+ </style>
data/index.html ADDED
@@ -0,0 +1 @@
1
+ HI
data/index.md ADDED
@@ -0,0 +1,176 @@
1
+ # **URBANopt REopt Gem**
2
+
3
+ The **URBANopt REopt Gem** extends **URBANopt::Scenario::DefaultReports::ScenarioReport** and **URBANopt::Scenario::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt Lite](https://reopt.nrel.gov/tool) decision support platform.
4
+ REopt Lite is a technoeconomic model which leverages mixed integer linear programming to identify the cost-optimal sizing of solar PV, Wind, Storage and/or diesel generation given an electric load profile, a utility rate tariff and other technoeconomic parameters. See [https://developer.nrel.gov/docs/energy-optimization/reopt-v1/](https://developer.nrel.gov/docs/energy-optimization/reopt-v1/) for more detailed information on input parameters and default assumptions.
5
+
6
+ See the [example project](https://github.com/urbanopt/urbanopt-example-reopt-project.git) for more infomation about usage of this gem.
7
+
8
+ <b>Note:</b> This module requires an API Key from the [NREL Developer Network](https://developer.nrel.gov/)
9
+
10
+ ## Installation
11
+
12
+ See [https://docs.urbanopt.net/installation/installation.html](https://docs.urbanopt.net/installation/installation.html) for instructions on prerequiste software, including:
13
+ - Ruby 2.2.6
14
+ - Bundler 1.17.0
15
+ - OpenStudio 2.8.1
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ ```ruby
20
+ gem 'urbanopt-reopt'
21
+ ```
22
+
23
+ And then execute:
24
+
25
+ $ bundle install
26
+ $ bundle update
27
+
28
+ Or install it yourself as:
29
+
30
+ $ gem install 'urbanopt-reopt'
31
+
32
+ ## Functionality
33
+
34
+ This gem is used to call the REopt Lite API on a Scenario Report or Feature Report to update the object's Distributed Generation attributes (including system financial and sizing metrics) as shown in an example below:
35
+
36
+ ```
37
+ "distributed_generation": {
38
+ "lcc_us_dollars": 100000000.0,
39
+ "npv_us_dollars": 10000000.0,
40
+ "year_one_energy_cost_us_dollars": 7000000.0,
41
+ "year_one_demand_cost_us_dollars": 3000000.0,
42
+ "year_one_bill_us_dollars": 10000000.0,
43
+ "total_energy_cost_us_dollars": 70000000.0,
44
+ "solar_pv": {
45
+ "size_kw": 30000.0
46
+ },
47
+ "wind": {
48
+ "size_kw": 0.0
49
+ },
50
+ "generator": {
51
+ "size_kw": 0.0
52
+ },
53
+ "storage": {
54
+ "size_kw": 2000.0,
55
+ "size_kwh": 5000.0
56
+ }
57
+ }
58
+ ```
59
+
60
+ Moreover, the following optimal dispatch fields are added to its timeseries CSV. Where no system component is recommended the dispatch will be all zero (i.e. if no solar PV is recommended ElectricityProduced:PV:Total will be always be zero)
61
+
62
+ ```
63
+ | output | unit |
64
+ | -----------------------------------------| ------- |
65
+ | ElectricityProduced:Total | kWh |
66
+ | Electricity:Load:Total | kWh |
67
+ | Electricity:Grid:ToLoad | kWh |
68
+ | Electricity:Grid:ToBattery | kWh |
69
+ | Electricity:Storage:ToLoad | kWh |
70
+ | Electricity:Storage:ToGrid | kWh |
71
+ | Electricity:Storage:StateOfCharge | kWh |
72
+ | ElectricityProduced:Generator:Total | kWh |
73
+ | ElectricityProduced:Generator:ToBattery | kWh |
74
+ | ElectricityProduced:Generator:ToLoad | kWh |
75
+ | ElectricityProduced:Generator:ToGrid | kWh |
76
+ | ElectricityProduced:PV:Total | kWh |
77
+ | ElectricityProduced:PV:ToBattery | kWh |
78
+ | ElectricityProduced:PV:ToLoad | kWh |
79
+ | ElectricityProduced:PV:ToGrid | kWh |
80
+ | ElectricityProduced:Wind:Total | kWh |
81
+ | ElectricityProduced:Wind:ToBattery | kWh |
82
+ | ElectricityProduced:Wind:ToLoad | kWh |
83
+ | ElectricityProduced:Wind:ToGrid | kWh |
84
+ ```
85
+
86
+ The REopt Lite has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See [https://developer.nrel.gov/docs/energy-optimization/reopt-v1/](https://developer.nrel.gov/docs/energy-optimization/reopt-v1/) for more detailed information on input parameters and default assumptions.
87
+
88
+ <b>Note:</b> Required attributes for a REopt run include latitude and longitude. If no utility rate is specified in your REopt Lite assumption settings, then a constant default rate of $0.13 is assumed without demand charges. Also, by default, only solar PV and storage are considered in the analysis (i.e. Wind and Generators are excluded from consideration).
89
+
90
+
91
+
92
+ ## Getting Started
93
+
94
+ The code below shows how to run the REopt API on a single Feature Report hash using this gem:
95
+
96
+ ```ruby
97
+ require 'urbanopt/reopt'
98
+ #Load a Feature Report Hash
99
+ feature_reports_hash = {} # <insert a Feature Report hash here>
100
+
101
+ #Create a Feature Report
102
+ feature_report = URBANopt::Scenario::DefaultReports::FeatureReport.new(feature_reports_hash)
103
+
104
+ #Specify a file name where REopt Lite results will be written in JSON format
105
+ reopt_output_file = File.join(feature_report.directory_name, 'feature_report_reopt_run1.json')
106
+
107
+ #Specify a file name where the new timeseries CSV will be written after REopt Lite has determined cost optimal dispatch
108
+ timeseries_output_file = File.join(feature_report.directory_name, 'feature_report_timeseries1.csv')
109
+
110
+ #Specify non-default REopt Lite assumptions, saved in JSON format, to be used in calling the API
111
+ reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
112
+
113
+ #Create a REopt Lite Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
114
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_NREL_KEY)
115
+
116
+ #Call REopt Lite with the post processor to update the feature's distributed generation attributes and timeseries CSV.
117
+ updated_feature_report = reopt_post_processor.run_feature_report(feature_report,reopt_assumptions_file,reopt_output_file,timeseries_output_file)
118
+
119
+ ```
120
+
121
+ More commonly, this gem can be used to run REopt a collection of features stored in a Scenario Report as show here:
122
+
123
+ ```ruby
124
+ require 'urbanopt/reopt'
125
+ #Create a Scenario Report
126
+ scenario_report = URBANopt::Scenario::DefaultReports::ScenarioReport.new({:directory_name => File.join(File.dirname(__FILE__), '../run/example_scenario'), :timeseries_csv => {:path => File.join(File.dirname(__FILE__), '../run/example_scenario/timeseries.csv') }})
127
+
128
+ #Load Feature Reports into the Scenario Report
129
+ (1..2).each do |i|
130
+ feature_reports_path = File.join(File.dirname(__FILE__), "../run/example_scenario/#{i}/010_default_feature_reports/default_feature_reports.json")
131
+
132
+ feature_reports_hash = nil
133
+ File.open(feature_reports_path, 'r') do |file|
134
+ feature_reports_hash = JSON.parse(file.read, symbolize_names: true)
135
+ end
136
+
137
+ feature_report = URBANopt::Scenario::DefaultReports::FeatureReport.new(feature_reports_hash)
138
+
139
+ feature_report_dir = File.join(File.dirname(__FILE__), "../run/example_scenario/#{i}")
140
+ feature_report.directory_name = feature_report_dir
141
+
142
+ scenario_report.add_feature_report(feature_report)
143
+ end
144
+
145
+ #Specify non-default REopt Lite assumptions, saved in JSON format, to be used in calling the API
146
+ reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
147
+
148
+ #Create a REopt Lite Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
149
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_NREL_KEY)
150
+
151
+ #Call REopt Lite with the post processor once on the sceanrio's aggregated load to update the scenario's distributed generation attributes and timeseries CSV.
152
+ updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
153
+
154
+ ```
155
+
156
+ ## Testing
157
+
158
+ First, check out the repository (i.e. git clone this repo).
159
+
160
+ Next, obtain a developer.nrel.gov API key from the [NREL Developer Network](https://developer.nrel.gov/]). Copy and paste your key in to the _developer_nrel_key_._rb_ file then save the file:
161
+
162
+ DEVELOPER_NREL_KEY = '<insert your key here>'
163
+
164
+ Finally, execute:
165
+
166
+ $ bundle install
167
+ $ bundle update
168
+ $ bundle exec rake
169
+
170
+
171
+ ## Releasing
172
+
173
+ * Update change log
174
+ * Update version in `/lib/urbanopt/reopt/version.rb`
175
+ * Merge down to master
176
+ * run `rake release` from master
File without changes
@@ -0,0 +1,44 @@
1
+ # *********************************************************************************
2
+ # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
+ # contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without modification,
6
+ # are permitted provided that the following conditions are met:
7
+ #
8
+ # Redistributions of source code must retain the above copyright notice, this list
9
+ # of conditions and the following disclaimer.
10
+ #
11
+ # Redistributions in binary form must reproduce the above copyright notice, this
12
+ # list of conditions and the following disclaimer in the documentation and/or other
13
+ # materials provided with the distribution.
14
+ #
15
+ # Neither the name of the copyright holder nor the names of its contributors may be
16
+ # used to endorse or promote products derived from this software without specific
17
+ # prior written permission.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22
+ # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ # *********************************************************************************
30
+
31
+ require 'openstudio/extension'
32
+
33
+ module URBANopt # :nodoc:
34
+ module REopt # :nodoc:
35
+ class Extension < OpenStudio::Extension::Extension # :nodoc:
36
+ # Override parent class
37
+ def initialize
38
+ super
39
+
40
+ @root_dir = File.absolute_path(File.join(File.dirname(__FILE__), '..', '..', '..'))
41
+ end
42
+ end
43
+ end
44
+ end