urbanopt-scenario 0.2.0.pre1 → 0.4.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.
Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/.github/pull_request_template.md +2 -2
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +1 -1
  5. data/CHANGELOG.md +77 -1
  6. data/CONTRIBUTING.md +1 -1
  7. data/Gemfile +28 -18
  8. data/Jenkinsfile +1 -1
  9. data/LICENSE.md +1 -1
  10. data/RDOC_MAIN.md +1 -1
  11. data/README.md +1 -1
  12. data/Rakefile +2 -2
  13. data/docs/README.md +1 -1
  14. data/docs/package-lock.json +2499 -2322
  15. data/docs/package.json +13 -9
  16. data/lib/urbanopt-scenario.rb +1 -1
  17. data/lib/urbanopt/scenario.rb +3 -1
  18. data/lib/urbanopt/scenario/default_reports.rb +3 -8
  19. data/lib/urbanopt/scenario/extension.rb +1 -1
  20. data/lib/urbanopt/scenario/logger.rb +1 -1
  21. data/lib/urbanopt/scenario/scenario_base.rb +1 -1
  22. data/lib/urbanopt/scenario/scenario_csv.rb +22 -9
  23. data/lib/urbanopt/scenario/scenario_datapoint_base.rb +8 -1
  24. data/lib/urbanopt/scenario/scenario_post_processor_base.rb +1 -1
  25. data/lib/urbanopt/scenario/scenario_post_processor_default.rb +81 -8
  26. data/lib/urbanopt/scenario/scenario_post_processor_opendss.rb +275 -0
  27. data/lib/urbanopt/scenario/scenario_runner_base.rb +2 -2
  28. data/lib/urbanopt/scenario/scenario_runner_osw.rb +23 -9
  29. data/lib/urbanopt/scenario/scenario_visualization.rb +236 -0
  30. data/lib/urbanopt/scenario/simulation_dir_base.rb +1 -1
  31. data/lib/urbanopt/scenario/simulation_dir_osw.rb +2 -9
  32. data/lib/urbanopt/scenario/simulation_mapper_base.rb +1 -1
  33. data/lib/urbanopt/scenario/version.rb +2 -2
  34. data/package-lock.json +3 -0
  35. data/urbanopt-scenario-gem.gemspec +15 -15
  36. metadata +78 -82
  37. data/doc_templates/LICENSE.md +0 -27
  38. data/doc_templates/README.md.erb +0 -42
  39. data/doc_templates/copyright_erb.txt +0 -31
  40. data/doc_templates/copyright_js.txt +0 -4
  41. data/doc_templates/copyright_ruby.txt +0 -29
  42. data/lib/change_log.rb +0 -147
  43. data/lib/measures/.rubocop.yml +0 -5
  44. data/lib/measures/default_feature_reports/LICENSE.md +0 -27
  45. data/lib/measures/default_feature_reports/README.md +0 -56
  46. data/lib/measures/default_feature_reports/README.md.erb +0 -42
  47. data/lib/measures/default_feature_reports/measure.rb +0 -957
  48. data/lib/measures/default_feature_reports/measure.xml +0 -143
  49. data/lib/measures/default_feature_reports/tests/USA_CO_Golden-NREL.724666_TMY3.epw +0 -8768
  50. data/lib/measures/default_feature_reports/tests/default_feature_reports_test.rb +0 -238
  51. data/lib/measures/default_feature_reports/tests/example_model.osm +0 -4378
  52. data/lib/urbanopt/scenario/default_reports/construction_cost.rb +0 -169
  53. data/lib/urbanopt/scenario/default_reports/date.rb +0 -97
  54. data/lib/urbanopt/scenario/default_reports/distributed_generation.rb +0 -374
  55. data/lib/urbanopt/scenario/default_reports/end_use.rb +0 -159
  56. data/lib/urbanopt/scenario/default_reports/end_uses.rb +0 -140
  57. data/lib/urbanopt/scenario/default_reports/feature_report.rb +0 -260
  58. data/lib/urbanopt/scenario/default_reports/generator.rb +0 -92
  59. data/lib/urbanopt/scenario/default_reports/location.rb +0 -99
  60. data/lib/urbanopt/scenario/default_reports/logger.rb +0 -44
  61. data/lib/urbanopt/scenario/default_reports/program.rb +0 -266
  62. data/lib/urbanopt/scenario/default_reports/reporting_period.rb +0 -301
  63. data/lib/urbanopt/scenario/default_reports/scenario_report.rb +0 -311
  64. data/lib/urbanopt/scenario/default_reports/schema/README.md +0 -33
  65. data/lib/urbanopt/scenario/default_reports/schema/scenario_csv_columns.txt +0 -21
  66. data/lib/urbanopt/scenario/default_reports/schema/scenario_schema.json +0 -839
  67. data/lib/urbanopt/scenario/default_reports/solar_pv.rb +0 -93
  68. data/lib/urbanopt/scenario/default_reports/storage.rb +0 -105
  69. data/lib/urbanopt/scenario/default_reports/timeseries_csv.rb +0 -284
  70. data/lib/urbanopt/scenario/default_reports/validator.rb +0 -97
  71. data/lib/urbanopt/scenario/default_reports/wind.rb +0 -92
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -55,7 +55,7 @@ module URBANopt
55
55
  # +force_clear+ - _Bool_ - Clear Scenario before creating Simulation input files.
