urbanopt-reopt 1.2.0 → 1.3.0

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: 6f914ce58eb625102b9e996099d74ad53c12a8db4cd4c169222b04c62983a210
4
- data.tar.gz: 1292d94d05fa38dafc702b11b4c50732ed4331e4d1d38f2e949d5c93b6e023c3
3
+ metadata.gz: 56b147451f96d95e26e2ea20dfb9b408b4677dae6ae8d9233008ce7a07f4cb2d
4
+ data.tar.gz: 93660c184fdd2dcdfc20386c7230a96b3627ea38b751f08c8774b440fe4794dd
5
5
  SHA512:
6
- metadata.gz: 4632f539ed5e68dde1dd5ae579f5606b0201a9083b7eaccaf77229f4320230074f0dccce601c1b13418da1900d3a599f4e0a7b79929f3352e86680bc81d1c50c
7
- data.tar.gz: 630e01b66eae49563eb947d360c76b889c46f694d464cdf7f31352d5f73f2702917db2fb3545af18e042bd8899ffc502578bd2418296c8ec15d730984bf71a31
6
+ metadata.gz: 502fabf84a4d43b93ba7b91ebe206f55eb7b117b310809592dc5190821bc7e36804feab7bee916b38ee9b7a66781cd23c0db95f8d373b03f68baff96ab9a8f52
7
+ data.tar.gz: 8049c39934e712e76db8d9dd6c4ac54b0c7788bc6f0129ec92cab1d929b15e253f6ff2df51893e995578107a91975e86f742a06a6d145aebd7ba1747c7487059
data/.gitignore CHANGED
@@ -19,6 +19,8 @@
19
19
  spec/files/run/baseline_scenario_ghe/reopt_ghp/
20
20
 
21
21
  developer_nrel_key.rb
22
+ developer_api_key.rb
23
+
22
24
  # rspec failure tracking
23
25
  .rspec_status
24
26
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # URBANopt REopt Gem
2
2
 
3
+ ## Version 1.3.0
4
+ * Updates for developer.nlr.gov URL change
5
+ * Timeseries shift bug fix
6
+ * Added Domestic Hot Water to baseline load
7
+
3
8
  ## Version 1.2.0
4
9
 
5
10
  * Updates for name change and license
data/CONTRIBUTING.md CHANGED
@@ -50,7 +50,7 @@ For further questions or information:
50
50
 
51
51
  - Ben Polly\
52
52
  URBANopt Project Management\
53
- ben.polly@nrel.gov\
53
+ ben.polly@nlr.gov\
54
54
  (303) 384-7429
55
55
 
56
56
  URBANopt is funded by the U.S. Department of Energy (DOE) and managed by the National Laboratory of the Rockies (NLR).
data/RDOC_MAIN.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # **URBANopt REopt Gem**
2
2
 
