urbanopt-reopt 0.1.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE/bug_report.md +24 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- data/.github/pull_request_template.md +13 -0
- data/.gitignore +6 -1
- data/.rdoc_options +1 -1
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +39 -0
- data/CONTRIBUTING.md +58 -0
- data/Gemfile +14 -19
- data/LICENSE.md +1 -1
- data/RDOC_MAIN.md +13 -13
- data/README.md +15 -15
- data/Rakefile +31 -1
- data/a.txt +1 -0
- data/doc_templates/LICENSE.md +1 -1
- data/doc_templates/copyright_erb.txt +1 -1
- data/doc_templates/copyright_js.txt +1 -1
- data/doc_templates/copyright_ruby.txt +1 -1
- data/docs/README.md +16 -16
- data/index.md +13 -13
- data/lib/urbanopt-reopt.rb +1 -1
- data/lib/urbanopt/reopt.rb +1 -1
- data/lib/urbanopt/reopt/extension.rb +1 -1
- data/lib/urbanopt/reopt/feature_report_adapter.rb +179 -99
- data/lib/urbanopt/reopt/reopt_lite_api.rb +132 -13
- data/lib/urbanopt/reopt/reopt_logger.rb +1 -1
- data/lib/urbanopt/reopt/reopt_post_processor.rb +80 -26
- data/lib/urbanopt/reopt/scenario/reopt_scenario_csv.rb +1 -1
- data/lib/urbanopt/reopt/scenario_report_adapter.rb +182 -105
- data/lib/urbanopt/reopt/version.rb +2 -2
- data/lib/urbanopt/reopt_scenario.rb +1 -1
- data/urbanopt-reopt.gemspec +10 -7
- metadata +35 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a4f6687c61a1902f3982215b12944c8551f892e7ea489412b9df174941ceb48d
|
4
|
+
data.tar.gz: 639bf269508f322975cc831d0541edb72e4537b891fee104edb34cf769481a78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a9fa7e3d39dfac3c87fff10dc9a6530f73893cdc5a25de4786b223b2079b97488758387a10cb30c31e01fe65ef1c5ddba8732fb73766929d41aea6542429034
|
7
|
+
data.tar.gz: 834ee49b279c9361c79e9f479addbcf17b02d9ac31b7e2281fec8fe200cf8494068d0510b3e1b812c3b9d1b3e53547082c38547e7a6fc40b826cfc0b22eac263
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
---
|
8
|
+
|
9
|
+
**Expected behavior**
|
10
|
+
_A clear and concise description of what you expected to happen._
|
11
|
+
|
12
|
+
**Actual behavior**
|
13
|
+
_A clear and concise description of what actually happens._
|
14
|
+
|
15
|
+
**To Reproduce**
|
16
|
+
Steps to reproduce the behavior:
|
17
|
+
|
18
|
+
1. Go to '...'
|
19
|
+
1. Enter '...'
|
20
|
+
1. Enter '...'
|
21
|
+
|
22
|
+
### Additional context
|
23
|
+
|
24
|
+
_E.g.: Windows, Mac, Linux? Are you behind a firewall? Do you have additional security constraints?_
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: enhancement
|
6
|
+
assignees: ''
|
7
|
+
---
|
8
|
+
|
9
|
+
**Is your feature request related to a problem?**
|
10
|
+
A clear and concise description of what the problem is: _I'm frustrated when [...]_
|
11
|
+
|
12
|
+
**Describe the solution you'd like**
|
13
|
+
A clear and concise description of what you want to happen
|
14
|
+
|
15
|
+
**Alternatives you've considered**
|
16
|
+
A clear and concise description of any alternative solutions or features you've considered
|
17
|
+
|
18
|
+
**Additional context**
|
19
|
+
Add any other context or screenshots about the feature request here
|
@@ -0,0 +1,13 @@
|
|
1
|
+
### Addresses #[issue number here]
|
2
|
+
|
3
|
+
### Pull Request Description
|
4
|
+
|
5
|
+
[description here]
|
6
|
+
|
7
|
+
### Checklist (Delete lines that don't apply)
|
8
|
+
|
9
|
+
- [ ] Unit tests have been added or updated
|
10
|
+
- [ ] Documentation has been modified appropriately
|
11
|
+
- [ ] All ci tests pass (green)
|
12
|
+
- [ ] An [ISSUE](https://github.com/urbanopt/urbanopt-cli/issues) has been created that this is addressing. Issues will get added to the Change Log when the change_log.rb script is run
|
13
|
+
- [ ] This branch is up-to-date with develop
|
data/.gitignore
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
*.DS_Store
|
2
|
+
/vendor/
|
1
3
|
/.bundle/
|
2
4
|
/.yardoc
|
3
5
|
/.ruby-version
|
@@ -13,6 +15,9 @@
|
|
13
15
|
/test/
|
14
16
|
/lib/measures/test_results
|
15
17
|
/lib/measures/.rubocop*
|
18
|
+
# test files
|
19
|
+
spec/run/
|
20
|
+
|
16
21
|
developer_nrel_key.rb
|
17
22
|
# rspec failure tracking
|
18
23
|
.rspec_status
|
@@ -24,4 +29,4 @@ developer_nrel_key.rb
|
|
24
29
|
# measures tests
|
25
30
|
lib/measures/.rubocop.yml
|
26
31
|
lib/measures/test_results/*
|
27
|
-
lib/measures/*/tests/output/*
|
32
|
+
lib/measures/*/tests/output/*
|
data/.rdoc_options
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,44 @@
|
|
1
1
|
# URBANopt REopt Gem
|
2
2
|
|
3
|
+
## Version 0.4.0
|
4
|
+
|
5
|
+
Date range: 6/5/20 - 9/22/20
|
6
|
+
|
7
|
+
* Changes to support the new reporting gem
|
8
|
+
* Parsing additional results from the REopt Lite API:
|
9
|
+
- lcc_bau_us_dollars
|
10
|
+
- year_one_energy_cost_bau_us_dollars
|
11
|
+
- year_one_demand_cost_bau_us_dollars
|
12
|
+
- year_one_bill_bau_us_dollars
|
13
|
+
- total_energy_cost_bau_us_dollars
|
14
|
+
- total_demand_cost_us_dollars
|
15
|
+
- total_demand_cost_bau_us_dollars
|
16
|
+
* Makes separate calls to the REopt Lite API for new resilience statistics:
|
17
|
+
- resilience_hours_min
|
18
|
+
- resilience_hours_max
|
19
|
+
- resilience_hours_avg
|
20
|
+
- probs_of_surviving
|
21
|
+
- probs_of_surviving_by_month
|
22
|
+
- probs_of_surviving_by_hour_of_the_day
|
23
|
+
|
24
|
+
|
25
|
+
## Version 0.3.0
|
26
|
+
|
27
|
+
* Updating to support OpenStudio 3.0 and Ruby 2.5
|
28
|
+
|
29
|
+
## Version 0.2.1
|
30
|
+
* Corrects code checking PV size that fails on multi PV
|
31
|
+
* Corrects parsing of site energy at timesteps other than 1 per hour
|
32
|
+
|
33
|
+
|
34
|
+
## Version 0.2.0
|
35
|
+
|
36
|
+
* Handles multiple PV systems in the REopt Lite assumptions
|
37
|
+
* Changes REoptPostProcessor run_scenario and run_scenario_features methods to save feature and scenario reports with custom names
|
38
|
+
* Parses date from timeseries CSV when creating load profile for REopt job and when parsing optimized results
|
39
|
+
* Renames REopt timeseries CSV columns to include 'REopt' and units
|
40
|
+
|
41
|
+
|
3
42
|
## Version 0.1.0
|
4
43
|
|
5
44
|
* Initial release of URBANopt REopt Gem.
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# URBANopt Contribution Policy
|
2
|
+
|
3
|
+
## Version 1.0
|
4
|
+
|
5
|
+
The URBANopt<sup>™</sup> team welcomes your contribution to the project. You can contribute to the URBANopt project in several ways: by using the software, reporting issues, contributing documentation, or contributing code back to the project. The GitHub [Contributing to Open Source](https://opensource.guide/how-to-contribute/) guide provides a good overview. If you contribute code, you agree that your contribution may be incorporated into the URBANopt Software Development Kit (SDK) and made available under the URBANopt SDK license.
|
6
|
+
|
7
|
+
The contribution process for URBANopt is composed of three steps:
|
8
|
+
|
9
|
+
## 1. Send consent email
|
10
|
+
|
11
|
+
In order for us to distribute your code as part of URBANopt under the URBANopt SDK [license](https://github.com/urbanopt/urbanopt-reopt-gem/blob/develop/LICENSE.md), we’ll need your consent. An email acknowledging your understanding of these terms and agreeing to them is all that will be asked of any contributor. Send an email to the URBANopt project manager ([see below](#documentation) for the address) including the following text and a list of co-contributors (if any):
|
12
|
+
|
13
|
+
*I agree to contribute to the URBANopt SDK. I agree to the following terms and conditions for my contributions: First, I agree that I am licensing the copyright to my contributions under the terms of the current URBANopt SDK license. Second, I hereby grant to Alliance for Sustainable Energy, LLC, to any successor manager and distributor of URBANopt SDK appointed by the U.S. Department of Energy, and to all recipients of a version of URBANopt SDK that includes my contributions, a non-exclusive, worldwide, royalty-free, irrevocable patent license under any patent claims owned by me, or owned by my employer and known to me, that are or will be,necessarily infringed upon by my contributions alone, or by combination of my contributions with the version of URBANopt SDK to which they are contributed, to make, have made, use, offer to sell, sell, import, and otherwise transfer any version of URBANopt SDK that includes my contributions, in source code and object code form. Third, I represent and warrant that I am authorized to make the contributions and grant the foregoing license(s). Additionally, if, to my knowledge, my employer has rights to intellectual property that covers my contributions, I represent and warrant that I have received permission to make these contributions and grant the foregoing license(s) on behalf of my employer.*
|
14
|
+
|
15
|
+
Once we have your consent on file, you’ll only need to redo it if conditions change (e.g. a change of employer).
|
16
|
+
|
17
|
+
## 2. Scope agreement and timeline commitment
|
18
|
+
|
19
|
+
If your contribution is small (e.g. a bug fix), simply submit your contribution via GitHub. If you find a bug, first make sure it is not an already known issue, then report it in the GitHub [issue tracker](https://github.com/urbanopt/urbanopt-reopt-gem/issues) for this repository. If your contribution is larger (e.g. a new feature or new functionality/capability), we’ll need to evaluate your proposed contribution first. We may ask you to revise your materials and make changes to it, which we will then re-review.
|
20
|
+
|
21
|
+
## 3. Technical contribution process
|
22
|
+
|
23
|
+
We want URBANopt to adhere to our established quality standards. Smaller, non-code contributions may not require as much review as code contributions, but all contributions will be reviewed. Code contributions will initially be in a source control branch, and then will be merged into the official URBANopt repository after review and approval. Any bugs, either discovered by you, us, or any users will be tracked in our issue tracker. We request that you take full responsibility for correcting bugs. Be aware that, unless notified otherwise, the correction of bugs takes precedence over the submission or creation of new code.
|
24
|
+
|
25
|
+
### Release Schedule
|
26
|
+
|
27
|
+
Contributions should be aligned with the URBANopt release schedule. The URBANopt SDK is currently released publicly two times each year (approximately on the last workday of March and October). There are cutoff dates for when new contributions are allowed for the upcoming release (approximately two weeks before release date). If your contribution is incomplete or comes in past the cutoff date for a release, we reserve the right to hold your code for a later release.
|
28
|
+
|
29
|
+
### Coding Standards
|
30
|
+
|
31
|
+
Make sure you read and follow the coding standards when writing URBANopt SDK code. Although these standards are not complete or very detailed, they should give you an idea of the style that we would like you to adopt. New additions to the URBANopt SDK must be written using object-oriented programming techniques and practices. Please also look at the URBANopt SDK code itself as an example of the preferred coding style.
|
32
|
+
|
33
|
+
### Code Reviews
|
34
|
+
|
35
|
+
You will be working and testing your code in a source control branch. When a piece of functionality is complete, tested and working, let us know and we will review your code. If the functionality that you contributed is complex, we may ask you for a written design document as well. We want your code to follow coding standards, be clear, readable, and maintainable, and of course it should do what it is supposed to do. We will look for errors, style issues, comments (or lack thereof), and any other issues in your code. We will inform you of our comments and we expect you to make the recommended changes. New re-reviews may be expected until the code complies with our required processes.
|
36
|
+
|
37
|
+
### Unit Tests
|
38
|
+
|
39
|
+
We ask that you supply unit tests along with the code that you have written. A unit test is a program that exercises your code in isolation to verify that it does what it is supposed to do. Your unit tests are very important to us. First, they give an indication that your code works according to its intended functionality. Second, we execute your unit tests automatically along with our unit tests to verify that the overall URBANopt SDK code continues to work.
|
40
|
+
|
41
|
+
### Code Coverage
|
42
|
+
|
43
|
+
We require that your unit tests provide an adequate coverage of the source code you are submitting. You will need to design your unit tests in such a way that all critical parts of the code (at least) are tested and verified.
|
44
|
+
|
45
|
+
### Documentation
|
46
|
+
|
47
|
+
Proper documentation is crucial for our users, without it users will not know how to use your contribution. We require that you create user documentation so that end users know how to use your new functionality.
|
48
|
+
|
49
|
+
For further questions or information:
|
50
|
+
|
51
|
+
- Ben Polly\
|
52
|
+
URBANopt Project Management\
|
53
|
+
ben.polly@nrel.gov\
|
54
|
+
(303) 384-7429
|
55
|
+
|
56
|
+
URBANopt is funded by the U.S. Department of Energy (DOE) and managed by the National Renewable Energy Laboratory (NREL).
|
57
|
+
|
58
|
+
URBANopt is developed in collaboration with NREL, LBNL, and private firms.
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in urbanopt-
|
3
|
+
# Specify your gem's dependencies in urbanopt-reopt-gem.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
# Local gems are useful when developing and integrating the various dependencies.
|
@@ -41,27 +41,22 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
|
|
41
41
|
# gem 'openstudio-model-articulation', '0.1.0'
|
42
42
|
# end
|
43
43
|
|
44
|
-
if allow_local && File.exist?('../urbanopt-scenario-gem')
|
45
|
-
gem 'urbanopt-scenario', path: '../urbanopt-scenario-gem'
|
46
|
-
elsif allow_local
|
47
|
-
gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'post_process'
|
48
|
-
else
|
49
|
-
gem 'urbanopt-scenario', '0.1.1'
|
50
|
-
end
|
51
44
|
|
52
|
-
if allow_local && File.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
else
|
58
|
-
gem 'urbanopt-geojson', '0.1.0'
|
59
|
-
end
|
45
|
+
# if allow_local && File.exist?('../urbanopt-scenario-gem')
|
46
|
+
# gem 'urbanopt-scenario', path: '../urbanopt-scenario-gem'
|
47
|
+
# elsif allow_local
|
48
|
+
# gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
|
49
|
+
# end
|
60
50
|
|
61
|
-
#
|
62
|
-
gem '
|
51
|
+
# if allow_local && File.exists?('../urbanopt-geojson-gem')
|
52
|
+
# gem 'urbanopt-geojson', path: '../urbanopt-geojson-gem'
|
53
|
+
# elsif allow_local
|
54
|
+
# gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
|
55
|
+
# end
|
63
56
|
|
64
57
|
# Support requests in windows
|
65
|
-
gem 'certified'
|
58
|
+
# gem 'certified'
|
66
59
|
|
67
60
|
gem 'rdoc', '4.3.0'
|
61
|
+
|
62
|
+
# gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
|
data/LICENSE.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
URBANopt<sup>™</sup>, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted
|
4
4
|
provided that the following conditions are met:
|
data/RDOC_MAIN.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# **URBANopt REopt Gem**
|
2
2
|
|
3
|
-
The **URBANopt REopt Gem** extends **URBANopt::
|
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.
|
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 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
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
|
|
@@ -9,7 +9,7 @@ See the [example project](https://github.com/urbanopt/urbanopt-example-reopt-pro
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
See [https://docs.urbanopt.net/installation/installation.html](https://docs.urbanopt.net/installation/installation.html) for instructions on prerequiste software, including:
|
12
|
+
See [https://docs.urbanopt.net/installation/installation.html](https://docs.urbanopt.net/installation/installation.html) for instructions on prerequiste software, including:
|
13
13
|
- Ruby 2.2.6
|
14
14
|
- Bundler 1.17.0
|
15
15
|
- OpenStudio 2.8.1
|
@@ -31,7 +31,7 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
## Functionality
|
33
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:
|
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
35
|
|
36
36
|
```
|
37
37
|
"distributed_generation": {
|
@@ -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 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.
|
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
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 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
89
|
|
@@ -99,7 +99,7 @@ require 'urbanopt/reopt'
|
|
99
99
|
feature_reports_hash = {} # <insert a Feature Report hash here>
|
100
100
|
|
101
101
|
#Create a Feature Report
|
102
|
-
feature_report = URBANopt::
|
102
|
+
feature_report = URBANopt::Reporting::DefaultReports::FeatureReport.new(feature_reports_hash)
|
103
103
|
|
104
104
|
#Specify a file name where REopt Lite results will be written in JSON format
|
105
105
|
reopt_output_file = File.join(feature_report.directory_name, 'feature_report_reopt_run1.json')
|
@@ -115,7 +115,7 @@ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DE
|
|
115
115
|
|
116
116
|
#Call REopt Lite 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)
|
118
|
-
|
118
|
+
|
119
119
|
```
|
120
120
|
|
121
121
|
More commonly, this gem can be used to run REopt a collection of features stored in a Scenario Report as show here:
|
@@ -123,9 +123,9 @@ More commonly, this gem can be used to run REopt a collection of features stored
|
|
123
123
|
```ruby
|
124
124
|
require 'urbanopt/reopt'
|
125
125
|
#Create a Scenario Report
|
126
|
-
scenario_report = URBANopt::
|
126
|
+
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') }})
|
127
127
|
|
128
|
-
#Load Feature Reports into the Scenario Report
|
128
|
+
#Load Feature Reports into the Scenario Report
|
129
129
|
(1..2).each do |i|
|
130
130
|
feature_reports_path = File.join(File.dirname(__FILE__), "../run/example_scenario/#{i}/010_default_feature_reports/default_feature_reports.json")
|
131
131
|
|
@@ -134,8 +134,8 @@ scenario_report = URBANopt::Scenario::DefaultReports::ScenarioReport.new({:direc
|
|
134
134
|
feature_reports_hash = JSON.parse(file.read, symbolize_names: true)
|
135
135
|
end
|
136
136
|
|
137
|
-
feature_report = URBANopt::
|
138
|
-
|
137
|
+
feature_report = URBANopt::Reporting::DefaultReports::FeatureReport.new(feature_reports_hash)
|
138
|
+
|
139
139
|
feature_report_dir = File.join(File.dirname(__FILE__), "../run/example_scenario/#{i}")
|
140
140
|
feature_report.directory_name = feature_report_dir
|
141
141
|
|
@@ -150,7 +150,7 @@ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report,
|
|
150
150
|
|
151
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
152
|
updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
|
153
|
-
|
153
|
+
|
154
154
|
```
|
155
155
|
|
156
156
|
## Testing
|
@@ -164,7 +164,7 @@ Next, obtain a developer.nrel.gov API key from the [NREL Developer Network](http
|
|
164
164
|
Finally, execute:
|
165
165
|
|
166
166
|
$ bundle install
|
167
|
-
$ bundle update
|
167
|
+
$ bundle update
|
168
168
|
$ bundle exec rake
|
169
169
|
|
170
170
|
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# URBANopt REopt Gem
|
2
2
|
|
3
|
-
The **URBANopt REopt Gem** extends **URBANopt::
|
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.
|
3
|
+
The **URBANopt<sup>™</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 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
5
|
|
6
6
|
See the [example project](https://github.com/urbanopt/urbanopt-example-geojson-reopt-project) for more infomation about usage of this gem.
|
7
7
|
|
8
|
-
<b>Note:</b> this module requires an API Key from the
|
8
|
+
<b>Note:</b> this module requires an API Key from the
|
9
9
|
[NREL Developer Network](https://developer.nrel.gov/)
|
10
10
|
|
11
11
|
[RDoc Documentation](https://urbanopt.github.io/urbanopt-reopt-gem/)
|
@@ -13,7 +13,7 @@ See the [example project](https://github.com/urbanopt/urbanopt-example-geojson-r
|
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
16
|
-
See [https://docs.urbanopt.net/installation/installation.html](https://docs.urbanopt.net/installation/installation.html) for instructions on prerequiste software, including:
|
16
|
+
See [https://docs.urbanopt.net/installation/installation.html](https://docs.urbanopt.net/installation/installation.html) for instructions on prerequiste software, including:
|
17
17
|
- Ruby 2.2.6
|
18
18
|
- Bundler 1.17.0
|
19
19
|
- OpenStudio 2.8.1
|
@@ -35,7 +35,7 @@ Or install it yourself as:
|
|
35
35
|
|
36
36
|
## Functionality
|
37
37
|
|
38
|
-
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:
|
38
|
+
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:
|
39
39
|
```
|
40
40
|
"distributed_generation": {
|
41
41
|
"lcc_us_dollars": 100000000.0,
|
@@ -83,9 +83,9 @@ Moreover, the following optimal dispatch fields are added to its timeseries CSV.
|
|
83
83
|
| ElectricityProduced:Wind:ToBattery | kWh |
|
84
84
|
| ElectricityProduced:Wind:ToLoad | kWh |
|
85
85
|
| ElectricityProduced:Wind:ToGrid | kWh |
|
86
|
-
|
87
86
|
|
88
|
-
|
87
|
+
|
88
|
+
The REopt Lite 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-v1/">https://developer.nrel.gov/docs/energy-optimization/reopt-v1/</StaticLink> for more detailed information on input parameters and default assumptions.
|
89
89
|
|
90
90
|
<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).
|
91
91
|
|
@@ -101,7 +101,7 @@ require 'urbanopt/reopt'
|
|
101
101
|
feature_reports_hash = {} # <insert a Feature Report hash here>
|
102
102
|
|
103
103
|
#Create a Feature Report
|
104
|
-
feature_report = URBANopt::
|
104
|
+
feature_report = URBANopt::Reporting::DefaultReports::FeatureReport.new(feature_reports_hash)
|
105
105
|
|
106
106
|
#Specify a file name where REopt Lite results will be written in JSON format
|
107
107
|
reopt_output_file = File.join(feature_report.directory_name, 'feature_report_reopt_run1.json')
|
@@ -117,16 +117,16 @@ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DE
|
|
117
117
|
|
118
118
|
#Call REopt Lite with the post processor to update the feature's distributed generation attributes and timeseries CSV.
|
119
119
|
updated_feature_report = reopt_post_processor.run_feature_report(feature_report,reopt_assumptions_file,reopt_output_file,timeseries_output_file)
|
120
|
-
|
120
|
+
|
121
121
|
```
|
122
122
|
|
123
123
|
More commonly, this gem can be used to run REopt a collection of features stored in a Scenario Report as show here:
|
124
124
|
```ruby
|
125
125
|
require 'urbanopt/reopt'
|
126
126
|
#Create a Scenario Report
|
127
|
-
scenario_report = URBANopt::
|
127
|
+
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') }})
|
128
128
|
|
129
|
-
#Load Feature Reports into the Scenario Report
|
129
|
+
#Load Feature Reports into the Scenario Report
|
130
130
|
(1..2).each do |i|
|
131
131
|
feature_reports_path = File.join(File.dirname(__FILE__), "../run/example_scenario/#{i}/010_default_feature_reports/default_feature_reports.json")
|
132
132
|
|
@@ -135,8 +135,8 @@ scenario_report = URBANopt::Scenario::DefaultReports::ScenarioReport.new({:direc
|
|
135
135
|
feature_reports_hash = JSON.parse(file.read, symbolize_names: true)
|
136
136
|
end
|
137
137
|
|
138
|
-
feature_report = URBANopt::
|
139
|
-
|
138
|
+
feature_report = URBANopt::Reporting::DefaultReports::FeatureReport.new(feature_reports_hash)
|
139
|
+
|
140
140
|
feature_report_dir = File.join(File.dirname(__FILE__), "../run/example_scenario/#{i}")
|
141
141
|
feature_report.directory_name = feature_report_dir
|
142
142
|
|
@@ -151,7 +151,7 @@ reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report,
|
|
151
151
|
|
152
152
|
#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.
|
153
153
|
updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
|
154
|
-
|
154
|
+
|
155
155
|
```
|
156
156
|
|
157
157
|
## Testing
|
@@ -165,7 +165,7 @@ Next, obtain a developer.nrel.gov API key from the [NREL Developer Network](http
|
|
165
165
|
Finally, execute:
|
166
166
|
|
167
167
|
$ bundle install
|
168
|
-
$ bundle update
|
168
|
+
$ bundle update
|
169
169
|
$ bundle exec rake
|
170
170
|
|
171
171
|
|