56
56
  #
57
57
  # [return:] _Array_ Returns an array of all SimulationDirs, even those created previously, for Scenario.
58
- def run(scenario, force_clear = false)
58
+ def run(scenario, force_clear = false, options = {})
59
59
  raise 'run is not implemented for ScenarioRunnerBase, override in your class'
60
60
  end
61
61
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -55,6 +55,7 @@ module URBANopt
55
55
  end
56
56
 
57
57
  FileUtils.mkdir_p(scenario.run_dir) if !File.exist?(scenario.run_dir)
58
+ FileUtils.rm_rf(File.join(scenario.run_dir, 'run_status.json')) if File.exist?(File.join(scenario.run_dir, 'run_status.json'))
58
59
 
59
60
  simulation_dirs = scenario.simulation_dirs
60
61
 
@@ -81,10 +82,11 @@ module URBANopt
81
82
  # +scenario+ - _ScenarioBase_ - Scenario to create and run SimulationFiles for.
82
83
  # +force_clear+ - _Bool_ - Clear Scenario before creating SimulationFiles.
83
84
  # [return:] _Array_ Returns array of all SimulationFiles, even those created previously, for Scenario.
84
- def run(scenario, force_clear = false)
85
+ def run(scenario, force_clear = false, options = {})
85
86
  # instantiate openstudio runner - use the defaults for now. If need to change then create
86
87
  # the runner.conf file (i.e. run `rake openstudio:runner:init`)
87
- runner = OpenStudio::Extension::Runner.new(scenario.root_dir)
88
+ # allow passing gemfile_path and bundle_install_path in options
89
+ runner = OpenStudio::Extension::Runner.new(scenario.root_dir, [], options)
88
90
 
89
91
  # create simulation files
90
92
  simulation_dirs = create_simulation_files(scenario, force_clear)
@@ -156,18 +158,30 @@ module URBANopt
156
158
  # puts "DATAPOINT FAILURES: #{failures}"
157
159
  # end
158
160
 
159
- # look for other failed datapoints
161
+ # write results to file and to command line
162
+ get_results(scenario, simulation_dirs)
163
+
164
+ return simulation_dirs
165
+ end
166
+
167
+ def get_results(scenario, simulation_dirs)
168
+ # look for other failed datapoints (command line display)
169
+ # also compile datapoint status for latest_run.json file
170
+ status_arr = []
160
171
  failed_sims = []
161
- simulation_dirs.each do |simulation_dir|
162
- if File.exist?(File.join(simulation_dir.run_dir, 'failed.job'))
163
- failed_sims << simulation_dir.run_dir.split('/')[-1]
172
+ simulation_dirs.each do |sim_dir|
173
+ if File.exist?(sim_dir.failed_job_path)
174
+ failed_sims << sim_dir.run_dir.split('/')[-1]
164
175
  end
176
+ status_arr << { "id": sim_dir.feature_id, "status": sim_dir.simulation_status, "mapper_class": sim_dir.mapper_class }
165
177
  end
178
+
179
+ # write to file
180
+ File.open(File.join(scenario.run_dir, 'run_status.json'), 'w') { |f| f.write JSON.pretty_generate("timestamp": Time.now.strftime('%Y-%m-%dT%k:%M:%S.%L'), "results": status_arr) }
181
+
166
182
  if !failed_sims.empty?