3
- The **URBANopt™ REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt](https://reopt.nrel.gov/tool) decision support platform.
4
- REopt 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/v2/](https://developer.nrel.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
3
+ The **URBANopt™ REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt](https://reopt.nlr.gov/tool) decision support platform.
4
+ REopt 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.nlr.gov/docs/energy-optimization/reopt/v2/](https://developer.nlr.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
5
5
 
6
6
  See the [example project](https://github.com/urbanopt/urbanopt-example-reopt-project.git) for more infomation about usage of this gem.
7
7
 
8
- <b>Note:</b> This module requires an API Key from the [NLR Developer Network](https://developer.nrel.gov/)
8
+ <b>Note:</b> This module requires an API Key from the [NLR Developer Network](https://developer.nlr.gov/)
9
9
 
10
10
  ## Installation
11
11
 
@@ -83,7 +83,7 @@ Moreover, the following optimal dispatch fields are added to its timeseries CSV.
83
83
  | ElectricityProduced:Wind:ToGrid | kWh |
84
84
  ```
85
85
 
86
- The REopt 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/v2/](https://developer.nrel.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
86
+ The REopt has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See [https://developer.nlr.gov/docs/energy-optimization/reopt/v2/](https://developer.nlr.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
87
87
 
88
88
  <b>Note:</b> Required attributes for a REopt run include latitude and longitude. If no utility rate is specified in your REopt 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
89
 
@@ -110,8 +110,8 @@ timeseries_output_file = File.join(feature_report.directory_name, 'feature_repor
110
110
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
111
111
  reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
112
112
 
113
- #Create a REopt 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)
113
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
114
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_API_KEY)
115
115
 
116
116
  #Call REopt with the post processor to update the feature's distributed generation attributes and timeseries CSV.
117
117
  updated_feature_report = reopt_post_processor.run_feature_report(feature_report,reopt_assumptions_file,reopt_output_file,timeseries_output_file)
@@ -145,8 +145,8 @@ end
145
145
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
146
146
  reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
147
147
 
148
- #Create a REopt 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)
148
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
149
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_API_KEY)
150
150
 
151
151
  #Call REopt with the post processor once on the sceanrio's aggregated load to update the scenario's distributed generation attributes and timeseries CSV.
152
152
  updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
@@ -157,9 +157,9 @@ updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_repo
157
157
 
158
158
  First, check out the repository (i.e. git clone this repo).
159
159
 
160
- Next, obtain a developer.nrel.gov API key from the [NLR Developer Network](https://developer.nrel.gov/]). Copy and paste your key in to the _developer_nrel_key_._rb_ file then save the file:
160
+ Next, obtain a developer.nlr.gov API key from the [NLR Developer Network](https://developer.nlr.gov/]). Copy and paste your key in to the _developer_api_key_._rb_ file then save the file:
161
161
 
162
- DEVELOPER_NREL_KEY = '<insert your key here>'
162
+ DEVELOPER_API_KEY = '<insert your key here>'
163
163
 
164
164
  Finally, execute:
165
165
 
data/README.md CHANGED
@@ -3,13 +3,13 @@
3
3
  [![Coverage Status](https://coveralls.io/repos/github/urbanopt/urbanopt-reopt-gem/badge.svg?branch=develop)](https://coveralls.io/github/urbanopt/urbanopt-reopt-gem?branch=develop)
4
4
  [![nightly_build](https://github.com/urbanopt/urbanopt-reopt-gem/actions/workflows/nightly_ci_build.yml/badge.svg)](https://github.com/urbanopt/urbanopt-reopt-gem/actions/workflows/nightly_ci_build.yml)
5
5
 
6
- The **URBANopt<sup>&trade;</sup> REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt](https://reopt.nrel.gov/tool) decision support platform.
7
- REopt 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/v2/](https://developer.nrel.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
6
+ The **URBANopt<sup>&trade;</sup> REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt](https://reopt.nlr.gov/tool) decision support platform.
7
+ REopt 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.nlr.gov/docs/energy-optimization/reopt/v2/](https://developer.nlr.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
8
8
 
9
9
  See the [example project](https://github.com/urbanopt/urbanopt-example-geojson-reopt-project) for more infomation about usage of this gem.
10
10
 
11
11
  <b>Note:</b> this module requires an API Key from the
12
- [NLR Developer Network](https://developer.nrel.gov/)
12
+ [NLR Developer Network](https://developer.nlr.gov/)
13
13
 
14
14
  [RDoc Documentation](https://urbanopt.github.io/urbanopt-reopt-gem/)
15
15
 
@@ -88,7 +88,7 @@ Moreover, the following optimal dispatch fields are added to its timeseries CSV.
88
88
  | ElectricityProduced:Wind:ToGrid | kWh |
89
89
 
90
90
 
91
- The REopt has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See <StaticLink target="\_blank" href="https://developer.nrel.gov/docs/energy-optimization/reopt/v2/">https://developer.nrel.gov/docs/energy-optimization/reopt/v2/</StaticLink> for more detailed information on input parameters and default assumptions.
91
+ The REopt has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See <StaticLink target="\_blank" href="https://developer.nlr.gov/docs/energy-optimization/reopt/v2/">https://developer.nlr.gov/docs/energy-optimization/reopt/v2/</StaticLink> for more detailed information on input parameters and default assumptions.
92
92
 
93
93
  <b>Note:</b> Required attributes for a REopt run include latitude and longitude. If no utility rate is specified in your REopt 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).
94
94
 
@@ -115,8 +115,8 @@ timeseries_output_file = File.join(feature_report.directory_name, 'feature_repor
115
115
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
116
116
  reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
117
117
 
118
- #Create a REopt Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
119
- reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_NREL_KEY)
118
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
119
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_API_KEY)
120
120
 
121
121
  #Call REopt with the post processor to update the feature's distributed generation attributes and timeseries CSV.
122
122
  updated_feature_report = reopt_post_processor.run_feature_report(feature_report,reopt_assumptions_file,reopt_output_file,timeseries_output_file)
@@ -149,8 +149,8 @@ end
149
149
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
150
150
  reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
151
151
 
152
- #Create a REopt Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
153
- reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_NREL_KEY)
152
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
153
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_API_KEY)
154
154
 
155
155
  #Call REopt with the post processor once on the sceanrio's aggregated load to update the scenario's distributed generation attributes and timeseries CSV.
156
156
  updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
@@ -161,9 +161,60 @@ updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_repo
161
161
 
162
162
  First, check out the repository (i.e. git clone this repo).
163
163
 
164
- Next, obtain a developer.nrel.gov API key from the [NLR Developer Network](https://developer.nrel.gov/]). Copy and paste your key in to the _developer_nrel_key_._rb_ file then save the file:
164
+ Next, obtain a developer.nlr.gov API key from the [NLR Developer Network](https://developer.nlr.gov/]). Copy and paste your key in to the _developer_api_key.rb_ file then save the file:
165
165
 
166
- DEVELOPER_NREL_KEY = '<insert your key here>'
166
+ DEVELOPER_API_KEY = '<insert your key here>'
167
+
168
+ ## Configuration
169
+
170
+ ### API Key Setup
171
+
172
+ The gem supports multiple ways to provide your developer API key:
173
+
174
+ 1. **Environment Variable (Recommended):**
175
+ ```bash
176
+ export GEM_DEVELOPER_KEY=your_api_key_here
177
+ # Then API instances automatically use this key
178
+ api = URBANopt::REopt::REoptAPI.new()
179
+ ```
180
+
181
+ 2. **Direct Parameter:**
182
+ ```ruby
183
+ api = URBANopt::REopt::REoptAPI.new('your_api_key_here')
184
+ ```
185
+
186
+ 3. **Edit developer_api_key.rb file:**
187
+ ```ruby
188
+ DEVELOPER_API_KEY = 'your_api_key_here'
189
+ ```
190
+
191
+ ### Environment Variables
192
+
193
+ You can customize the REopt API endpoints using environment variables:
194
+
195
+ - `REOPT_BASE_URL`: Override the default base URL for all REopt API endpoints.
196
+ - Default: `https://developer.nlr.gov/api/reopt/v3`
197
+ - Example: `export REOPT_BASE_URL=https://test.example.com/api/reopt/v3`
198
+
199
+ - `GEM_DEVELOPER_KEY`: Set the developer API key via environment variable instead of editing the source file.
200
+ - Example: `export GEM_DEVELOPER_KEY=your_api_key_here`
201
+ - This automatically becomes available as `DEVELOPER_API_KEY` constant in the code
202
+
203
+ ### Localhost Development
204
+
205
+ For development against a local REopt instance, use the `REOPT_BASE_URL` environment variable:
206
+
207
+ ```bash
208
+ # Use localhost (no API key needed)
209
+ export REOPT_BASE_URL=http://127.0.0.1:8000/v3
210
+
211
+ # Then create API instances normally
212
+ api = URBANopt::REopt::REoptAPI.new()
213
+ ```
214
+
215
+ Note: When using custom URLs via `REOPT_BASE_URL`, API keys are automatically bypassed for non-official endpoints.
216
+
217
+ ## Running Tests
167
218
 
168
219
  Finally, execute:
169
220
 
@@ -3,4 +3,4 @@
3
3
  # See also https://github.com/urbanopt/urbanopt-reopt-gem/blob/develop/LICENSE.md
4
4
  # *********************************************************************************
5
5
 
6
- DEVELOPER_NREL_KEY = (ENV['GEM_DEVELOPER_KEY'] || '< your key here https://developer.nrel.gov/signup >')
6
+ DEVELOPER_API_KEY = (ENV['GEM_DEVELOPER_KEY'] || '< your key here https://developer.nlr.gov/signup >')
data/docs/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  ### <StaticLink target="\_blank" href="rdoc/">Rdocs</StaticLink>
4
4
 
5
- The **URBANopt<sup>&trade;</sup> REopt Gem** extends a **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the <StaticLink target="\_blank" href="https://reopt.nrel.gov/tool">REopt</StaticLink> decision support platform.
6
- REopt 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 <StaticLink target="\_blank" href="https://developer.nrel.gov/docs/energy-optimization/reopt/v2/">https://developer.nrel.gov/docs/energy-optimization/reopt/v2/</StaticLink> for more detailed information on input parameters and default assumptions.
5
+ The **URBANopt<sup>&trade;</sup> REopt Gem** extends a **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the <StaticLink target="\_blank" href="https://reopt.nlr.gov/tool">REopt</StaticLink> decision support platform.
6
+ REopt 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 <StaticLink target="\_blank" href="https://developer.nlr.gov/docs/energy-optimization/reopt/v2/">https://developer.nlr.gov/docs/energy-optimization/reopt/v2/</StaticLink> for more detailed information on input parameters and default assumptions.
7
7
 
8
8
  The REopt Gem accomplishes three basic functions (described more below in the _Functionality_ section):
9
9
 
@@ -20,7 +20,7 @@ Moreover, the REopt Gem can be run in several modes, either on:
20
20
 
21
21
  See the <StaticLink target="\_blank" href="https://github.com/urbanopt/urbanopt-example-reopt-project.git">example project</StaticLink> for more infomation about usage of this gem.
22
22
 
23
- <b>Note:</b> This module requires an API Key from the <StaticLink target='blank' href="https://developer.nrel.gov/">NLR Developer Network</StaticLink>.
23
+ <b>Note:</b> This module requires an API Key from the <StaticLink target='blank' href="https://developer.nlr.gov/">NLR Developer Network</StaticLink>.
24
24
 
25
25
  <StaticLink target="\_blank" href="https://urbanopt.github.io/urbanopt-reopt-gem/">RDoc Documentation</StaticLink>
26
26
 
@@ -99,7 +99,7 @@ Moreover, the following optimal dispatch fields are added to its timeseries CSV.
99
99
  | ElectricityProduced:Wind:ToGrid | kWh |
100
100
 
101
101
 
102
- The REopt has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See <StaticLink target="\_blank" href="https://developer.nrel.gov/docs/energy-optimization/reopt/v2/">https://developer.nrel.gov/docs/energy-optimization/reopt/v2/</StaticLink> for more detailed information on input parameters and default assumptions.
102
+ The REopt has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See <StaticLink target="\_blank" href="https://developer.nlr.gov/docs/energy-optimization/reopt/v2/">https://developer.nlr.gov/docs/energy-optimization/reopt/v2/</StaticLink> for more detailed information on input parameters and default assumptions.
103
103
 
104
104
  <b>Note:</b> Required attributes for a REopt run include latitude and longitude, parsed from the Feature or Scenario Report attributes. If no utility rate is specified in your assumptions, then a constant 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).
105
105
 
@@ -112,7 +112,7 @@ The code below shows how to run the REopt API on a single Feature Report hash us
112
112
  ```ruby
113
113
  require 'urbanopt/reopt'
114
114
 
115
- DEVELOPER_NREL_KEY = "" # <insert a valid API key from https://developer.nrel.gov/signup >
115
+ DEVELOPER_API_KEY = "" # <insert a valid API key from https://developer.nlr.gov/signup >
116
116
 
117
117
  #Load a Feature Report Hash
118
118
  feature_reports_hash = {} # <insert a valid Feature Report hash here with latitude and longitude filled in>
@@ -129,8 +129,8 @@ timeseries_output_file = File.join(feature_report.directory_name, 'feature_repor
129
129
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
130
130
  reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
131
131
 
132
- #Create a REopt Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
133
- reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_NREL_KEY)
132
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
133
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_API_KEY)
134
134
 
135
135
  #Call REopt with the post processor to update the feature's distributed generation attributes and timeseries CSV.
136
136
  updated_feature_report = reopt_post_processor.run_feature_report(feature_report,reopt_assumptions_file,reopt_output_file,timeseries_output_file)
@@ -140,7 +140,7 @@ updated_feature_report = reopt_post_processor.run_feature_report(feature_report,
140
140
  More commonly, this gem can be used to run REopt a collection of features stored in a Scenario Report as show here:
141
141
  ```ruby
142
142
  require 'urbanopt/reopt'
143
- DEVELOPER_NREL_KEY = "" # <insert a valid API key from https://developer.nrel.gov/signup >
143
+ DEVELOPER_API_KEY = "" # <insert a valid API key from https://developer.nlr.gov/signup >
144
144
 
145
145
  #Create a Scenario Report
146
146
  scenario_report = URBANopt::Reporting::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') }})
@@ -165,8 +165,8 @@ end
165
165
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
166
166
  reopt_assumptions_file = File.join(File.dirname(__FILE__), 'files/reopt_assumptions_basic.json')
167
167
 
168
- #Create a REopt Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
169
- reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_NREL_KEY)
168
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
169
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_API_KEY)
170
170
 
171
171
  #Call REopt with the post processor once on the sceanrio's aggregated load to update the scenario's distributed generation attributes and timeseries CSV.
172
172
  updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
@@ -177,9 +177,9 @@ updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_repo
177
177
 
178
178
  First, check out the repository (i.e. git clone this repo).
179
179
 
180
- Next, obtain a developer.nrel.gov API key from the [NLR Developer Network](https://developer.nrel.gov/]). Copy and paste your key in to the _developer_nrel_key_._rb_ file then save the file:
180
+ Next, obtain a developer.nlr.gov API key from the [NLR Developer Network](https://developer.nlr.gov/]). Copy and paste your key in to the _developer_api_key_._rb_ file then save the file:
181
181
 
182
- DEVELOPER_NREL_KEY = '<insert your key here>'
182
+ DEVELOPER_API_KEY = '<insert your key here>'
183
183
 
184
184
  Finally, execute:
185
185
 
@@ -1,6 +1,6 @@
1
- # REopt Lite Inputs Schema
1
+ # REopt Inputs Schema
2
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.
3
+ The following shows the complete set of inputs to the REopt API 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
4
 
5
5
  ## Data Dictionary
6
6
 
@@ -8,7 +8,7 @@ The following shows the complete set of inputs to the REopt Lite AP which is cal
8
8
 
9
9
  ## Required Inputs
10
10
 
11
- The only required parameters to the REopt Lite API (called internally by the gem) are:
11
+ The only required parameters to the REopt API (called internally by the gem) are:
12
12
  - *latitude*
13
13
  - *longitude*
14
14
  - *urdb_response* OR one of the following sets:
@@ -24,7 +24,7 @@ The only required parameters to the REopt Lite API (called internally by the gem
24
24
 
25
25
  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.
26
26
 
27
- 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:
27
+ Otherwise, all non-required input parameters will be filled in with default values unless otherwise specified. For an example of a minimally viable REopt input, see:
28
28
 
29
29
 
30
30
  ```
@@ -1,6 +1,6 @@
1
- # REopt Lite Outputs Schema
1
+ # REopt Outputs Schema
2
2
 
3
- When the gem calls the REopt Lite APUI it receives 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 attribute set and timeseries CSV are pulled from the response 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.
3
+ When the gem calls the REopt API it receives 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 attribute set and timeseries CSV are pulled from the response and transferred to the Feature or Scenario Report. You may choose to modify the code to include more or less of the full REopt response.
4
4
 
5
5
  ## Data Dictionary
6
6
  <ReoptOutputSchema />
@@ -8,7 +8,7 @@ When the gem calls the REopt Lite APUI it receives the following complete set of
8
8
  ## Updated from the Data Dictionary
9
9
 
10
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.
11
+ The REopt API updates the distributed_generation attributes of a Scenario or Feature Report as shown in an example below.
12
12
 
13
13
  ```
14
14
  "distributed_generation": {
@@ -35,7 +35,7 @@ The REopt Lite API updates the distributed_generation attributes of a Scenario o
35
35
  ```
36
36
 
37
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.
38
+ REopt API responses also map dispatches to the following columns in an updated timeseries CSV for a Feature or Scenario Report.
39
39
 
40
40
  | output | unit |
41
41
  | -----------------------------------------| ------- |
@@ -62,5 +62,5 @@ REopt Lite API responses also map dispatches to the following columns in an upda
62
62
  <style type="text/css">
63
63
  .content { max-width: 1200px !important; }
64
64
  span.default { color: yellow !important; }
65
- .description { color: #E0E0E0 !important; }
65
+ .description { color: #E0E0E0 !important; }
66
66
  </style>
data/index.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # **URBANopt REopt Gem**
2
2
 
3
- The **URBANopt<sup>&trade;</sup> REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt](https://reopt.nrel.gov/tool) decision support platform.
4
- REopt 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/v2/](https://developer.nrel.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
3
+ The **URBANopt<sup>&trade;</sup> REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt](https://reopt.nlr.gov/tool) decision support platform.
4
+ REopt 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.nlr.gov/docs/energy-optimization/reopt/v2/](https://developer.nlr.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
5
5
 
6
6
  See the [example project](https://github.com/urbanopt/urbanopt-example-reopt-project.git) for more infomation about usage of this gem.
7
7
 
8
- <b>Note:</b> This module requires an API Key from the [NLR Developer Network](https://developer.nrel.gov/)
8
+ <b>Note:</b> This module requires an API Key from the [NLR Developer Network](https://developer.nlr.gov/)
9
9
 
10
10
  ## Installation
11
11
 
@@ -83,7 +83,7 @@ Moreover, the following optimal dispatch fields are added to its timeseries CSV.
83
83
  | ElectricityProduced:Wind:ToGrid | kWh |
84
84
  ```
85
85
 
86
- The REopt 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/v2/](https://developer.nrel.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
86
+ The REopt has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See [https://developer..gov/docs/energy-optimization/reopt/v3/](https://developer.nlr.gov/docs/energy-optimization/reopt/v3/) for more detailed information on input parameters and default assumptions.
87
87
 
88
88
  <b>Note:</b> Required attributes for a REopt run include latitude and longitude. If no utility rate is specified in your REopt 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
89
 
@@ -110,8 +110,8 @@ timeseries_output_file = File.join(feature_report.directory_name, 'feature_repor
110
110
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
111
111
  reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
112
112
 
113
- #Create a REopt 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)
113
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
114
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_API_KEY)
115
115
 
116
116
  #Call REopt with the post processor to update the feature's distributed generation attributes and timeseries CSV.
117
117
  updated_feature_report = reopt_post_processor.run_feature_report(feature_report,reopt_assumptions_file,reopt_output_file,timeseries_output_file)
@@ -145,8 +145,8 @@ end
145
145
  #Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
146
146
  reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
147
147
 
148
- #Create a REopt 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)
148
+ #Create a REopt Post Processor to call the API, note you will need a Developer.nlr.gov API key in this step
149
+ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_API_KEY)
150
150
 
151
151
  #Call REopt with the post processor once on the sceanrio's aggregated load to update the scenario's distributed generation attributes and timeseries CSV.
152
152
  updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
@@ -157,9 +157,9 @@ updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_repo
157
157
 
158
158
  First, check out the repository (i.e. git clone this repo).
159
159
 
160
- Next, obtain a developer.nrel.gov API key from the [NLR Developer Network](https://developer.nrel.gov/]). Copy and paste your key in to the _developer_nrel_key_._rb_ file then save the file:
160
+ Next, obtain a developer.nlr.gov API key from the [NLR Developer Network](https://developer.nlr.gov/]). Copy and paste your key in to the _developer_api_key_._rb_ file then save the file:
161
161
 
162
- DEVELOPER_NREL_KEY = '<insert your key here>'
162
+ DEVELOPER_API_KEY = '<insert your key here>'
163
163
 
164
164
  Finally, execute:
165
165
 
@@ -453,12 +453,23 @@ module URBANopt # :nodoc:
453
453
 
454
454
  old_data = CSV.open(feature_report.timeseries_csv.path).read
455
455
  start_date = Time.parse(old_data[1][0])
456
- start_ts = (
457
- (
458
- ((start_date.yday - 1) * 60.0 * 60.0 * 24) +
459
- ((start_date.hour - 1) * 60.0 * 60.0) +
460
- (start_date.min * 60.0) + start_date.sec) / ((60 / feature_report.timesteps_per_hour) * 60)
461
- ).to_int
456
+ ## the commented part was causing aggregation error when running anything other than hourly (issue: 164) : hardcodes backing up by one hour which is wrong
457
+ #start_ts = (
458
+ # (
459
+ # ((start_date.yday - 1) * 60.0 * 60.0 * 24) +
460
+ # ((start_date.hour - 1) * 60.0 * 60.0) +
461
+ # (start_date.min * 60.0) + start_date.sec) / ((60 / feature_report.timesteps_per_hour) * 60)
462
+ # ).to_int
463
+
464
+ # bug fix : issue #164
465
+ start_ts = reopt_timeseries_start_index(start_date, feature_report.timesteps_per_hour)
466
+ # start_ts = (
467
+ # (
468
+ # ((start_date.yday - 1) * 60.0 * 60.0 * 24) +
469
+ # (start_date.hour * 60.0 * 60.0) +
470
+ # (start_date.min * 60.0) + start_date.sec) / ((60 / feature_report.timesteps_per_hour) * 60)
471
+ # ).to_int - 1
472
+
462
473
 
463
474
  mod_data = old_data.map.with_index do |x, i|
464
475
  if i > 0