urbanopt-reporting 0.1.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +19 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +15 -0
- data/.github/pull_request_template.md +13 -0
- data/.rdoc_options +36 -0
- data/CHANGELOG.md +39 -0
- data/CONTRIBUTING.md +1 -1
- data/LICENSE.md +1 -1
- data/RDOC_MAIN.md +10 -0
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/deploy_docs.sh +5 -0
- data/doc_templates/LICENSE.md +1 -1
- data/doc_templates/copyright_erb.txt +1 -1
- data/doc_templates/copyright_js.txt +1 -1
- data/doc_templates/copyright_ruby.txt +1 -1
- data/docs/.gitignore +3 -0
- data/docs/.vuepress/components/InnerJsonSchema.vue +76 -0
- data/docs/.vuepress/components/JsonSchema.vue +12 -0
- data/docs/.vuepress/components/ScenarioSchema.vue +12 -0
- data/docs/.vuepress/components/StaticLink.vue +8 -0
- data/docs/.vuepress/config.js +25 -0
- data/docs/.vuepress/highlight.js +8 -0
- data/docs/.vuepress/json-schema-deref-loader.js +22 -0
- data/docs/.vuepress/public/custom_rdoc_styles.css +78 -0
- data/docs/.vuepress/styles/palette.styl +1 -0
- data/docs/.vuepress/utils.js +17 -0
- data/docs/README.md +9 -0
- data/docs/package-lock.json +10018 -0
- data/docs/package.json +30 -0
- data/docs/schemas/scenario-schema.md +3 -0
- data/lib/measures/default_feature_reports/LICENSE.md +1 -1
- data/lib/measures/default_feature_reports/measure.rb +261 -88
- data/lib/measures/default_feature_reports/measure.xml +11 -11
- data/lib/urbanopt/reporting.rb +1 -1
- data/lib/urbanopt/reporting/default_reports.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/construction_cost.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/date.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +119 -6
- data/lib/urbanopt/reporting/default_reports/end_use.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/end_uses.rb +53 -39
- data/lib/urbanopt/reporting/default_reports/extension.rb +30 -0
- data/lib/urbanopt/reporting/default_reports/feature_report.rb +52 -21
- data/lib/urbanopt/reporting/default_reports/generator.rb +2 -2
- data/lib/urbanopt/reporting/default_reports/location.rb +12 -12
- data/lib/urbanopt/reporting/default_reports/logger.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/power_distribution.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/program.rb +87 -87
- data/lib/urbanopt/reporting/default_reports/reporting_period.rb +87 -79
- data/lib/urbanopt/reporting/default_reports/scenario_report.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/schema/README.md +1 -1
- data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +18 -1
- data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +117 -82
- data/lib/urbanopt/reporting/default_reports/solar_pv.rb +2 -2
- data/lib/urbanopt/reporting/default_reports/storage.rb +2 -2
- data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +111 -0
- data/lib/urbanopt/reporting/default_reports/timeseries_csv.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/validator.rb +1 -1
- data/lib/urbanopt/reporting/default_reports/wind.rb +2 -2
- data/lib/urbanopt/reporting/derived_extension.rb +1 -1
- data/lib/urbanopt/reporting/version.rb +2 -2
- data/urbanopt-reporting-gem.gemspec +4 -4
- metadata +37 -15
@@ -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,
|
@@ -61,7 +61,7 @@ module URBANopt
|
|
61
61
|
@@schema ||= @@validator.schema
|
62
62
|
|
63
63
|
# initialize @@logger
|
64
|
-
@@logger ||= URBANopt::
|
64
|
+
@@logger ||= URBANopt::Reporting::DefaultReports.logger
|
65
65
|
end
|
66
66
|
|
67
67
|
##
|
@@ -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,
|
@@ -66,7 +66,7 @@ module URBANopt
|
|
66
66
|
@@schema ||= @@validator.schema
|
67
67
|
|
68
68
|
# initialize @@logger
|
69
|
-
@@logger ||= URBANopt::
|
69
|
+
@@logger ||= URBANopt::Reporting::DefaultReports.logger
|
70
70
|
end
|
71
71
|
|
72
72
|
##
|
@@ -0,0 +1,111 @@
|
|
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 'json'
|
32
|
+
require 'urbanopt/reporting/default_reports/validator'
|
33
|
+
require 'json-schema'
|
34
|
+
|
35
|
+
module URBANopt
|
36
|
+
module Reporting
|
37
|
+
module DefaultReports
|
38
|
+
##
|
39
|
+
# Ice Thermal Storage Systems
|
40
|
+
##
|
41
|
+
class ThermalStorage
|
42
|
+
##
|
43
|
+
# _Float_ - Total ice storage capacity on central plant loop in kWh
|
44
|
+
#
|
45
|
+
attr_accessor :its_size_kwh
|
46
|
+
|
47
|
+
# _Float_ - Total ice storage capacity distributed to packaged systems in kWh
|
48
|
+
#
|
49
|
+
attr_accessor :ptes_size_kwh
|
50
|
+
|
51
|
+
def initialize(hash = {})
|
52
|
+
hash.delete_if { |k, v| v.nil? }
|
53
|
+
|
54
|
+
@its_size = hash[:its_size_kwh]
|
55
|
+
@ptes_size = hash[:ptes_size_kwh]
|
56
|
+
|
57
|
+
# initialize class variables @@validator and @@schema
|
58
|
+
@@validator ||= Validator.new
|
59
|
+
@@schema ||= @@validator.schema
|
60
|
+
|
61
|
+
# initialize @@logger
|
62
|
+
@@logger ||= URBANopt::Reporting::DefaultReports.logger
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# Assigns default values if attribute values do not exist.
|
67
|
+
##
|
68
|
+
def defaults
|
69
|
+
hash = {}
|
70
|
+
hash[:its_size_kwh] = nil
|
71
|
+
hash[:ptes_size_kwh] = nil
|
72
|
+
|
73
|
+
return hash
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Convert to hash equivalent for JSON serialization
|
78
|
+
##
|
79
|
+
def to_hash
|
80
|
+
result = {}
|
81
|
+
result[:its_size_kwh] = @its_size_kwh if @its_size_kwh
|
82
|
+
result[:ptes_size_kwh] = @ptes_size_kwh if @ptes_size_kwh
|
83
|
+
|
84
|
+
return result
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# Add up old and new values
|
89
|
+
##
|
90
|
+
def self.add_values(existing_value, new_value) #:nodoc:
|
91
|
+
if existing_value && new_value
|
92
|
+
existing_value += new_value
|
93
|
+
elsif new_value
|
94
|
+
existing_value = new_value
|
95
|
+
end
|
96
|
+
return existing_value
|
97
|
+
end
|
98
|
+
|
99
|
+
##
|
100
|
+
# Merge thermal storage
|
101
|
+
##
|
102
|
+
def self.merge_thermal_storage(existing_tes, new_tes)
|
103
|
+
existing_tes.its_size_kwh = add_values(existing_tes.its_size_kwh, new_tes.its_size_kwh)
|
104
|
+
existing_tes.ptes_size_kwh = add_values(existing_tes.ptes_size_kwh, new_tes.ptes_size_kwh)
|
105
|
+
|
106
|
+
return existing_tes
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
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,
|
@@ -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,7 +60,7 @@ module URBANopt
|
|
60
60
|
@@schema ||= @@validator.schema
|
61
61
|
|
62
62
|
# initialize @@logger
|
63
|
-
@@logger ||= URBANopt::
|
63
|
+
@@logger ||= URBANopt::Reporting::DefaultReports.logger
|
64
64
|
end
|
65
65
|
|
66
66
|
##
|
@@ -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 Reporting
|
33
|
-
VERSION = '0.1
|
33
|
+
VERSION = '0.3.1'.freeze
|
34
34
|
end
|
35
35
|
end
|
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = 'Library to report URBANopt results'
|
13
13
|
spec.description = 'Library include scenario default reporting measure and scenario defaults reports schema and classes'
|
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.
|
@@ -26,8 +27,7 @@ Gem::Specification.new do |spec|
|
|
26
27
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
27
28
|
spec.add_development_dependency 'rake', '~> 13.0'
|
28
29
|
spec.add_development_dependency 'rspec', '~> 3.7'
|
29
|
-
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
spec.add_dependency 'openstudio-extension', '~> 0.2.3'
|
30
|
+
spec.add_runtime_dependency 'json-schema', '~> 2.8'
|
31
|
+
spec.add_runtime_dependency 'json_pure', '~> 2.3'
|
32
|
+
spec.add_runtime_dependency 'openstudio-extension', '~> 0.3.1'
|
33
33
|
end
|
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.1
|
4
|
+
version: 0.3.1
|
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-
|
12
|
+
date: 2020-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -57,44 +57,44 @@ dependencies:
|
|
57
57
|
name: json-schema
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '2.8'
|
63
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: '
|
69
|
+
version: '2.8'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: json_pure
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '2.3'
|
77
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: '
|
83
|
+
version: '2.3'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: openstudio-extension
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
90
|
+
version: 0.3.1
|
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.3.1
|
98
98
|
description: Library include scenario default reporting measure and scenario defaults
|
99
99
|
reports schema and classes
|
100
100
|
email:
|
@@ -103,20 +103,41 @@ executables: []
|
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files: []
|
105
105
|
files:
|
106
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
107
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
108
|
+
- ".github/pull_request_template.md"
|
106
109
|
- ".gitignore"
|
110
|
+
- ".rdoc_options"
|
107
111
|
- ".rubocop.yml"
|
108
112
|
- CHANGELOG.md
|
109
113
|
- CONTRIBUTING.md
|
110
114
|
- Gemfile
|
111
115
|
- Jenkinsfile
|
112
116
|
- LICENSE.md
|
117
|
+
- RDOC_MAIN.md
|
113
118
|
- README.md
|
114
119
|
- Rakefile
|
120
|
+
- deploy_docs.sh
|
115
121
|
- doc_templates/LICENSE.md
|
116
122
|
- doc_templates/README.md.erb
|
117
123
|
- doc_templates/copyright_erb.txt
|
118
124
|
- doc_templates/copyright_js.txt
|
119
125
|
- doc_templates/copyright_ruby.txt
|
126
|
+
- docs/.gitignore
|
127
|
+
- docs/.vuepress/components/InnerJsonSchema.vue
|
128
|
+
- docs/.vuepress/components/JsonSchema.vue
|
129
|
+
- docs/.vuepress/components/ScenarioSchema.vue
|
130
|
+
- docs/.vuepress/components/StaticLink.vue
|
131
|
+
- docs/.vuepress/config.js
|
132
|
+
- docs/.vuepress/highlight.js
|
133
|
+
- docs/.vuepress/json-schema-deref-loader.js
|
134
|
+
- docs/.vuepress/public/custom_rdoc_styles.css
|
135
|
+
- docs/.vuepress/styles/palette.styl
|
136
|
+
- docs/.vuepress/utils.js
|
137
|
+
- docs/README.md
|
138
|
+
- docs/package-lock.json
|
139
|
+
- docs/package.json
|
140
|
+
- docs/schemas/scenario-schema.md
|
120
141
|
- lib/measures/.rubocop.yml
|
121
142
|
- lib/measures/default_feature_reports/LICENSE.md
|
122
143
|
- lib/measures/default_feature_reports/README.md
|
@@ -144,6 +165,7 @@ files:
|
|
144
165
|
- lib/urbanopt/reporting/default_reports/schema/scenario_schema.json
|
145
166
|
- lib/urbanopt/reporting/default_reports/solar_pv.rb
|
146
167
|
- lib/urbanopt/reporting/default_reports/storage.rb
|
168
|
+
- lib/urbanopt/reporting/default_reports/thermal_storage.rb
|
147
169
|
- lib/urbanopt/reporting/default_reports/timeseries_csv.rb
|
148
170
|
- lib/urbanopt/reporting/default_reports/validator.rb
|
149
171
|
- lib/urbanopt/reporting/default_reports/wind.rb
|
@@ -151,7 +173,8 @@ files:
|
|
151
173
|
- lib/urbanopt/reporting/version.rb
|
152
174
|
- urbanopt-reporting-gem.gemspec
|
153
175
|
homepage: https://github.com/urbanopt
|
154
|
-
licenses:
|
176
|
+
licenses:
|
177
|
+
- Nonstandard
|
155
178
|
metadata: {}
|
156
179
|
post_install_message:
|
157
180
|
rdoc_options: []
|
@@ -168,8 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
191
|
- !ruby/object:Gem::Version
|
169
192
|
version: '0'
|
170
193
|
requirements: []
|
171
|
-
|
172
|
-
rubygems_version: 2.7.6
|
194
|
+
rubygems_version: 3.1.4
|
173
195
|
signing_key:
|
174
196
|
specification_version: 4
|
175
197
|
summary: Library to report URBANopt results
|