167
183
  puts "FAILED SIMULATION IDs: #{failed_sims.join(',')}"
168
184
  end
169
-
170
- return simulation_dirs
171
185
  end
172
186
  end
173
187
  end
@@ -0,0 +1,236 @@
1
+ # *********************************************************************************
2
+ # URBANopt (tm), 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 'csv'
32
+ require 'date'
33
+ require 'json'
34
+ require 'fileutils'
35
+
36
+ module URBANopt
37
+ module Scenario
38
+ class ResultVisualization
39
+ def self.create_visualization(run_dir, feature = true)
40
+ @all_results = []
41
+ run_dir.each do |folder|
42
+ name = folder.split('/')[-1]
43
+
44
+ # create visualization for scenarios
45
+ if feature == false
46
+ csv_dir = File.join(folder, 'default_scenario_report.csv')
47
+ # create visualization for features
48
+ elsif feature == true
49
+ csv_dir = File.join(folder, 'feature_reports/default_feature_report.csv')
50
+ end
51
+
52
+ if File.exist?(csv_dir)
53
+ size = CSV.open(csv_dir).readlines.size
54
+
55
+ monthly_values = {}
56
+ monthly_totals = {}
57
+ annual_values = {}
58
+
59
+ headers_unitless = []
60
+ i = 0
61
+ CSV.foreach(csv_dir).map do |row|
62
+ if i == 0
63
+ # store header values from csv
64
+ headers = row
65
+ headers.each do |header|
66
+ header_unitless = header.to_s.split('(')[0]
67
+ headers_unitless << header_unitless
68
+ monthly_values[header_unitless] = []
69
+ end
70
+ # store values from csv for each row
71
+ elsif i <= size
72
+ headers_unitless.each_index do |j|
73
+ monthly_values[headers_unitless[j]] << row[j]
74
+ end
75
+ end
76
+ i += 1
77
+ end
78
+
79
+ if monthly_values['Datetime'][0].split(/\W+/)[0].to_f > 31
80
+ format = '%Y/%m/%d %H:%M'
81
+ year = monthly_values['Datetime'][0].split(/\W+/)[0]
82
+ else
83
+ format = '%m/%d/%Y %H:%M'
84
+ year = monthly_values['Datetime'][0].split(/\W+/)[2]
85
+ end
86
+
87
+ # create dates for each month
88
+ jan_date = DateTime.new(year.to_i, 1, 1, 1, 0)
89
+ feb_date = DateTime.new(year.to_i, 2, 1, 0, 0)
90
+ mar_date = DateTime.new(year.to_i, 3, 1, 0, 0)
91
+ apr_date = DateTime.new(year.to_i, 4, 1, 0, 0)
92
+ may_date = DateTime.new(year.to_i, 5, 1, 0, 0)
93
+ jun_date = DateTime.new(year.to_i, 6, 1, 0, 0)
94
+ jul_date = DateTime.new(year.to_i, 7, 1, 0, 0)
95
+ aug_date = DateTime.new(year.to_i, 8, 1, 0, 0)
96
+ sep_date = DateTime.new(year.to_i, 9, 1, 0, 0)
97
+ oct_date = DateTime.new(year.to_i, 10, 1, 0, 0)
98
+ nov_date = DateTime.new(year.to_i, 11, 1, 0, 0)
99
+ dec_date = DateTime.new(year.to_i, 12, 1, 0, 0)
100
+ jan_next_year = DateTime.new(year.to_i + 1, 1, 1, 0, 0)
101
+
102
+ monthly_values['Datetime'].each do |i|
103
+ date_obj = DateTime.strptime(i.to_s, format)
104
+ index = monthly_values['Datetime'].index(i)
105
+
106
+ # store index of each date from the csv
107
+ if feb_date == date_obj
108
+ @feb_index = index
109
+ elsif mar_date == date_obj
110
+ @mar_index = index
111
+ elsif apr_date == date_obj
112
+ @apr_index = index
113
+ elsif may_date == date_obj
114
+ @may_index = index
115
+ elsif jun_date == date_obj
116
+ @jun_index = index
117
+ elsif jul_date == date_obj
118
+ @jul_index = index
119
+ elsif aug_date == date_obj
120
+ @aug_index = index
121
+ elsif sep_date == date_obj
122
+ @sep_index = index
123
+ elsif oct_date == date_obj
124
+ @oct_index = index
125
+ elsif nov_date == date_obj
126
+ @nov_index = index
127
+ elsif dec_date == date_obj
128
+ @dec_index = index
129
+ elsif jan_next_year == date_obj
130
+ @jan_next_year_index = index
131
+ end
132
+ end
133
+
134
+ headers_unitless.each_index do |j|
135
+ i = 0
136
+ k = 0
137
+
138
+ monthly_sum_jan = monthly_sum_feb = monthly_sum_mar = monthly_sum_apr = monthly_sum_may = monthly_sum_jun = monthly_sum_jul = monthly_sum_aug = monthly_sum_sep = monthly_sum_oct = monthly_sum_nov = monthly_sum_dec = annual_sum = 0
139
+
140
+ # loop through values for each header
141
+ all_values = monthly_values[headers_unitless[j]]
142
+
143
+ unless @jan_next_year_index.nil? || @feb_index.nil? || @mar_index.nil? || @apr_index.nil? || @may_index.nil? || @jun_index.nil? || @jul_index.nil? || @aug_index.nil? || @sep_index.nil? || @oct_index.nil? || @nov_index.nil? || @dec_index.nil?
144
+
145
+ # for each header store monthly sums of values
146
+ all_values.each do |v|
147
+ if i < @feb_index
148
+ monthly_sum_jan += v.to_f
149
+ i += 1
150
+ elsif @feb_index <= i && i < @mar_index
151
+ monthly_sum_feb += v.to_f
152
+ i += 1
153
+ elsif @mar_index <= i && i < @apr_index
154
+ monthly_sum_mar += v.to_f
155
+ i += 1
156
+ elsif @apr_index <= i && i < @may_index
157
+ monthly_sum_apr += v.to_f
158
+ i += 1
159
+ elsif @may_index <= i && i < @jun_index
160
+ monthly_sum_may += v.to_f
161
+ i += 1
162
+ elsif @jun_index <= i && i < @jul_index
163
+ monthly_sum_jun += v.to_f
164
+ i += 1
165
+ elsif @jul_index <= i && i < @aug_index
166
+ monthly_sum_jul += v.to_f
167
+ i += 1
168
+ elsif @aug_index <= i && i < @sep_index
169
+ monthly_sum_aug += v.to_f
170
+ i += 1
171
+ elsif @sep_index <= i && i < @oct_index
172
+ monthly_sum_sep += v.to_f
173
+ i += 1
174
+ elsif @oct_index <= i && i < @nov_index
175
+ monthly_sum_oct += v.to_f
176
+ i += 1
177
+ elsif @nov_index <= i && i < @dec_index
178
+ monthly_sum_nov += v.to_f
179
+ i += 1
180
+ elsif @dec_index <= i && i < @jan_next_year_index
181
+ monthly_sum_dec += v.to_f
182
+ i += 1
183
+ end
184
+ # sum up all values for annual aggregate
185
+ if k <= size
186
+ annual_sum += v.to_f
187
+ k += 1
188
+ end
189
+ end
190
+ end
191
+
192
+ # store headers as key and monthly sums as values for each header
193
+ monthly_totals[headers_unitless[j]] = [monthly_sum_jan, monthly_sum_feb, monthly_sum_mar, monthly_sum_apr, monthly_sum_may, monthly_sum_jun, monthly_sum_jul, monthly_sum_aug, monthly_sum_sep, monthly_sum_oct, monthly_sum_nov, monthly_sum_dec]
194
+
195
+ annual_values[headers_unitless[j]] = annual_sum
196
+ end
197
+
198
+ @results = {}
199
+ @results['name'] = name
200
+ @results['monthly_values'] = {}
201
+ @results['annual_values'] = {}
202
+
203
+ if @jan_next_year_index.nil? || @feb_index.nil? || @mar_index.nil? || @apr_index.nil? || @may_index.nil? || @jun_index.nil? || @jul_index.nil? || @aug_index.nil? || @sep_index.nil? || @oct_index.nil? || @nov_index.nil? || @dec_index.nil?
204
+ @results['complete_simulation'] = false
205
+ puts "#{name} did not contain an annual simulation…visualizations will not render for it."
206
+ else
207
+ @results['complete_simulation'] = true
208
+ end
209
+
210
+ monthly_totals&.each do |key, value|
211
+ unless key == 'Datetime'
212
+ @results['monthly_values'][key] = value
213
+ end
214
+ end
215
+
216
+ annual_values&.each do |key, value|
217
+ unless key == 'Datetime'
218
+ @results['annual_values'][key] = value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ unless @results.nil?
225
+ @all_results << @results
226
+ end
227
+ end
228
+ # create json with required data stored in a variable
229
+ results_path = File.join(run_dir[0], '../scenarioData.js')
230
+ File.open(results_path, 'w') do |file|
231
+ file << "var scenarioData = #{JSON.pretty_generate(@all_results)};"
232
+ end
233
+ end
234
+ end # ResultVisualization
235
+ end # Scenario
236
+ end # URBANopt
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -60,8 +60,7 @@ module URBANopt
60
60
  @mapper_class = mapper_class
