urbanopt-reporting 0.2.0 → 0.3.3

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +19 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +15 -0
  4. data/.github/pull_request_template.md +13 -0
  5. data/.rdoc_options +36 -0
  6. data/CHANGELOG.md +43 -1
  7. data/LICENSE.md +1 -1
  8. data/RDOC_MAIN.md +10 -0
  9. data/deploy_docs.sh +5 -0
  10. data/doc_templates/LICENSE.md +1 -1
  11. data/doc_templates/copyright_erb.txt +1 -1
  12. data/doc_templates/copyright_js.txt +1 -1
  13. data/doc_templates/copyright_ruby.txt +1 -1
  14. data/docs/.gitignore +3 -0
  15. data/docs/.vuepress/components/InnerJsonSchema.vue +76 -0
  16. data/docs/.vuepress/components/JsonSchema.vue +12 -0
  17. data/docs/.vuepress/components/ScenarioSchema.vue +12 -0
  18. data/docs/.vuepress/components/StaticLink.vue +8 -0
  19. data/docs/.vuepress/config.js +25 -0
  20. data/docs/.vuepress/highlight.js +8 -0
  21. data/docs/.vuepress/json-schema-deref-loader.js +22 -0
  22. data/docs/.vuepress/public/custom_rdoc_styles.css +78 -0
  23. data/docs/.vuepress/styles/palette.styl +1 -0
  24. data/docs/.vuepress/utils.js +17 -0
  25. data/docs/README.md +9 -0
  26. data/docs/package-lock.json +10018 -0
  27. data/docs/package.json +30 -0
  28. data/docs/schemas/scenario-schema.md +3 -0
  29. data/lib/measures/default_feature_reports/LICENSE.md +1 -1
  30. data/lib/measures/default_feature_reports/measure.rb +231 -87
  31. data/lib/measures/default_feature_reports/measure.xml +11 -11
  32. data/lib/measures/export_modelica_loads/LICENSE.md +27 -0
  33. data/lib/measures/export_modelica_loads/README.md +26 -0
  34. data/lib/measures/export_modelica_loads/README.md.erb +42 -0
  35. data/lib/measures/export_modelica_loads/docs/.gitkeep +0 -0
  36. data/lib/measures/export_modelica_loads/measure.rb +367 -0
  37. data/lib/measures/export_modelica_loads/measure.xml +92 -0
  38. data/lib/measures/export_modelica_loads/resources/report.html.in +13 -0
  39. data/lib/measures/export_time_series_modelica/LICENSE.md +1 -0
  40. data/lib/measures/export_time_series_modelica/README.md +59 -0
  41. data/lib/measures/export_time_series_modelica/README.md.erb +42 -0
  42. data/lib/measures/export_time_series_modelica/docs/.gitkeep +0 -0
  43. data/lib/measures/export_time_series_modelica/measure.rb +433 -0
  44. data/lib/measures/export_time_series_modelica/measure.xml +147 -0
  45. data/lib/measures/export_time_series_modelica/resources/os_lib_helper_methods.rb +399 -0
  46. data/lib/measures/export_time_series_modelica/resources/report.html.in +13 -0
  47. data/lib/urbanopt/reporting/default_reports/end_uses.rb +52 -38
  48. data/lib/urbanopt/reporting/default_reports/feature_report.rb +79 -8
  49. data/lib/urbanopt/reporting/default_reports/location.rb +11 -11
  50. data/lib/urbanopt/reporting/default_reports/program.rb +86 -86
  51. data/lib/urbanopt/reporting/default_reports/reporting_period.rb +98 -78
  52. data/lib/urbanopt/reporting/default_reports/scenario_report.rb +7 -4
  53. data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +15 -0
  54. data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +108 -80
  55. data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +10 -10
  56. data/lib/urbanopt/reporting/version.rb +1 -1
  57. data/urbanopt-reporting-gem.gemspec +4 -4
  58. metadata +50 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53410c5daefdd7322955c0b119ada5893529245e998f1ec0ffbbf64f334b84b9
4
- data.tar.gz: 42f2b15c5066b90a5cf918feb952d5600c85fc1e94a26e7e80568dc6202f1dd4
3
+ metadata.gz: e65d30b14cf3916be1251dd1092dd74f222e737a0c9d6e6278123f4c6101b503
4
+ data.tar.gz: 4fa5c62490c7dcc883c5308f8f31547090f1eef01914b0e3e54093e218f09bf9
5
5
  SHA512:
6
- metadata.gz: 629ffff759847e872d0f001bba37a21482576a22c9e700aa2f735c5432caa9325be56ae2bd060e4c65c275e963f8ceed377174c028679b661378ca57756829dd
7
- data.tar.gz: ed478479d7c6c099be7249f3e38153e56542e6231e903ca64fe44f45a2bb1b845323c76949828802b57a3b2b05ea86d7010532dd2c0eb70479613944a7e7a161
6
+ metadata.gz: 0e0fdd09a89d58be74b9506fc9904253b0121f0d117041799baa500f3a0b1ab07f907609e0495486943751203c1f8683cc564ffcb038cb944721e1751e79c6f3
7
+ data.tar.gz: 067ab1a1d6506c22933a1e4e9e09dac96ecc925e4d3d931bfc51bd6853faf99e658c4b578f6689d9e34cc5ff5533c77dab1d8533ccef1384963ad7a85ac627e1
@@ -0,0 +1,19 @@
1
+ ### Expected behavior
2
+
3
+ _A clear and concise description of what you expected to happen._
4
+
5
+ ### Actual behavior
6
+
7
+ _A clear and concise description of what actually happens._
8
+
9
+ ### To Reproduce
10
+
11
+ Steps to reproduce the behavior:
12
+
13
+ 1. Go to '...'
14
+ 1. Enter '...'
15
+ 1. Enter '...'
16
+
17
+ ### Additional context
18
+
19
+ _E.g.: Windows, Mac, Linux? Are you behind a firewall? Do you have additional security constraints?_
@@ -0,0 +1,15 @@
1
+ ### Is your feature request related to a problem?
2
+
3
+ A clear and concise description of what the problem is. _I'm frustrated when..._
4
+
5
+ ### Describe the solution you'd like
6
+
7
+ A clear and concise description of what you want to happen.
8
+
9
+ ### Describe alternatives you've considered
10
+
11
+ A clear and concise description of any alternative solutions or features you've considered.
12
+
13
+ ### Additional context
14
+
15
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,13 @@
1
+ ### Resolves #[issue number here]
2
+
3
+ ### Pull Request Description
4
+
5
+ [description here]
6
+
7
+ ### Checklist (Delete lines that don't apply)
8
+
9
+ - [ ] Unit tests have been added or updated
10
+ - [ ] Documentation has been modified appropriately
11
+ - [ ] All ci tests pass (green)
12
+ - [ ] An [ISSUE](https://github.com/urbanopt/urbanopt-reporting-gem/issues) has been created that this is addressing. Issues will get added to the Change Log when the change_log.rb script is run.
13
+ - [ ] This branch is up-to-date with develop
@@ -0,0 +1,36 @@
1
+ --- !ruby/object:RDoc::Options
2
+ encoding: UTF-8
3
+ static_path: []
4
+ rdoc_include:
5
+ - lib
6
+ charset: UTF-8
7
+ exclude:
8
+ - doc_templates
9
+ - docs
10
+ - lib/measures
11
+ - node_modules
12
+ - spec
13
+ - test
14
+ - Gemfile
15
+ - Gemfile.lock
16
+ - Jenkinsfile
17
+ - LICENSE.md
18
+ - README.md
19
+ - Rakefile
20
+ - urbanopt-reporting-gem.gemspec
21
+ - JSON
22
+ - Object
23
+ hyperlink_all: false
24
+ line_numbers: false
25
+ locale:
26
+ locale_dir: locale
27
+ locale_name:
28
+ main_page: RDOC_MAIN.md
29
+ output_decoration: true
30
+ op_dir: ./docs/.vuepress/public/rdoc
31
+ show_hash: false
32
+ tab_width: 8
33
+ template_stylesheets: ["./docs/.vuepress/public/custom_rdoc_styles.css"]
34
+ title:
35
+ visibility: :protected
36
+ webcvs:
@@ -1,5 +1,47 @@
1
1
  # URBANopt Reporting Gem
2
2
 
3
+ ## Version 0.3.3
4
+
5
+ Date Range: 12/09/20 - 01/13/21
6
+
7
+ - Fixed [#36]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/36 ), Add reporting measure for district heating/cooling system mass flow rates
8
+ - Fixed [#37]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/37 ), Add EUI to default report
9
+ - Fixed [#38]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/38 ), Add better error handling around convert_units
10
+ - Fixed [#43]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/43 ), Add available_roof_area calculation
11
+ - Fixed [#44]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/44 ), Fix coordinates order
12
+
13
+ ## Version 0.3.2
14
+
15
+ Date Range: 12/07/20 - 12/08/20
16
+
17
+ - Fixed [#27]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/27 ), reporting measure fails when there are no additional fuels in the model
18
+ - Fixed [#29]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/29 ), restore save_feature_report function for backward compatibility
19
+ - Fixed [#32]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/32 ), bump extension-gem dependency
20
+
21
+ ## Version 0.3.1
22
+
23
+ Date Range: 11/26/2020 - 12/07/2020
24
+
25
+ - Fixed [#19]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/19 ), check for nil values to avoid crashing unit conversion
26
+ - Fixed [#24]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/24 ), Support reporting of other fuels
27
+ - Fixed [#28]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/28 ), fix for other_fuels being nil and restore save_feature_report function
28
+
29
+ ## Version 0.3.0
30
+
31
+ Date Range: 11/12/2020 - 11/25/2020
32
+
33
+ - Updating dependencies to support OpenStudio 3.1.0
34
+
35
+ ## Version 0.2.1
36
+
37
+ Date Range: 09/22/2020 - 11/12/2020
38
+
39
+ - Fixed [#12]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/12 ), add units to the json report attributes
40
+ - Fixed [#14]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/14 ), Add rdocs
41
+ - Fixed [#16]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/16 ), increase sidebar width to show class names
42
+ - Fixed [#18]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/18 ), measure: Handle nil values that crash OpenStudio.convert
43
+ - Fixed [#20]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/20 ), fixed saving csv results bug
44
+
3
45
  ## Version 0.2.0
4
46
 
5
47
  Date Range: 08/27/2020 - 09/21/2020
@@ -19,4 +61,4 @@ Date Range: 08/27/2020 - 09/21/2020
19
61
 
20
62
  08/17/2020
21
63
 
22
- Initial release of the urbanopt-reporting gem.
64
+ Initial release of the urbanopt-reporting gem.
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- URBANopt<sup>&trade;</sup>, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
1
+ URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
2
  contributors. All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -0,0 +1,10 @@
1
+ # URBANopt Reporting Gem
2
+
3
+ ### [back to main docs](../)
4
+
5
+ The URBANopt&trade; Reporting Gem defines the URBANopt Scenario report and Feature reports. It also includes the default reporting measure which queries the simulation results from the energyplus sql database and inserts them into the Feature reports.
6
+
7
+ The [schema](https://urbanopt.github.io/urbanopt-reporting-gem/schemas/scenario-schema.html) link contains more information about the JSON schema for Scenario and Feature reports.
8
+
9
+ [RDoc Documentation](https://urbanopt.github.io/urbanopt-reporting-gem/)
10
+
@@ -0,0 +1,5 @@
1
+ set -e
2
+ bundle exec rdoc --template-stylesheets ./docs/.vuepress/public/custom_rdoc_styles.css
3
+ npm run build --prefix docs
4
+ #npm run dev --prefix docs
5
+ npm run deploy --prefix docs
@@ -1,4 +1,4 @@
1
- URBANopt™, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
1
+ URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
2
  contributors. All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  # *********************************************************************************
3
- # URBANopt™, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
3
+ # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
4
4
  # contributors. All rights reserved.
5
5
  #
6
6
  # Redistribution and use in source and binary forms, with or without modification,
@@ -1,4 +1,4 @@
1
1
  /* @preserve
2
- * URBANopt™, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
2
+ * URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
3
3
  * Use of this source code is governed by the BSD 3-Clause license.
4
4
  */
@@ -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,
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ .vuepress/public/rdoc/
3
+ .vuepress/dist/
@@ -0,0 +1,76 @@
1
+ <template>
2
+ <div>
3
+ <a v-if="rawMode" @click="rawMode = false">view pretty</a>
4
+ <a v-if="!rawMode" @click="rawMode = true">view raw</a>
5
+ <div v-show="!rawMode" ref="schemaTarget" class="schema-pretty"/>
6
+ <pre v-show="rawMode"><code v-html="schemaFormatted" class="json"/></pre>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ import "json-schema-view-js/dist/style.css";
11
+ import "highlight.js/styles/railscasts.css";
12
+ import highlightJson from "../highlight";
13
+ import { emptyPromise } from '../utils';
14
+
15
+ const JSONSchemaViewP = emptyPromise();
16
+
17
+ export default {
18
+ name: "InnerJsonSchema",
19
+ props: ["schema"],
20
+ data() {
21
+ return {
22
+ rawMode: false,
23
+ };
24
+ },
25
+ created() {
26
+ // created only runs on the client, which is good because
27
+ // this module causes an error if we load it in a server context
28
+ import("json-schema-view-js").then(JSONSchemaViewP.resolve);
29
+ },
30
+ computed: {
31
+ view() {
32
+ return JSONSchemaViewP
33
+ .then( () => new window.JSONSchemaView(this.schema, 2, {
34
+ theme: "dark"
35
+ }));
36
+ },
37
+ schemaFormatted() {
38
+ return highlightJson(JSON.stringify(this.schema, null, 2));
39
+ }
40
+ },
41
+ methods: {
42
+ async replaceRenderedSchema() {
43
+ const v = await this.view; // this never resolves on the server
44
+ this.$refs.schemaTarget.innerHtml = "";
45
+ this.$refs.schemaTarget.appendChild(v.render());
46
+ }
47
+ },
48
+ watch: {
49
+ schema: {
50
+ handler: "replaceRenderedSchema",
51
+ immediate: true
52
+ }
53
+ }
54
+ };
55
+ </script>
56
+ <style>
57
+ .schema-pretty {
58
+ margin-top: 0.85rem;
59
+ background-color: #282c34;
60
+ padding: 1.25rem 1.5rem;
61
+ border-radius: 6px;
62
+ }
63
+ .json-formatter-row a {
64
+ color: white;
65
+ }
66
+ .json-formatter-row .json-formatter-bracket,
67
+ .json-formatter-row .json-formatter-number {
68
+ color: #9090fb;
69
+ }
70
+ .json-formatter-row .json-formatter-key {
71
+ color: #8665d0;
72
+ }
73
+ .json-schema-view .object .inner.oneOf b {
74
+ color: aqua;
75
+ }
76
+ </style>
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <ClientOnly>
3
+ <InnerJsonSchema :schema="schema" />
4
+ </ClientOnly>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'JsonSchema',
10
+ props: ['schema'],
11
+ }
12
+ </script>
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <JsonSchema :schema="schema"/>
3
+ </template>
4
+ <script>
5
+ import { default as schema } from "../../../lib/urbanopt/reporting/default_reports/schema/scenario_schema.json";
6
+ export default {
7
+ name: "ScenarioSchema",
8
+ data() {
9
+ return { schema };
10
+ }
11
+ };
12
+ </script>
@@ -0,0 +1,8 @@
1
+ <script>
2
+ export default {
3
+ name: "StaticLink",
4
+ render(h) {
5
+ return h("a", { domProps: this.props }, this.$slots.default);
6
+ }
7
+ };
8
+ </script>
@@ -0,0 +1,25 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ base: '/urbanopt-reporting-gem/',
5
+ themeConfig: {
6
+ navbar: false,
7
+ sidebar: [
8
+ "/",
9
+ {
10
+ title: "Schemas",
11
+ children: [
12
+ "/schemas/scenario-schema.md"
13
+ ]
14
+ }
15
+ ]
16
+ },
17
+ chainWebpack: config => {
18
+ config.module
19
+ .rule('json')
20
+ .test(/\.json$/)
21
+ .use(path.join(__dirname, 'json-schema-deref-loader.js'))
22
+ .loader(path.join(__dirname, 'json-schema-deref-loader.js'))
23
+ .end()
24
+ },
25
+ };
@@ -0,0 +1,8 @@
1
+ import hljs from "highlight.js";
2
+ import json from "highlight.js/lib/languages/json";
3
+
4
+ hljs.registerLanguage("json", json);
5
+
6
+ export default function(code) {
7
+ return hljs.highlight("json", code, true).value;
8
+ }
@@ -0,0 +1,22 @@
1
+ // thanks to https://gist.github.com/mgesmundo/07d6ea3958ed4c7d19d1161551fa46ca
2
+ const $RefParser = require('@apidevtools/json-schema-ref-parser')
3
+
4
+ module.exports = async function () {
5
+ const parser = new $RefParser()
6
+ const schema = await parser.dereference(this.resourcePath, {
7
+ dereference: {
8
+ circular: false
9
+ }
10
+ })
11
+ const resolve = await parser.resolve(this.resourcePath, {
12
+ dereference: {
13
+ circular: false
14
+ }
15
+ })
16
+
17
+ for (const dep in resolve._$refs) {
18
+ this.addDependency(dep)
19
+ }
20
+
21
+ return JSON.stringify(schema)
22
+ }
@@ -0,0 +1,78 @@
1
+ :link, :visited {
2
+ color: #3eaf7c;
3
+ }
4
+ :link:hover {
5
+ border-bottom: 1px solid #3eaf7c;
6
+ }
7
+ body {
8
+ background-color: #fff;
9
+ font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif !important;
10
+ }
11
+
12
+ main h1, main h2, main h3, main h4, main h5, main h6 {
13
+ font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;
14
+ }
15
+ h1, h2, h3, h4, h5, h6 {
16
+ font-weight: 600;
17
+ line-height: 1.25;
18
+ }
19
+ main h1 {
20
+ margin-top: 1.5rem !important;
21
+ margin-bottom: 1rem;
22
+ font-size: 2.2rem;
23
+ }
24
+
25
+ #home-section, #search-section, #fileindex-section {
26
+ display: none !important;
27
+ }
28
+
29
+ nav {
30
+ width: 450px;
31
+ }
32
+ .nav-section h3 {
33
+ color: #999;
34
+ font-size: 1.1em;
35
+ font-weight: 700;
36
+ background-color: #fff;
37
+ text-align: left;
38
+ }
39
+ nav .nav-section {
40
+ border-top: none;
41
+ font-size: unset;
42
+ }
43
+
44
+ .link-list a {
45
+ display: inline-block;
46
+ padding: .35rem 1rem .35rem 2rem;
47
+ font-weight: 400;
48
+ color: #2c3e50;
49
+ border-left: .25rem solid transparent;
50
+ padding: .35rem 1rem .35rem 1.25rem;
51
+ line-height: 1.4;
52
+ width: 100%;
53
+ box-sizing: border-box;
54
+ }
55
+ .link-list a:hover, .link-list :link:hover {
56
+ color: #3eaf7c;
57
+ border-bottom: none;
58
+ }
59
+
60
+ /* Hide the URBANopt::Scenario:: prefix common to most links */
61
+ ul.link-list li {
62
+ margin: .35rem 1rem .35rem 1.25rem;
63
+ overflow: hidden;
64
+ }
65
+ .link-list a[href^="./URBANopt/Scenario/"] {
66
+ margin-left: -145px;
67
+ }
68
+ .link-list a {
69
+ padding: 0;
70
+ margin: -4px;
71
+ }
72
+
73
+ /* Remove some modules that aren't commented */
74
+ .link-list a[href="./URBANopt.html"],
75
+ .link-list a[href="./URBANopt/Scenario.html"],
76
+ .link-list a[href="./URBANopt/Scenario/DefaultReports.html"] {
77
+ display: none;
78
+ }