urbanopt-reopt 0.4.0 → 0.4.1

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: a4f6687c61a1902f3982215b12944c8551f892e7ea489412b9df174941ceb48d
4
- data.tar.gz: 639bf269508f322975cc831d0541edb72e4537b891fee104edb34cf769481a78
3
+ metadata.gz: 90df2818b01b203209865c341bf01b102e740fac35957d0b20267c2f2137b4e7
4
+ data.tar.gz: 36779ea6879044b7ac5f5612b2b5e19a744513710cd977d6d2d2d9a7aa1a2bdf
5
5
  SHA512:
6
- metadata.gz: 9a9fa7e3d39dfac3c87fff10dc9a6530f73893cdc5a25de4786b223b2079b97488758387a10cb30c31e01fe65ef1c5ddba8732fb73766929d41aea6542429034
7
- data.tar.gz: 834ee49b279c9361c79e9f479addbcf17b02d9ac31b7e2281fec8fe200cf8494068d0510b3e1b812c3b9d1b3e53547082c38547e7a6fc40b826cfc0b22eac263
6
+ metadata.gz: aa4568153ef4b63f20dc69f6a35f5bf2393cba20528e6a3aa76f0eb005cd957231feb27a42482bce82d7eda60fccd39af0269421a43a79cac0a2282dff06e4a2
7
+ data.tar.gz: 31d6fa363ca7ab0755b8a058fc856a99678ea62f89e86f8ff1c6aa33fa945cb743d0debc8ad5950254e5cfc4cce53b8a468845370e41602d9230d58f49ff5477
@@ -1,4 +1,4 @@
1
- ### Addresses #[issue number here]
1
+ ### Resolves #[issue number here]
2
2
 
3
3
  ### Pull Request Description
4
4
 
@@ -9,5 +9,5 @@
9
9
  - [ ] Unit tests have been added or updated
10
10
  - [ ] Documentation has been modified appropriately
11
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
12
+ - [ ] An [issue](https://github.com/urbanopt/urbanopt-reopt-gem/issues) has been created (which will be used for the changelog)
13
13
  - [ ] This branch is up-to-date with develop
@@ -1,5 +1,14 @@
1
1
  # URBANopt REopt Gem
2
2
 
3
+ ## Version 0.4.1
4
+
5
+ Date range: 9/23/20 - 11/12/20
6
+
7
+ * PR template now automatically closes issue on merge
8
+ * Remove unnecessary require statement
9
+ * Reporting bugfix
10
+ * Working with reporting gem updates
11
+
3
12
  ## Version 0.4.0
4
13
 
5
14
  Date range: 6/5/20 - 9/22/20
data/Gemfile CHANGED
@@ -41,11 +41,10 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
41
41
  # gem 'openstudio-model-articulation', '0.1.0'
42
42
  # end
43
43
 
44
-
45
44
  # if allow_local && File.exist?('../urbanopt-scenario-gem')
46
45
  # gem 'urbanopt-scenario', path: '../urbanopt-scenario-gem'
47
46
  # elsif allow_local
48
- # gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
47
+ # gem 'urbanopt-scenario', github: 'URBANopt/urbanopt-scenario-gem', branch: 'develop'
49
48
  # end
50
49
 
51
50
  # if allow_local && File.exists?('../urbanopt-geojson-gem')
@@ -54,9 +53,4 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
54
53
  # gem 'urbanopt-geojson', github: 'URBANopt/urbanopt-geojson-gem', branch: 'develop'
55
54
  # end
56
55
 
57
- # Support requests in windows
58
- # gem 'certified'
59
-
60
- gem 'rdoc', '4.3.0'
61
-
62
- # gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
56
+ # gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
@@ -69,11 +69,11 @@ module URBANopt # :nodoc:
69
69
 
70
70
  # Check FeatureReport has required data
71
71
  requireds_names = ['latitude', 'longitude']
72
- requireds = [feature_report.location.latitude, feature_report.location.longitude]
72
+ requireds = [feature_report.location.latitude_deg, feature_report.location.longitude_deg]
73
73
 
74
74
  if requireds.include?(nil) || requireds.include?(0)
75
75
  requireds.each_with_index do |i, x|
76
- if [nil, 0].include? x
76
+ if [nil].include? x
77
77
  n = requireds_names[i]
78
78
  # @@logger.error("Missing value for #{n} - this is a required input")
79
79
  raise "Missing value for #{n} - this is a required input"
@@ -84,16 +84,16 @@ module URBANopt # :nodoc:
84
84
  reopt_inputs[:Scenario][:description] = description
85
85
 
86
86
  # Parse Location
87
- reopt_inputs[:Scenario][:Site][:latitude] = feature_report.location.latitude
88
- reopt_inputs[:Scenario][:Site][:longitude] = feature_report.location.longitude
87
+ reopt_inputs[:Scenario][:Site][:latitude] = feature_report.location.latitude_deg
88
+ reopt_inputs[:Scenario][:Site][:longitude] = feature_report.location.longitude_deg
89
89
 
90
90
  # Parse Optional FeatureReport metrics
91
- unless feature_report.program.roof_area.nil?
92
- reopt_inputs[:Scenario][:Site][:roof_squarefeet] = feature_report.program.roof_area[:available_roof_area]
91
+ unless feature_report.program.roof_area_sqft.nil?
92
+ reopt_inputs[:Scenario][:Site][:roof_squarefeet] = feature_report.program.roof_area_sqft[:available_roof_area]
93
93
  end
94
94
 
95
- unless feature_report.program.site_area.nil?
96
- reopt_inputs[:Scenario][:Site][:land_acres] = feature_report.program.site_area * 1.0 / 43560 # acres/sqft
95
+ unless feature_report.program.site_area_sqft.nil?
96
+ reopt_inputs[:Scenario][:Site][:land_acres] = feature_report.program.site_area_sqft * 1.0 / 43560 # acres/sqft
97
97
  end
98
98
 
99
99
  unless feature_report.timesteps_per_hour.nil?
@@ -161,8 +161,8 @@ module URBANopt # :nodoc:
161
161
  end
162
162
 
163
163
  # Update location
164
- feature_report.location.latitude = reopt_output['inputs']['Scenario']['Site']['latitude']
165
- feature_report.location.longitude = reopt_output['inputs']['Scenario']['Site']['longitude']
164
+ feature_report.location.latitude_deg = reopt_output['inputs']['Scenario']['Site']['latitude']
165
+ feature_report.location.longitude_deg = reopt_output['inputs']['Scenario']['Site']['longitude']
166
166
 
167
167
  # Update timeseries csv from \REopt Lite dispatch data
168
168
  feature_report.timesteps_per_hour = reopt_output['inputs']['Scenario']['time_steps_per_hour']
@@ -31,7 +31,6 @@
31
31
  require 'bundler/setup'
32
32
  require 'urbanopt/reporting/default_reports'
33
33
  require 'urbanopt/reopt/reopt_logger'
34
- require 'urbanopt/reopt'
35
34
  require 'csv'
36
35
 
37
36
  module URBANopt # :nodoc:
@@ -141,7 +140,8 @@ module URBANopt # :nodoc:
141
140
  end
142
141
  result = adapter.update_feature_report(feature_report, reopt_output, timeseries_csv_path, resilience_stats)
143
142
  if !save_name.nil?
144
- result.save_feature_report save_name
143
+ #result.save_feature_report save_name
144
+ result.save_json_report(save_name)
145
145
  end
146
146
  return result
147
147
  end
@@ -251,7 +251,8 @@ module URBANopt # :nodoc:
251
251
  new_feature_reports.push(new_feature_report)
252
252
  if !save_names.nil?
253
253
  if save_names.length == feature_reports.length
254
- new_feature_report.save_feature_report save_names[idx]
254
+ #new_feature_report.save_feature_report save_names[idx]
255
+ new_feature_report.save_json_report save_names[idx]
255
256
  else
256
257
  warn "Could not save feature reports - the number of save names provided did not match the number of feature reports"
257
258
  end
@@ -70,31 +70,33 @@ module URBANopt # :nodoc:
70
70
  end
71
71
 
72
72
  # Update required info
73
- if scenario_report.location.latitude.nil? || scenario_report.location.longitude.nil? || (scenario_report.location.latitude == 0) || (scenario_report.location.longitude == 0)
73
+ if scenario_report.location.latitude_deg.nil? || scenario_report.location.longitude_deg.nil? || (scenario_report.location.latitude_deg == 0) || (scenario_report.location.longitude_deg == 0)
74
74
  if !scenario_report.feature_reports.nil? && (scenario_report.feature_reports != [])
75
75
  lats = []
76
76
  longs = []
77
77
  scenario_report.feature_reports.each do |x|
78
- if ![nil, 0].include?(x[:location][:latitude]) && ![nil, 0].include?(x[:location][:longitude])
79
- lats.push(x[:location][:latitude])
80
- longs.push(x[:location][:longitude])
78
+ puts " ERROR: #{x.location.latitude_deg}"
79
+ if ![nil].include?(x.location.latitude_deg) && ![nil].include?(x.location.longitude_deg)
80
+ lats.push(x.location.latitude_deg)
81
+ longs.push(x.location.longitude_deg)
81
82
  end
82
83
  end
83
84
 
84
85
  if !lats.empty? && !longs.empty?
85
- scenario_report.location.latitude = lats.reduce(:+) / lats.size.to_f
86
- scenario_report.location.longitude = longs.reduce(:+) / longs.size.to_f
86
+ scenario_report.location.latitude_deg = lats.reduce(:+) / lats.size.to_f
87
+ scenario_report.location.longitude_deg = longs.reduce(:+) / longs.size.to_f
87
88
  end
88
89
  end
89
90
  end
90
91
 
91
92
  # Update required info
92
93
  requireds_names = ['latitude', 'longitude']
93
- requireds = [scenario_report.location.latitude, scenario_report.location.longitude]
94
+ requireds = [scenario_report.location.latitude_deg, scenario_report.location.longitude_deg]
95
+
94
96
 
95
97
  if requireds.include?(nil) || requireds.include?(0)
96
- requireds.each_with_index do |i, x|
97
- if [nil, 0].include? x
98
+ requireds.each_with_index do |x, i|
99
+ if [nil].include? x
98
100
  n = requireds_names[i]
99
101
  raise "Missing value for #{n} - this is a required input"
100
102
  end
@@ -103,16 +105,17 @@ module URBANopt # :nodoc:
103
105
 
104
106
  reopt_inputs[:Scenario][:description] = description
105
107
 
106
- reopt_inputs[:Scenario][:Site][:latitude] = scenario_report.location.latitude
107
- reopt_inputs[:Scenario][:Site][:longitude] = scenario_report.location.longitude
108
+ reopt_inputs[:Scenario][:Site][:latitude] = scenario_report.location.latitude_deg
109
+ reopt_inputs[:Scenario][:Site][:longitude] = scenario_report.location.longitude_deg
108
110
 
109
111
  # Update optional info
110
- if !scenario_report.program.roof_area.nil?
111
- reopt_inputs[:Scenario][:Site][:roof_squarefeet] = scenario_report.program.roof_area[:available_roof_area]
112
+ # REK: attribute names should be updated
113
+ if !scenario_report.program.roof_area_sqft.nil?
114
+ reopt_inputs[:Scenario][:Site][:roof_squarefeet] = scenario_report.program.roof_area_sqft[:available_roof_area]
112
115
  end
113
116
 
114
- if !scenario_report.program.site_area.nil?
115
- reopt_inputs[:Scenario][:Site][:land_acres] = scenario_report.program.site_area * 1.0 / 43560 # acres/sqft
117
+ if !scenario_report.program.site_area_sqft.nil?
118
+ reopt_inputs[:Scenario][:Site][:land_acres] = scenario_report.program.site_area_sqft * 1.0 / 43560 # acres/sqft
116
119
  end
117
120
 
118
121
  unless scenario_report.timesteps_per_hour.nil?
@@ -201,8 +204,8 @@ module URBANopt # :nodoc:
201
204
  end
202
205
 
203
206
  # Update location
204
- scenario_report.location.latitude = reopt_output['inputs']['Scenario']['Site']['latitude']
205
- scenario_report.location.longitude = reopt_output['inputs']['Scenario']['Site']['longitude']
207
+ scenario_report.location.latitude_deg = reopt_output['inputs']['Scenario']['Site']['latitude']
208
+ scenario_report.location.longitude_deg = reopt_output['inputs']['Scenario']['Site']['longitude']
206
209
 
207
210
  # Update timeseries csv from \REopt Lite dispatch data
208
211
  scenario_report.timesteps_per_hour = reopt_output['inputs']['Scenario']['time_steps_per_hour']
@@ -30,6 +30,6 @@
30
30
 
31
31
  module URBANopt # :nodoc:
32
32
  module REopt # :nodoc:
33
- VERSION = '0.4.0'.freeze
33
+ VERSION = '0.4.1'.freeze
34
34
  end
35
35
  end
@@ -24,13 +24,14 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ['lib']
25
25
 
26
26
  spec.required_ruby_version = '~> 2.5.0'
27
-
27
+
28
28
  spec.add_development_dependency 'bundler', '~> 2.1'
29
29
  spec.add_development_dependency 'rake', '~> 13.0'
30
30
  spec.add_development_dependency 'rspec', '~> 3.7'
31
31
  spec.add_development_dependency 'rubocop', '~> 0.54.0'
32
+ spec.add_development_dependency 'rdoc', '~> 4.3.0'
32
33
 
33
34
  spec.add_dependency 'certified', '~> 1'
34
35
  spec.add_dependency 'json_pure', '~> 2'
35
- spec.add_dependency 'urbanopt-scenario', '~> 0.4.0'
36
+ spec.add_dependency 'urbanopt-scenario', '~> 0.4.3'
36
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-reopt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.54.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 4.3.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 4.3.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: certified
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +114,14 @@ dependencies:
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: 0.4.0
117
+ version: 0.4.3
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: 0.4.0
124
+ version: 0.4.3
111
125
  description: Classes and measures for utilizing the REopt Lite API within OpenStudio
112
126
  workflows.
113
127
  email:
@@ -124,7 +138,6 @@ files:
124
138
  - ".rdoc_options"
125
139
  - ".rspec"
126
140
  - ".rubocop.yml"
127
- - ".travis.yml"
128
141
  - CHANGELOG.md
129
142
  - CONTRIBUTING.md
130
143
  - Gemfile
@@ -1,22 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- #cache: bundler
5
- rvm:
6
- - 2.2.4
7
- matrix:
8
- include:
9
- - env: OPENSTUDIO_VERSION=2.7.0 && OPENSTUDIO_SHA=544f363db5 && RUBYLIB=/usr/local/openstudio-2.7.0/Ruby:/usr/Ruby
10
- before_install:
11
- - gem install bundler -v '1.17'
12
- - gem install bundler -v '~> 1.17'
13
- install:
14
- - bundle install
15
- before_script:
16
- - curl -sLO https://raw.githubusercontent.com/NREL/OpenStudio-server/develop/docker/deployment/scripts/install_openstudio.sh
17
- - chmod +x install_openstudio.sh
18
- - sudo ./install_openstudio.sh $OPENSTUDIO_VERSION $OPENSTUDIO_SHA
19
- - sudo ./install_openstudio.sh $OPENSTUDIO_VERSION $OPENSTUDIO_SHA
20
- script:
21
- - bundle exec rake
22
- - bundle exec rake