61
61
  end
62
62
 
63
- attr_reader :mapper_class
64
-
63
+ attr_reader :mapper_class, :feature_id
65
64
  ##
66
65
  # Return the directory that this simulation will run in.
67
66
  ##
@@ -132,8 +131,6 @@ module URBANopt
132
131
  return result
133
132
  end
134
133
 
135
- # rubocop: disable Metrics/AbcSize #:nodoc:
136
-
137
134
  ##
138
135
  # Return true if the simulation is out of date (input files newer than results), false otherwise.
139
136
  # Non-existant simulation input files are out of date.
@@ -197,9 +194,6 @@ module URBANopt
197
194
 
198
195
  return false
199
196
  end
200
- # rubocop: enable Metrics/AbcSize #:nodoc:
201
-
202
- # rubocop: disable Style/GuardClause #:nodoc:
203
197
 
204
198
  ##
205
199
  # Return simulation status one of {'Not Started', 'Started', 'Complete', 'Failed'}
@@ -217,7 +211,6 @@ module URBANopt
217
211
 
218
212
  return 'Not Started'
219
213
  end
220
- # rubocop: enable Style/GuardClause #:nodoc:
221
214
 
222
215
  ##
223
216
  # Clear the directory that this simulation runs in
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
4
  #
5
5
  # Redistribution and use in source and binary forms, with or without modification,
