urbanopt-reporting 0.5.0 → 0.6.2

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/nightly_build.yml +41 -0
  3. data/CHANGELOG.md +22 -1
  4. data/LICENSE.md +17 -17
  5. data/README.md +4 -2
  6. data/doc_templates/LICENSE.md +17 -17
  7. data/doc_templates/copyright_erb.txt +2 -2
  8. data/doc_templates/copyright_js.txt +2 -2
  9. data/doc_templates/copyright_ruby.txt +1 -1
  10. data/docs/package-lock.json +15720 -1410
  11. data/lib/measures/.rubocop.yml +4 -2
  12. data/lib/measures/default_feature_reports/measure.rb +221 -16
  13. data/lib/measures/export_modelica_loads/measure.rb +1 -1
  14. data/lib/measures/export_time_series_modelica/measure.rb +1 -1
  15. data/lib/measures/export_time_series_modelica/resources/os_lib_helper_methods.rb +1 -1
  16. data/lib/urbanopt/reporting/default_reports/construction_cost.rb +1 -1
  17. data/lib/urbanopt/reporting/default_reports/date.rb +1 -1
  18. data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +20 -2
  19. data/lib/urbanopt/reporting/default_reports/end_use.rb +1 -1
  20. data/lib/urbanopt/reporting/default_reports/end_uses.rb +1 -1
  21. data/lib/urbanopt/reporting/default_reports/extension.rb +1 -1
  22. data/lib/urbanopt/reporting/default_reports/feature_report.rb +2 -2
  23. data/lib/urbanopt/reporting/default_reports/generator.rb +1 -2
  24. data/lib/urbanopt/reporting/default_reports/location.rb +1 -1
  25. data/lib/urbanopt/reporting/default_reports/logger.rb +1 -1
  26. data/lib/urbanopt/reporting/default_reports/power_distribution.rb +21 -6
  27. data/lib/urbanopt/reporting/default_reports/program.rb +1 -1
  28. data/lib/urbanopt/reporting/default_reports/reporting_period.rb +44 -3
  29. data/lib/urbanopt/reporting/default_reports/scenario_power_distribution.rb +148 -0
  30. data/lib/urbanopt/reporting/default_reports/scenario_report.rb +7 -3
  31. data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +24 -0
  32. data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +265 -6
  33. data/lib/urbanopt/reporting/default_reports/solar_pv.rb +42 -3
  34. data/lib/urbanopt/reporting/default_reports/storage.rb +1 -1
  35. data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +1 -1
  36. data/lib/urbanopt/reporting/default_reports/timeseries_csv.rb +1 -1
  37. data/lib/urbanopt/reporting/default_reports/validator.rb +1 -1
  38. data/lib/urbanopt/reporting/default_reports/wind.rb +11 -2
  39. data/lib/urbanopt/reporting/default_reports.rb +1 -1
  40. data/lib/urbanopt/reporting/derived_extension.rb +1 -1
  41. data/lib/urbanopt/reporting/version.rb +2 -2
  42. data/lib/urbanopt/reporting.rb +1 -1
  43. data/urbanopt-reporting-gem.gemspec +3 -0
  44. metadata +32 -2
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -52,7 +52,7 @@ module URBANopt
52
52
  # _Float_ - power capacity in kilowatts
53
53
  #
54
54
  attr_accessor :size_kw
55
- attr_accessor :location
55
+ attr_accessor :location, :tilt, :azimuth, :module_type
56
56
 
57
57
  ##
58
58
  # Initialize SolarPV attributes from a hash. Solar PV attributes currently are limited to power capacity.
@@ -67,6 +67,39 @@ module URBANopt
67
67
  @size_kw = hash[:size_kw]
68
68
  @id = hash[:id]
69
69
  @location = hash[:location]
70
+ @approx_area_m2 = 0
71
+
72
+ if hash[:azimuth]
73
+ @azimuth = hash[:azimuth]
74
+ end
75
+ if hash[:tilt]
76
+ @tilt = hash[:tilt]
77
+ end
78
+ if hash[:module_type]
79
+ @module_type = hash[:module_type]
80
+
81
+ # calculate area with PVWatts formulas
82
+ # Size (kW) = Array Area (m²) × 1 kW/m² × Module Efficiency (%)
83
+ # also grab module efficiency: 0 (standard) = 15%, 1 (premium) = 19%, 2 (thin film) = 10%
84
+ eff = 0
85
+ case @module_type
86
+ when 0
87
+ eff = 0.15
88
+ when 1
89
+ eff = 0.19
90
+ when 2
91
+ eff = 0.10
92
+ end
93
+ if @size_kw != 0
94
+ @approx_area_m2 = (@size_kw / eff).round(3)
95
+ end
96
+ end
97
+ if hash[:gcr]
98
+ @gcr = hash[:gcr]
99
+ end
100
+ if hash[:average_yearly_energy_produced_kwh]
101
+ @annual_energy_produced = hash[:average_yearly_energy_produced_kwh]
102
+ end
70
103
 
71
104
  # initialize class variables @@validator and @@schema
72
105
  @@validator ||= Validator.new
@@ -84,6 +117,12 @@ module URBANopt
84
117
 
85
118
  result[:size_kw] = @size_kw if @size_kw
