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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 843ba686ad41687f6890709b5d53d3b30ed8bac33cfe726a0e907f2c0fe1e26f
4
- data.tar.gz: 22cf46e48542910962f8c29da8c6721b885513bdd9f130083ae48b94028a264f
3
+ metadata.gz: 07dfa016051b9b8499a11ba5d8066a73c06131d628af10adb2dfc8c9848e7c30
4
+ data.tar.gz: a6e9f7af3ee4e92951d9225caa5eddfb8f97b20b0e1a5d95898a3f4a132405e3
5
5
  SHA512:
6
- metadata.gz: 995c88f12b677995d076315afffc5254a6a2ba321926738d754b7e8d540396353a24ac357dc34d6d8754dd763eecae75dfea3f9ce6163203e00961ce48f8ae7d
7
- data.tar.gz: c1913789eba31eb44bf3fa4f6abfb7a11715c0ccefd2b739d739c7c92c7636187945309de5f8fb3e7783ebc8c50fe1cd1b76ef3a040c898117f937e8c47c5065
6
+ metadata.gz: b25a77720880cc85ed29adabb35280a8e308692004183ef7da0a70ae0f4dd4e56c18d5299697490e8ed98e62e8007465ec31f80279c505595df23b144cbf16e5
7
+ data.tar.gz: e6a40b39b6f1f20f96df5379bf02c73205e00981e60bdf25dccaadb8780dd24522e18dcf423f3497fa7c03f6dd180cdc54531bd150666f2a33612b3a2b40c883
data/.gitignore CHANGED
@@ -29,4 +29,6 @@ runner.conf
29
29
  # ignore template files for now
30
30
  /template_inputs/*
31
31
  test_opendss_catalog.json
32
- *.sql
32
+ *.sql
33
+
34
+ *__pycache__
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
- gem 'urbanopt-geojson', path: '../urbanopt-geojson-gem'
14
- elsif allow_local
15
- gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
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