@@ -30,6 +30,6 @@
30
30
 
31
31
  module URBANopt
32
32
  module Scenario
33
- VERSION = '0.2.0.pre1'.freeze
33
+ VERSION = '0.4.0'.freeze
34
34
  end
35
35
  end
@@ -0,0 +1,3 @@
1
+ {
2
+ "lockfileVersion": 1
3
+ }
@@ -12,29 +12,29 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = 'Library to export data point OSW files from URBANopt Scenario CSV'
13
13
  spec.description = 'Library to export data point OSW files from URBANopt Scenario CSV'
14
14
  spec.homepage = 'https://github.com/urbanopt'
15
+ spec.licenses = 'Nonstandard'
15
16
 
16
17
  # Specify which files should be added to the gem when it is released.
17
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
19
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
19
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|lib.measures.*tests|spec|features)/}) }
20
21
  end
21
22
  spec.bindir = 'exe'
22
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
24
  spec.require_paths = ['lib']
24
- spec.required_ruby_version = '~> 2.2.4'
25
+ spec.required_ruby_version = '~> 2.5.0'
25
26
 
26
- spec.add_development_dependency 'bundler', '~> 1.14'
27
- spec.add_development_dependency 'rake', '12.3.1'
28
- spec.add_development_dependency 'rspec', '3.7.0'
29
- spec.add_development_dependency 'github_api', '~> 0.18.0'
30
- # Fix rack version temporarily to work with Ruby 2.2.4
31
- spec.add_development_dependency 'rack', '2.1.2'
27
+ spec.add_development_dependency 'bundler', '~> 2.1'
28
+ spec.add_development_dependency 'rake', '~> 13.0'
29
+ spec.add_development_dependency 'rspec', '~> 3.7'
32
30
 