86
119
  result[:location] = @location if @location
120
+ result[:azimuth] = @azimuth if @azimuth
121
+ result[:tilt] = @tilt if @tilt
122
+ result[:module_type] = @module_type if @module_type
123
+ result[:approximate_area_m2] = @approx_area_m2 if @approx_area_m2
124
+ result[:gcr] = @gcr if @gcr
125
+ result[:average_yearly_energy_produced_kwh] = @annual_energy_produced if @annual_energy_produced
87
126
 
88
127
  return result
89
128
  end
@@ -97,7 +136,7 @@ module URBANopt
97
136
  else
98
137
  existing_pv.size_kw = (existing_pv.size_kw || 0) + (new_pv.size_kw || 0)
99
138
  end
100
-
139
+ # KAF: todo, recalculate area?
101
140
  return existing_pv
102
141
  end
103
142
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -51,7 +51,7 @@ module URBANopt
51
51
  ##
52
52
  # _Float_ - power capacity in kilowatts
53
53
  #
54
- attr_accessor :size_kw
54
+ attr_accessor :size_kw, :average_yearly_energy_produced_kwh, :size_class
55
55
 
56
56
  ##
57
57
  # Initialize Wind attributes from a hash. Wind attributes currently are limited to power capacity.
@@ -64,6 +64,8 @@ module URBANopt
64
64
  hash.delete_if { |k, v| v.nil? }
65
65
 
66
66
  @size_kw = hash[:size_kw]
67
+ @avg_energy_kwh = hash[:average_yearly_energy_produced_kwh]
68
+ @size_class = hash[:size_class]
67
69
 
68
70
  # initialize class variables @@validator and @@schema
69
71
  @@validator ||= Validator.new
@@ -80,6 +82,8 @@ module URBANopt
80
82
  result = {}
81
83
 
82
84
  result[:size_kw] = @size_kw if @size_kw
85
+ result[:average_yearly_energy_produced_kwh] = @avg_energy_kwh if @avg_energy_kwh
86
+ result[:size_class] = @size_class if @size_class
83
87
 
84
88
  return result
85
89
  end
@@ -93,6 +97,11 @@ module URBANopt
93
97
  else
94
98
  existing_wind.size_kw = (existing_wind.size_kw || 0) + (new_wind.size_kw || 0)
95
99
  end
100
+ if existing_wind.average_yearly_energy_produced_kwh.nil? && new_wind.average_yearly_energy_produced_kwh.nil?
101
+ existing_wind.average_yearly_energy_produced_kwh = nil
102
+ else
103
+ existing_wind.average_yearly_energy_produced_kwh = (existing_wind.average_yearly_energy_produced_kwh || 0) + (new_wind.average_yearly_energy_produced_kwh || 0)
104
+ end
96
105
 
97
106
  return existing_wind
98
107
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -40,6 +40,6 @@
40
40
 
41
41
  module URBANopt
42
42
  module Reporting
43
- VERSION = '0.5.0'.freeze
43
+ VERSION = '0.6.2'.freeze
44
44
  end
45
45
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -26,6 +26,9 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'bundler', '>= 2.1.0'
27
27
  spec.add_development_dependency 'rake', '~> 13.0'
28
28
  spec.add_development_dependency 'rspec', '~> 3.9'
29
+ spec.add_development_dependency 'simplecov', '~> 0.18.2'
30
+ spec.add_development_dependency 'simplecov-lcov', '~> 0.8.0'
31
+
29
32
  spec.add_runtime_dependency 'json_pure', '~> 2.3'
30
33
  spec.add_runtime_dependency 'json-schema', '~> 2.8'
31
34
  spec.add_runtime_dependency 'openstudio-extension', '~> 0.5.1'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-reporting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.2
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: 2021-12-06 00:00:00.000000000 Z
12
+ date: 2022-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -53,6 +53,34 @@ dependencies:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: '3.9'
56
+ - !ruby/object:Gem::Dependency
57
+ name: simplecov
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 0.18.2
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 0.18.2
70
+ - !ruby/object:Gem::Dependency
71
+ name: simplecov-lcov
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.8.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.8.0
56
84
  - !ruby/object:Gem::Dependency
57
85
  name: json_pure
58
86
  requirement: !ruby/object:Gem::Requirement
@@ -106,6 +134,7 @@ files:
106
134
  - ".github/ISSUE_TEMPLATE/bug_report.md"
107
135
  - ".github/ISSUE_TEMPLATE/feature_request.md"
108
136
  - ".github/pull_request_template.md"
137
+ - ".github/workflows/nightly_build.yml"
109
138
  - ".gitignore"
110
139
  - ".rdoc_options"
111
140
  - ".rubocop.yml"
@@ -174,6 +203,7 @@ files:
174
203
  - lib/urbanopt/reporting/default_reports/power_distribution.rb
175
204
  - lib/urbanopt/reporting/default_reports/program.rb
176
205
  - lib/urbanopt/reporting/default_reports/reporting_period.rb
206
+ - lib/urbanopt/reporting/default_reports/scenario_power_distribution.rb
177
207
  - lib/urbanopt/reporting/default_reports/scenario_report.rb
178
208
  - lib/urbanopt/reporting/default_reports/schema/README.md
179
209
  - lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt