urbanopt-rnm-us 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/CHANGELOG.md +11 -0
- data/Gemfile +6 -5
- data/README.md +21 -0
- data/Rakefile +56 -0
- data/catalogs/extended_catalog.json +1928 -1796
- data/lib/urbanopt/rnm/api_client.rb +10 -2
- data/lib/urbanopt/rnm/consumers.rb +17 -4
- data/lib/urbanopt/rnm/input_files.rb +19 -1
- data/lib/urbanopt/rnm/prosumers.rb +19 -3
- data/lib/urbanopt/rnm/runner.rb +10 -0
- data/lib/urbanopt/rnm/transformer_opendss.rb +1 -5
- data/lib/urbanopt/rnm/validation/main_validation.py +153 -0
- data/lib/urbanopt/rnm/validation/opendss_interface.py +613 -0
- data/lib/urbanopt/rnm/validation/plot_lib.py +528 -0
- data/lib/urbanopt/rnm/validation/report.py +370 -0
- data/lib/urbanopt/rnm/validation.rb +77 -0
- data/lib/urbanopt/rnm/version.rb +1 -1
- data/lib/urbanopt/rnm.rb +1 -0
- data/opendss_catalog.json +2216 -0
- data/requirements.txt +9 -0
- data/urbanopt-rnm-us-gem.gemspec +1 -1
- metadata +11 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07dfa016051b9b8499a11ba5d8066a73c06131d628af10adb2dfc8c9848e7c30
|
4
|
+
data.tar.gz: a6e9f7af3ee4e92951d9225caa5eddfb8f97b20b0e1a5d95898a3f4a132405e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b25a77720880cc85ed29adabb35280a8e308692004183ef7da0a70ae0f4dd4e56c18d5299697490e8ed98e62e8007465ec31f80279c505595df23b144cbf16e5
|
7
|
+
data.tar.gz: e6a40b39b6f1f20f96df5379bf02c73205e00981e60bdf25dccaadb8780dd24522e18dcf423f3497fa7c03f6dd180cdc54531bd150666f2a33612b3a2b40c883
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## Version 0.5.0
|
4
|
+
Date Range 9/30/22 - 12/8/22
|
5
|
+
|
6
|
+
- Update dependencies for Extension Gem 0.6.0 and OpenStudio 3.5.0
|
7
|
+
|
8
|
+
## Version 0.4.0
|
9
|
+
Date Range 05/10/22 - 9/30/22
|
10
|
+
|
11
|
+
- Breaking changes to electrical catalog used and compatible RNM-US executable.
|
12
|
+
- Update API to version 2. API v1 still working for older URBANopt SDK releases but no longer working for future versions.
|
13
|
+
|
3
14
|
## Version 0.3.0
|
4
15
|
Date Range 11/23/21 - 05/10/22
|
5
16
|
|
data/Gemfile
CHANGED
@@ -9,8 +9,9 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
|
|
9
9
|
# Below is an example of how to configure the gemfile for developing with local gems
|
10
10
|
# modify as appropriate
|
11
11
|
|
12
|
-
if allow_local && File.exists?('../urbanopt-geojson-gem')
|
13
|
-
|
14
|
-
elsif allow_local
|
15
|
-
|
16
|
-
end
|
12
|
+
# if allow_local && File.exists?('../urbanopt-geojson-gem')
|
13
|
+
# gem 'urbanopt-geojson', path: '../urbanopt-geojson-gem'
|
14
|
+
# elsif allow_local
|
15
|
+
# gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
|
16
|
+
# end
|
17
|
+
|
data/README.md
CHANGED
@@ -42,6 +42,27 @@ An OpenDSS-formatted catalog can be generated from the extended catalog with the
|
|
42
42
|
bundle exec rake create_opendss_catalog[/desired/path/to/opendss_catalog.json]
|
43
43
|
```
|
44
44
|
|
45
|
+
## RNM-US API compatibility
|
46
|
+
|
47
|
+
| API Version | RNM-US Gem Version | RNM-US exe Version |
|
48
|
+
| ----------- | ----------- | ---------------- |
|
49
|
+
| v1 | 0.3.0 and earlier | RNM-US_20220819 |
|
50
|
+
| v2 | 0.4.0 | RNM-US_20221018 |
|
51
|
+
|
52
|
+
|
53
|
+
## Validation Functionality
|
54
|
+
|
55
|
+
The validation and results visualization functionality is written in python. Follow these steps if you would like to use it.
|
56
|
+
|
57
|
+
1. Install python (3.10) if you do not already have it installed
|
58
|
+
1. Clone the repo to your computer
|
59
|
+
1. cd into the repo directory
|
60
|
+
1. run `bundle install` to install the required ruby dependencies
|
61
|
+
1. run `pip install -r requirements.txt` to install the required python dependencies for the validation module
|
62
|
+
1. create input files and run the simulation as usual
|
63
|
+
1. run `bundle exec rake run_validation[/path/to/scenario/csv]` to run the validation
|
64
|
+
|
65
|
+
|
45
66
|
## Testing
|
46
67
|
|
47
68
|
```bash
|
data/Rakefile
CHANGED
@@ -148,6 +148,29 @@ task :run_simulation, [:scenario_csv_path, :reopt, :use_localhost] do |t, args|
|
|
148
148
|
puts '...done!'
|
149
149
|
end
|
150
150
|
|
151
|
+
# Full Runner workflow (mimics UO CLI functionality)
|
152
|
+
# pass in the path to the scenario csv, geojson path, whether this is a reopt analysis (true/false), and whether to use localhost RNM API (true/false)
|
153
|
+
desc 'Full Runner workflow'
|
154
|
+
task :full_runner_workflow, [:scenario_csv_path, :geojson_path, :reopt, :use_localhost] do |t, args|
|
155
|
+
# todo: could allow passing in extended catalog, average peak catalog, and opendss_catalog flags too
|
156
|
+
# if no path passed in, use default:
|
157
|
+
scenario_csv = args[:scenario_csv_path] || 'spec/test/example_project/run/baseline_scenario'
|
158
|
+
geojson_path = args[:geojson_path] || 'spec/test/example_project/example_project_with_network_and_streets'
|
159
|
+
root_dir, scenario_file_name = File.split(File.expand_path(scenario_csv))
|
160
|
+
scenario_name = File.basename(scenario_file_name, File.extname(scenario_file_name))
|
161
|
+
run_dir = File.join(root_dir, 'run', scenario_name.downcase)
|
162
|
+
reopt = args[:reopt] || false
|
163
|
+
reopt = reopt == 'true'
|
164
|
+
use_local = args[:use_localhost] || false
|
165
|
+
|
166
|
+
runner = URBANopt::RNM::Runner.new(scenario_name, run_dir, scenario_csv, geojson_path, reopt: reopt)
|
167
|
+
runner.create_simulation_files
|
168
|
+
runner.run(use_local)
|
169
|
+
runner.post_process
|
170
|
+
|
171
|
+
puts '...done!'
|
172
|
+
end
|
173
|
+
|
151
174
|
# Create opendss catalog from extended catalog
|
152
175
|
# pass in the path and filename where the OpenDSS catalog should be saved
|
153
176
|
desc 'Create OpenDSS catalog'
|
@@ -164,3 +187,36 @@ task :create_opendss_catalog, [:save_path] do |t, args|
|
|
164
187
|
puts "Catalog saved to #{save_path}"
|
165
188
|
puts '....done!'
|
166
189
|
end
|
190
|
+
|
191
|
+
|
192
|
+
# run validation
|
193
|
+
# pass in the path to the scenario csv
|
194
|
+
desc 'Run Validation'
|
195
|
+
task :run_validation, [:scenario_csv_path, :use_numeric_ids] do |t, args|
|
196
|
+
#Exammple to run validation
|
197
|
+
#bundle exec rake run_validation[D:/.../urbanopt-rnm-us-gem/spec/files/example_project/baseline_scenario.csv,true]
|
198
|
+
|
199
|
+
puts 'Running OpenDSS validation'
|
200
|
+
|
201
|
+
# if no path passed in, use default:
|
202
|
+
scenario_csv = args[:scenario_csv_path] || 'spec/test/example_project/run/baseline_scenario'
|
203
|
+
root_dir, scenario_file_name = File.split(File.expand_path(scenario_csv))
|
204
|
+
scenario_name = File.basename(scenario_file_name, File.extname(scenario_file_name))
|
205
|
+
run_dir = File.join(root_dir, 'run', scenario_name.downcase)
|
206
|
+
rnm_dir = File.join(run_dir, 'rnm-us')
|
207
|
+
|
208
|
+
#Use numeric ids (for the hierarchical plot of the network)
|
209
|
+
use_numeric_ids = args[:use_numeric_ids] || false
|
210
|
+
use_numeric_ids = use_numeric_ids == 'true'
|
211
|
+
|
212
|
+
if !File.exist?(rnm_dir)
|
213
|
+
puts rnm_dir
|
214
|
+
raise 'No rnm-us directory found for this scenario...run the create_inputs rake task first.'
|
215
|
+
end
|
216
|
+
|
217
|
+
puts "run dir path: #{run_dir}"
|
218
|
+
validation = URBANopt::RNM::Validation.new(rnm_dir,use_numeric_ids)
|
219
|
+
validation.run_validation()
|
220
|
+
|
221
|
+
puts '...done!'
|
222
|
+
end
|