33
- spec.add_dependency 'json-schema'
34
- spec.add_dependency 'json_pure'
35
- spec.add_dependency 'openstudio-model-articulation', '~> 0.1.1'
36
- spec.add_dependency 'urbanopt-core', '~> 0.1.0'
37
-
38
- # lock the version of these dependencies due to using older version of Ruby.
39
- spec.add_dependency 'public_suffix', '3.1.1'
31
+ spec.add_runtime_dependency 'json-schema', '~> 2.8'
32
+ spec.add_runtime_dependency 'json_pure', '~> 2.3'
33
+ spec.add_runtime_dependency 'openstudio-common-measures', '~> 0.2.0'
34
+ spec.add_runtime_dependency 'openstudio-extension', '~> 0.2.5'
35
+ spec.add_runtime_dependency 'openstudio-load-flexibility-measures', '~> 0.1.3'
36
+ spec.add_runtime_dependency 'openstudio-model-articulation', '~> 0.2.0'
37
+ spec.add_runtime_dependency 'sqlite3', '1.4.2'
38
+ spec.add_runtime_dependency 'urbanopt-core', '~> 0.4.0'
39
+ spec.add_runtime_dependency 'urbanopt-reporting', '~> 0.2.0'
40
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-scenario
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rawad El Kontar
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-03-11 00:00:00.000000000 Z
12
+ date: 2020-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -17,140 +17,168 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.14'
20
+ version: '2.1'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.14'
27
+ version: '2.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '='
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 12.3.1
34
+ version: '13.0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '='
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 12.3.1
41
+ version: '13.0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '='
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 3.7.0
48
+ version: '3.7'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '='
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 3.7.0
55
+ version: '3.7'
56
56
  - !ruby/object:Gem::Dependency
57
- name: github_api
57
+ name: json-schema
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 0.18.0
63
- type: :development
62
+ version: '2.8'
63
+ type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 0.18.0
69
+ version: '2.8'
70
70
  - !ruby/object:Gem::Dependency
71
- name: rack
71
+ name: json_pure
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '='
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 2.1.2
77
- type: :development
76
+ version: '2.3'
77
+ type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '='
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: 2.1.2
83
+ version: '2.3'
84
84
  - !ruby/object:Gem::Dependency
85
- name: json-schema
85
+ name: openstudio-common-measures
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0'
90
+ version: 0.2.0
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: 0.2.0
98
98
  - !ruby/object:Gem::Dependency
99
- name: json_pure
99
+ name: openstudio-extension
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: 0.2.5
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '0'
111
+ version: 0.2.5
112
112
  - !ruby/object:Gem::Dependency
113
- name: openstudio-model-articulation
113
+ name: openstudio-load-flexibility-measures
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: 0.1.1
118
+ version: 0.1.3
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: 0.1.1
125
+ version: 0.1.3
126
126
  - !ruby/object:Gem::Dependency
127
- name: urbanopt-core
127
+ name: openstudio-model-articulation
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: 0.1.0
132
+ version: 0.2.0
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: 0.1.0
139
+ version: 0.2.0
140
140
  - !ruby/object:Gem::Dependency
141
- name: public_suffix
141
+ name: sqlite3
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - '='
145
145
  - !ruby/object:Gem::Version
146
- version: 3.1.1
146
+ version: 1.4.2
147
147
  type: :runtime
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - '='
152
152
  - !ruby/object:Gem::Version
153
- version: 3.1.1
153
+ version: 1.4.2
154
+ - !ruby/object:Gem::Dependency
155
+ name: urbanopt-core
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: 0.4.0
161
+ type: :runtime
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: 0.4.0
168
+ - !ruby/object:Gem::Dependency
169
+ name: urbanopt-reporting
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - "~>"
173
+ - !ruby/object:Gem::Version
174
+ version: 0.2.0
175
+ type: :runtime
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: 0.2.0
154
182
  description: Library to export data point OSW files from URBANopt Scenario CSV
155
183
  email:
156
184
  - rawad.elkontar@nrel.gov
@@ -174,11 +202,6 @@ files:
174
202
  - README.md
175
203
  - Rakefile
176
204
  - deploy_docs.sh
177
- - doc_templates/LICENSE.md
178
- - doc_templates/README.md.erb
179
- - doc_templates/copyright_erb.txt
180
- - doc_templates/copyright_js.txt
181
- - doc_templates/copyright_ruby.txt
182
205
  - docs/.gitignore
183
206
  - docs/.vuepress/components/InnerJsonSchema.vue
184
207
  - docs/.vuepress/components/JsonSchema.vue
@@ -192,39 +215,9 @@ files:
192
215
  - docs/package-lock.json
193
216
  - docs/package.json
194
217
  - docs/schemas/scenario-schema.md
195
- - lib/change_log.rb
196
- - lib/measures/.rubocop.yml
197
- - lib/measures/default_feature_reports/LICENSE.md
198
- - lib/measures/default_feature_reports/README.md
199
- - lib/measures/default_feature_reports/README.md.erb
200
- - lib/measures/default_feature_reports/measure.rb
201
- - lib/measures/default_feature_reports/measure.xml
202
- - lib/measures/default_feature_reports/tests/USA_CO_Golden-NREL.724666_TMY3.epw
203
- - lib/measures/default_feature_reports/tests/default_feature_reports_test.rb
204
- - lib/measures/default_feature_reports/tests/example_model.osm
205
218
  - lib/urbanopt-scenario.rb
206
219
  - lib/urbanopt/scenario.rb
207
220
  - lib/urbanopt/scenario/default_reports.rb
208
- - lib/urbanopt/scenario/default_reports/construction_cost.rb
209
- - lib/urbanopt/scenario/default_reports/date.rb
210
- - lib/urbanopt/scenario/default_reports/distributed_generation.rb
211
- - lib/urbanopt/scenario/default_reports/end_use.rb
212
- - lib/urbanopt/scenario/default_reports/end_uses.rb
213
- - lib/urbanopt/scenario/default_reports/feature_report.rb
214
- - lib/urbanopt/scenario/default_reports/generator.rb
215
- - lib/urbanopt/scenario/default_reports/location.rb
216
- - lib/urbanopt/scenario/default_reports/logger.rb
217
- - lib/urbanopt/scenario/default_reports/program.rb
218
- - lib/urbanopt/scenario/default_reports/reporting_period.rb
219
- - lib/urbanopt/scenario/default_reports/scenario_report.rb
220
- - lib/urbanopt/scenario/default_reports/schema/README.md
221
- - lib/urbanopt/scenario/default_reports/schema/scenario_csv_columns.txt
222
- - lib/urbanopt/scenario/default_reports/schema/scenario_schema.json
223
- - lib/urbanopt/scenario/default_reports/solar_pv.rb
224
- - lib/urbanopt/scenario/default_reports/storage.rb
225
- - lib/urbanopt/scenario/default_reports/timeseries_csv.rb
226
- - lib/urbanopt/scenario/default_reports/validator.rb
227
- - lib/urbanopt/scenario/default_reports/wind.rb
228
221
  - lib/urbanopt/scenario/extension.rb
229
222
  - lib/urbanopt/scenario/logger.rb
230
223
  - lib/urbanopt/scenario/scenario_base.rb
@@ -232,15 +225,19 @@ files:
232
225
  - lib/urbanopt/scenario/scenario_datapoint_base.rb
233
226
  - lib/urbanopt/scenario/scenario_post_processor_base.rb
234
227
  - lib/urbanopt/scenario/scenario_post_processor_default.rb
228
+ - lib/urbanopt/scenario/scenario_post_processor_opendss.rb
235
229
  - lib/urbanopt/scenario/scenario_runner_base.rb
236
230
  - lib/urbanopt/scenario/scenario_runner_osw.rb
231
+ - lib/urbanopt/scenario/scenario_visualization.rb
237
232
  - lib/urbanopt/scenario/simulation_dir_base.rb
238
233
  - lib/urbanopt/scenario/simulation_dir_osw.rb
239
234
  - lib/urbanopt/scenario/simulation_mapper_base.rb
240
235
  - lib/urbanopt/scenario/version.rb
236
+ - package-lock.json
241
237
  - urbanopt-scenario-gem.gemspec
242
238
  homepage: https://github.com/urbanopt
243
- licenses: []
239
+ licenses:
240
+ - Nonstandard
244
241
  metadata: {}
245
242
  post_install_message:
246
243
  rdoc_options: []
@@ -250,15 +247,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
247
  requirements:
251
248
  - - "~>"
252
249
  - !ruby/object:Gem::Version
253
- version: 2.2.4
250
+ version: 2.5.0
254
251
  required_rubygems_version: !ruby/object:Gem::Requirement
255
252
  requirements:
256
- - - ">"
253
+ - - ">="
257
254
  - !ruby/object:Gem::Version
258
- version: 1.3.1
255
+ version: '0'
259
256
  requirements: []
260
- rubyforge_project:
261
- rubygems_version: 2.4.5.1
257
+ rubygems_version: 3.1.4
262
258
  signing_key:
263
259
  specification_version: 4
264
260
  summary: Library to export data point OSW files from URBANopt Scenario CSV