urbanopt-scenario 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/nightly_build.yml +40 -0
- data/CHANGELOG.md +10 -3
- data/Gemfile +1 -1
- data/README.md +5 -3
- data/docs/package-lock.json +29 -47
- data/lib/urbanopt/scenario/scenario_post_processor_disco.rb +159 -0
- data/lib/urbanopt/scenario/scenario_post_processor_opendss.rb +2 -0
- data/lib/urbanopt/scenario/scenario_visualization.rb +23 -6
- data/lib/urbanopt/scenario/version.rb +1 -1
- data/lib/urbanopt/scenario.rb +1 -0
- data/urbanopt-scenario-gem.gemspec +4 -11
- metadata +36 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 045ec14ad4bee6bc8f6f4e98752283e6e05984eb2065a1d010e34e4a65f2bdd8
|
4
|
+
data.tar.gz: cc078b87253bc6e07f1a250294b733502f076af6fe82abfa703c5330da421b08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26ad4b20871547310a4b5114c73563f69e2df92270dea95e0a340151e29580e09254ae91992c32790a1bf7fb1dd794ecf4b92d6a19972eb3e48bd00388c1b1f5
|
7
|
+
data.tar.gz: 03c29f502d554e30d0e8158aa95c7ba8081ae839f825797a90c3c8b057318c8f15c12044bc63f2610682d55b58200d4b5bfacd72e0b8a97b8b583a48e27355a4
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
name: nightly_build
|
3
|
+
|
4
|
+
on:
|
5
|
+
# push:
|
6
|
+
schedule:
|
7
|
+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
|
8
|
+
# 5 am UTC (11pm MDT the day before) every weekday night in MDT
|
9
|
+
- cron: '21 5 * * 2-6'
|
10
|
+
|
11
|
+
# Cancels an existing job (of the same workflow) if it is still running
|
12
|
+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
|
13
|
+
# concurrency:
|
14
|
+
# group: ${{ github.workflow }}-${{ github.ref }}
|
15
|
+
# cancel-in-progress: true
|
16
|
+
|
17
|
+
env:
|
18
|
+
# This env var should enforce develop branch of all dependencies
|
19
|
+
FAVOR_LOCAL_GEMS: true
|
20
|
+
GEM_DEVELOPER_KEY: ${{ secrets.GEM_DEVELOPER_KEY }}
|
21
|
+
|
22
|
+
jobs:
|
23
|
+
weeknight-tests:
|
24
|
+
# Pinned to `ubuntu-20.04`. When ubuntu-latest adopts 22.04 it would break for us since 22 only supports Ruby 3.1
|
25
|
+
# https://github.com/ruby/setup-ruby#supported-platforms
|
26
|
+
runs-on: ubuntu-20.04
|
27
|
+
container:
|
28
|
+
image: docker://nrel/openstudio:3.4.0
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v3
|
31
|
+
- name: Update gems
|
32
|
+
run: bundle update
|
33
|
+
- name: Run Rspec
|
34
|
+
run: bundle exec rspec
|
35
|
+
# coveralls action docs: https://github.com/marketplace/actions/coveralls-github-action
|
36
|
+
- name: Coveralls
|
37
|
+
uses: coverallsapp/github-action@master
|
38
|
+
with:
|
39
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
40
|
+
path-to-lcov: "./coverage/lcov/urbanopt-scenario-gem.lcov"
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
# URBANopt Scenario Gem
|
2
2
|
|
3
|
+
## Version 0.9.0
|
4
|
+
|
5
|
+
Date Range: 05/11/22 - 12/05/22
|
6
|
+
|
7
|
+
- Update dependencies for OpenStudio 3.5.0
|
8
|
+
- Fixed [#246]( https://github.com/urbanopt/urbanopt-scenario-gem/issues/246 ), Code coverage reporting
|
9
|
+
- Fixed [#250]( https://github.com/urbanopt/urbanopt-scenario-gem/issues/250 ), Add reports for DISCO results
|
10
|
+
- Fixed [#252]( https://github.com/urbanopt/urbanopt-scenario-gem/issues/252 ), Process QAQC flags into visualization js files
|
11
|
+
|
3
12
|
## Version 0.8.0
|
4
13
|
|
5
14
|
Date Range: 11/23/21 - 05/10/22
|
6
15
|
|
7
|
-
- Fixed [#223]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/223 ), updates for OpenStudio 3.3
|
8
|
-
- Fixed [#224]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/224 ), Os 3.3
|
9
16
|
- Fixed [#225]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/225 ), fix dependencies
|
10
17
|
- Fixed [#226]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/226 ), Bump node-forge from 0.10.0 to 1.0.0 in /docs
|
11
18
|
- Fixed [#228]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/228 ), expanding opendss reporting
|
@@ -187,4 +194,4 @@ Accepted Pull Requests:
|
|
187
194
|
- Fixed [#62]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/62 ), Update issue templates
|
188
195
|
- Fixed [#64]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/64 ), update dependency versions for security
|
189
196
|
|
190
|
-
## Version 0.1.0
|
197
|
+
## Version 0.1.0
|
data/Gemfile
CHANGED
@@ -41,7 +41,7 @@ allow_local = ENV['FAVOR_LOCAL_GEMS']
|
|
41
41
|
# if allow_local && File.exist?('../urbanopt-reporting-gem')
|
42
42
|
# gem 'urbanopt-reporting', path: '../urbanopt-reporting-gem'
|
43
43
|
# elsif allow_local
|
44
|
-
#
|
44
|
+
# gem 'urbanopt-reporting', github: 'URBANopt/urbanopt-reporting-gem', branch: 'develop'
|
45
45
|
# end
|
46
46
|
|
47
47
|
# if allow_local && File.exist?('../openstudio-load-flexibility-measures-gem')
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
# URBANopt Scenario Gem
|
1
|
+
# URBANopt Scenario Gem
|
2
|
+
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/github/urbanopt/urbanopt-scenario-gem/badge.svg?branch=develop)](https://coveralls.io/github/urbanopt/urbanopt-scenario-gem?branch=develop)
|
2
4
|
|
3
5
|
The URBANopt™ Scenario Gem includes functionality for defining scenarios, running simulations, and post-processing results. User defined SimulationMapper classes translate each Feature to a SimulationDir which is a directory containing simulation input files. The ScenarioRunner is used to perform simulations for each SimulationDir. Finally, a ScenarioPostProcessor can run on a Scenario to generate scenario level results.
|
4
6
|
|
@@ -26,9 +28,9 @@ Or install it yourself as:
|
|
26
28
|
Check out the repository and then execute:
|
27
29
|
|
28
30
|
$ bundle install
|
29
|
-
$ bundle update
|
31
|
+
$ bundle update
|
30
32
|
$ bundle exec rake
|
31
|
-
|
33
|
+
|
32
34
|
## Releasing
|
33
35
|
|
34
36
|
* Update CHANGELOG.md
|
data/docs/package-lock.json
CHANGED
@@ -6613,13 +6613,10 @@
|
|
6613
6613
|
}
|
6614
6614
|
},
|
6615
6615
|
"node_modules/eventsource": {
|
6616
|
-
"version": "1.1.
|
6617
|
-
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.
|
6618
|
-
"integrity": "sha512-
|
6616
|
+
"version": "1.1.2",
|
6617
|
+
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.2.tgz",
|
6618
|
+
"integrity": "sha512-xAH3zWhgO2/3KIniEKYPr8plNSzlGINOUqYj0m0u7AB81iRw8b/3E73W6AuU+6klLbaSFmZnaETQ2lXPfAydrA==",
|
6619
6619
|
"dev": true,
|
6620
|
-
"dependencies": {
|
6621
|
-
"original": "^1.0.0"
|
6622
|
-
},
|
6623
6620
|
"engines": {
|
6624
6621
|
"node": ">=0.12.0"
|
6625
6622
|
}
|
@@ -7536,7 +7533,7 @@
|
|
7536
7533
|
"node_modules/glob-parent": {
|
7537
7534
|
"version": "3.1.0",
|
7538
7535
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
|
7539
|
-
"integrity": "
|
7536
|
+
"integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==",
|
7540
7537
|
"dev": true,
|
7541
7538
|
"dependencies": {
|
7542
7539
|
"is-glob": "^3.1.0",
|
@@ -9799,9 +9796,9 @@
|
|
9799
9796
|
"dev": true
|
9800
9797
|
},
|
9801
9798
|
"node_modules/minimatch": {
|
9802
|
-
"version": "3.
|
9803
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.
|
9804
|
-
"integrity": "sha512-
|
9799
|
+
"version": "3.1.2",
|
9800
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
9801
|
+
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
9805
9802
|
"dev": true,
|
9806
9803
|
"dependencies": {
|
9807
9804
|
"brace-expansion": "^1.1.7"
|
@@ -10407,15 +10404,6 @@
|
|
10407
10404
|
"webpack": "^4.0.0"
|
10408
10405
|
}
|
10409
10406
|
},
|
10410
|
-
"node_modules/original": {
|
10411
|
-
"version": "1.0.2",
|
10412
|
-
"resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz",
|
10413
|
-
"integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==",
|
10414
|
-
"dev": true,
|
10415
|
-
"dependencies": {
|
10416
|
-
"url-parse": "^1.4.3"
|
10417
|
-
}
|
10418
|
-
},
|
10419
10407
|
"node_modules/os-browserify": {
|
10420
10408
|
"version": "0.3.0",
|
10421
10409
|
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
|
@@ -14392,9 +14380,9 @@
|
|
14392
14380
|
}
|
14393
14381
|
},
|
14394
14382
|
"node_modules/terser": {
|
14395
|
-
"version": "4.8.
|
14396
|
-
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.
|
14397
|
-
"integrity": "sha512-
|
14383
|
+
"version": "4.8.1",
|
14384
|
+
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz",
|
14385
|
+
"integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==",
|
14398
14386
|
"dev": true,
|
14399
14387
|
"dependencies": {
|
14400
14388
|
"commander": "^2.20.0",
|
@@ -15642,7 +15630,10 @@
|
|
15642
15630
|
"node_modules/watchpack/chokidar2": {
|
15643
15631
|
"version": "0.0.1",
|
15644
15632
|
"dev": true,
|
15645
|
-
"optional": true
|
15633
|
+
"optional": true,
|
15634
|
+
"dependencies": {
|
15635
|
+
"chokidar": "^2.1.8"
|
15636
|
+
}
|
15646
15637
|
},
|
15647
15638
|
"node_modules/watchpack/node_modules/binary-extensions": {
|
15648
15639
|
"version": "2.2.0",
|
@@ -19670,7 +19661,10 @@
|
|
19670
19661
|
}
|
19671
19662
|
},
|
19672
19663
|
"chokidar2": {
|
19673
|
-
"version": "file:node_modules/watchpack/chokidar2"
|
19664
|
+
"version": "file:node_modules/watchpack/chokidar2",
|
19665
|
+
"requires": {
|
19666
|
+
"chokidar": "^2.1.8"
|
19667
|
+
}
|
19674
19668
|
},
|
19675
19669
|
"chownr": {
|
19676
19670
|
"version": "1.1.4",
|
@@ -21510,13 +21504,10 @@
|
|
21510
21504
|
"dev": true
|
21511
21505
|
},
|
21512
21506
|
"eventsource": {
|
21513
|
-
"version": "1.1.
|
21514
|
-
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.
|
21515
|
-
"integrity": "sha512-
|
21516
|
-
"dev": true
|
21517
|
-
"requires": {
|
21518
|
-
"original": "^1.0.0"
|
21519
|
-
}
|
21507
|
+
"version": "1.1.2",
|
21508
|
+
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.2.tgz",
|
21509
|
+
"integrity": "sha512-xAH3zWhgO2/3KIniEKYPr8plNSzlGINOUqYj0m0u7AB81iRw8b/3E73W6AuU+6klLbaSFmZnaETQ2lXPfAydrA==",
|
21510
|
+
"dev": true
|
21520
21511
|
},
|
21521
21512
|
"evp_bytestokey": {
|
21522
21513
|
"version": "1.0.3",
|
@@ -22237,7 +22228,7 @@
|
|
22237
22228
|
"glob-parent": {
|
22238
22229
|
"version": "3.1.0",
|
22239
22230
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
|
22240
|
-
"integrity": "
|
22231
|
+
"integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==",
|
22241
22232
|
"dev": true,
|
22242
22233
|
"requires": {
|
22243
22234
|
"is-glob": "^3.1.0",
|
@@ -24019,9 +24010,9 @@
|
|
24019
24010
|
"dev": true
|
24020
24011
|
},
|
24021
24012
|
"minimatch": {
|
24022
|
-
"version": "3.
|
24023
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.
|
24024
|
-
"integrity": "sha512-
|
24013
|
+
"version": "3.1.2",
|
24014
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
24015
|
+
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
24025
24016
|
"dev": true,
|
24026
24017
|
"requires": {
|
24027
24018
|
"brace-expansion": "^1.1.7"
|
@@ -24503,15 +24494,6 @@
|
|
24503
24494
|
"last-call-webpack-plugin": "^3.0.0"
|
24504
24495
|
}
|
24505
24496
|
},
|
24506
|
-
"original": {
|
24507
|
-
"version": "1.0.2",
|
24508
|
-
"resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz",
|
24509
|
-
"integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==",
|
24510
|
-
"dev": true,
|
24511
|
-
"requires": {
|
24512
|
-
"url-parse": "^1.4.3"
|
24513
|
-
}
|
24514
|
-
},
|
24515
24497
|
"os-browserify": {
|
24516
24498
|
"version": "0.3.0",
|
24517
24499
|
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
|
@@ -27656,9 +27638,9 @@
|
|
27656
27638
|
"dev": true
|
27657
27639
|
},
|
27658
27640
|
"terser": {
|
27659
|
-
"version": "4.8.
|
27660
|
-
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.
|
27661
|
-
"integrity": "sha512-
|
27641
|
+
"version": "4.8.1",
|
27642
|
+
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz",
|
27643
|
+
"integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==",
|
27662
27644
|
"dev": true,
|
27663
27645
|
"requires": {
|
27664
27646
|
"commander": "^2.20.0",
|
@@ -0,0 +1,159 @@
|
|
1
|
+
# *********************************************************************************
|
2
|
+
# URBANopt™, Copyright (c) 2019-2022, 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
|
+
# Redistribution of this software, without modification, must refer to the software
|
20
|
+
# by the same designation. Redistribution of a modified version of this software
|
21
|
+
# (i) may not refer to the modified version by the same designation, or by any
|
22
|
+
# confusingly similar designation, and (ii) must refer to the underlying software
|
23
|
+
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
|
24
|
+
# the term “URBANopt”, or any confusingly similar designation may not be used to
|
25
|
+
# refer to any modified version of this software or any modified version of the
|
26
|
+
# underlying software originally provided by Alliance without the prior written
|
27
|
+
# consent of Alliance.
|
28
|
+
|
29
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
30
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
31
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
32
|
+
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
33
|
+
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
34
|
+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
35
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
36
|
+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
37
|
+
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
38
|
+
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
39
|
+
# *********************************************************************************
|
40
|
+
|
41
|
+
require 'urbanopt/reporting/default_reports'
|
42
|
+
|
43
|
+
require 'csv'
|
44
|
+
require 'json'
|
45
|
+
require 'fileutils'
|
46
|
+
|
47
|
+
module URBANopt
|
48
|
+
module Scenario
|
49
|
+
class DISCOPostProcessor
|
50
|
+
##
|
51
|
+
# DISCOPostProcessor post-processes DISCO results to selected DISCO results and
|
52
|
+
# integrate them in scenario and feature reports.
|
53
|
+
##
|
54
|
+
# [parameters:]
|
55
|
+
# * +scenaro_report+ - _ScenarioBase_ - An object of Scenario_report class.
|
56
|
+
# * +disco_results_dir_name+ - _directory name of disco results
|
57
|
+
def initialize(scenario_report, disco_results_dir_name = 'disco')
|
58
|
+
if !scenario_report.nil?
|
59
|
+
@scenario_report = scenario_report
|
60
|
+
@disco_results_dir = File.join(@scenario_report.directory_name, disco_results_dir_name)
|
61
|
+
else
|
62
|
+
raise 'scenario_report is not valid'
|
63
|
+
end
|
64
|
+
|
65
|
+
# initialize disco data
|
66
|
+
@disco_data = {}
|
67
|
+
|
68
|
+
# initialize disco json results
|
69
|
+
@disco_json_results = {}
|
70
|
+
|
71
|
+
# initialize logger
|
72
|
+
@@logger ||= URBANopt::Reporting::DefaultReports.logger
|
73
|
+
end
|
74
|
+
|
75
|
+
# load disco data (if exists)
|
76
|
+
def load_disco_data
|
77
|
+
|
78
|
+
# load disco upgrade summary
|
79
|
+
disco_json_filename = File.join(@disco_results_dir, 'upgrade_summary.json')
|
80
|
+
if File.exist?(disco_json_filename)
|
81
|
+
@disco_json_results = JSON.parse(File.read(disco_json_filename))
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
# load disco data
|
87
|
+
def load_data
|
88
|
+
# load selected disco data
|
89
|
+
load_disco_data
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
##
|
94
|
+
# save disco scenario fields
|
95
|
+
##
|
96
|
+
def save_disco_scenario
|
97
|
+
@scenario_report.scenario_power_distribution_cost = URBANopt::Reporting::DefaultReports::ScenarioPowerDistributionCost.new
|
98
|
+
|
99
|
+
# RESULTS
|
100
|
+
|
101
|
+
res = []
|
102
|
+
# read result from JSON report
|
103
|
+
res = @disco_json_results['results']
|
104
|
+
@scenario_report.scenario_power_distribution_cost.results = res
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
# OUTPUTS
|
109
|
+
|
110
|
+
out = {}
|
111
|
+
# read result from JSON report
|
112
|
+
out[:log_file] = @disco_json_results['outputs']['log_file']
|
113
|
+
out[:jobs] = []
|
114
|
+
@disco_json_results['outputs']['jobs'].each do |job|
|
115
|
+
out[:jobs] << job
|
116
|
+
end
|
117
|
+
@scenario_report.scenario_power_distribution_cost.outputs = out
|
118
|
+
|
119
|
+
# VIOLATION SUMMARY
|
120
|
+
|
121
|
+
vio = []
|
122
|
+
# read result from JSON report
|
123
|
+
vio = @disco_json_results['violation_summary']
|
124
|
+
@scenario_report.scenario_power_distribution_cost.violation_summary = vio
|
125
|
+
|
126
|
+
# COSTS PER EQUIPMENT
|
127
|
+
cos = []
|
128
|
+
# read result from JSON report
|
129
|
+
cos = @disco_json_results['costs_per_equipment']
|
130
|
+
@scenario_report.scenario_power_distribution_cost.costs_per_equipment = cos
|
131
|
+
|
132
|
+
# EQUIPMENT
|
133
|
+
equ = []
|
134
|
+
# read result from JSON report
|
135
|
+
equ = @disco_json_results['equipment']
|
136
|
+
@scenario_report.scenario_power_distribution_cost.equipment = equ
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# run disco post_processor
|
142
|
+
##
|
143
|
+
def run
|
144
|
+
|
145
|
+
# load data
|
146
|
+
load_data
|
147
|
+
|
148
|
+
# save additional global disco fields
|
149
|
+
save_disco_scenario
|
150
|
+
|
151
|
+
# save the updated scenario reports
|
152
|
+
# set save_feature_reports to false since only the scenario reports should be saved
|
153
|
+
# now, set save csv reports to false
|
154
|
+
@scenario_report.save(file_name = 'scenario_report_disco', save_feature_reports = false, save_csv_reports = false)
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
@@ -45,10 +45,11 @@ require 'json'
|
|
45
45
|
module URBANopt
|
46
46
|
module Scenario
|
47
47
|
class ResultVisualization
|
48
|
-
def self.create_visualization(
|
48
|
+
def self.create_visualization(default_report_list, feature = true, feature_names = false)
|
49
49
|
@all_results = []
|
50
50
|
name = nil
|
51
|
-
|
51
|
+
|
52
|
+
default_report_list.each do |folder|
|
52
53
|
# create visualization for scenarios
|
53
54
|
case feature
|
54
55
|
when false
|
@@ -57,11 +58,14 @@ module URBANopt
|
|
57
58
|
|
58
59
|
# create visualization for features
|
59
60
|
when true
|
60
|
-
index =
|
61
|
+
index = default_report_list.index(folder)
|
61
62
|
name = "#{folder.split('/')[-3]}-#{feature_names[index]}"
|
62
63
|
csv_dir = folder
|
63
64
|
end
|
64
65
|
|
66
|
+
# get JSON report
|
67
|
+
json_report = folder.gsub('.csv', '.json')
|
68
|
+
|
65
69
|
if File.exist?(csv_dir)
|
66
70
|
size = CSV.open(csv_dir).readlines.size
|
67
71
|
|
@@ -210,6 +214,7 @@ module URBANopt
|
|
210
214
|
results['name'] = name
|
211
215
|
results['monthly_values'] = {}
|
212
216
|
results['annual_values'] = {}
|
217
|
+
results['qaqc_flags'] = {}
|
213
218
|
|
214
219
|
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?
|
215
220
|
results['complete_simulation'] = false
|
@@ -230,6 +235,18 @@ module URBANopt
|
|
230
235
|
end
|
231
236
|
end
|
232
237
|
|
238
|
+
# QAQC flags by category (if present)
|
239
|
+
if File.exist?(json_report)
|
240
|
+
report_data = JSON.parse(File.read(json_report))
|
241
|
+
if feature == false
|
242
|
+
# adjust nesting for scenario report
|
243
|
+
report_data = report_data['scenario_report']
|
244
|
+
end
|
245
|
+
|
246
|
+
if report_data.key?('qaqc_flags')
|
247
|
+
results['qaqc_flags'] = report_data['qaqc_flags']
|
248
|
+
end
|
249
|
+
end
|
233
250
|
end
|
234
251
|
|
235
252
|
unless results.nil?
|
@@ -237,13 +254,13 @@ module URBANopt
|
|
237
254
|
end
|
238
255
|
end
|
239
256
|
|
240
|
-
# create
|
257
|
+
# create js file with required data stored in a variable
|
241
258
|
if feature == false
|
242
259
|
# In case of scenario visualization store result at top of the run folder
|
243
|
-
results_path = File.expand_path('../../scenarioData.js',
|
260
|
+
results_path = File.expand_path('../../scenarioData.js', default_report_list[0])
|
244
261
|
else
|
245
262
|
# In case of feature visualization store result at top of scenario folder folder
|
246
|
-
results_path = File.expand_path('../../../scenarioData.js',
|
263
|
+
results_path = File.expand_path('../../../scenarioData.js', default_report_list[0])
|
247
264
|
end
|
248
265
|
File.open(results_path, 'w') do |file|
|
249
266
|
file << "var scenarioData = #{JSON.pretty_generate(@all_results)};"
|
data/lib/urbanopt/scenario.rb
CHANGED
@@ -47,6 +47,7 @@ require 'urbanopt/scenario/scenario_csv'
|
|
47
47
|
require 'urbanopt/scenario/scenario_post_processor_base'
|
48
48
|
require 'urbanopt/scenario/scenario_post_processor_default'
|
49
49
|
require 'urbanopt/scenario/scenario_post_processor_opendss'
|
50
|
+
require 'urbanopt/scenario/scenario_post_processor_disco'
|
50
51
|
require 'urbanopt/scenario/scenario_runner_base'
|
51
52
|
require 'urbanopt/scenario/scenario_runner_osw'
|
52
53
|
require 'urbanopt/scenario/simulation_dir_base'
|
@@ -26,20 +26,13 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
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'
|
29
31
|
|
30
32
|
spec.add_runtime_dependency 'json_pure', '~> 2.3'
|
31
33
|
spec.add_runtime_dependency 'json-schema', '~> 2.8'
|
32
34
|
|
33
35
|
spec.add_runtime_dependency 'sqlite3', '1.4.2'
|
34
|
-
spec.add_runtime_dependency 'urbanopt-core', '~> 0.
|
35
|
-
spec.add_runtime_dependency 'urbanopt-reporting', '~> 0.
|
36
|
-
|
37
|
-
# no longer need the below
|
38
|
-
# need to include all measure gems listed in mappers in project gemfiles
|
39
|
-
# scenario_csv loads the mappers and need access to the extension gems when they are added to a mapper
|
40
|
-
# spec.add_runtime_dependency 'openstudio-calibration', '~> 0.3.1'
|
41
|
-
# spec.add_runtime_dependency 'openstudio-common-measures', '~> 0.3.2'
|
42
|
-
# spec.add_runtime_dependency 'openstudio-ee', '~> 0.3.2'
|
43
|
-
# spec.add_runtime_dependency 'openstudio-load-flexibility-measures', '~> 0.2.1'
|
44
|
-
# spec.add_runtime_dependency 'openstudio-model-articulation', '~> 0.3.1'
|
36
|
+
spec.add_runtime_dependency 'urbanopt-core', '~> 0.9.0'
|
37
|
+
spec.add_runtime_dependency 'urbanopt-reporting', '~> 0.7.0'
|
45
38
|
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.
|
4
|
+
version: 0.9.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: 2022-
|
12
|
+
date: 2022-12-13 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
|
@@ -101,28 +129,28 @@ dependencies:
|
|
101
129
|
requirements:
|
102
130
|
- - "~>"
|
103
131
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.
|
132
|
+
version: 0.9.0
|
105
133
|
type: :runtime
|
106
134
|
prerelease: false
|
107
135
|
version_requirements: !ruby/object:Gem::Requirement
|
108
136
|
requirements:
|
109
137
|
- - "~>"
|
110
138
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.
|
139
|
+
version: 0.9.0
|
112
140
|
- !ruby/object:Gem::Dependency
|
113
141
|
name: urbanopt-reporting
|
114
142
|
requirement: !ruby/object:Gem::Requirement
|
115
143
|
requirements:
|
116
144
|
- - "~>"
|
117
145
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.
|
146
|
+
version: 0.7.0
|
119
147
|
type: :runtime
|
120
148
|
prerelease: false
|
121
149
|
version_requirements: !ruby/object:Gem::Requirement
|
122
150
|
requirements:
|
123
151
|
- - "~>"
|
124
152
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
153
|
+
version: 0.7.0
|
126
154
|
description: Library to export data point OSW files from URBANopt Scenario CSV
|
127
155
|
email:
|
128
156
|
- rawad.elkontar@nrel.gov
|
@@ -133,6 +161,7 @@ files:
|
|
133
161
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
134
162
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
135
163
|
- ".github/pull_request_template.md"
|
164
|
+
- ".github/workflows/nightly_build.yml"
|
136
165
|
- ".gitignore"
|
137
166
|
- ".rdoc_options"
|
138
167
|
- ".rspec"
|
@@ -173,6 +202,7 @@ files:
|
|
173
202
|
- lib/urbanopt/scenario/scenario_datapoint_base.rb
|
174
203
|
- lib/urbanopt/scenario/scenario_post_processor_base.rb
|
175
204
|
- lib/urbanopt/scenario/scenario_post_processor_default.rb
|
205
|
+
- lib/urbanopt/scenario/scenario_post_processor_disco.rb
|
176
206
|
- lib/urbanopt/scenario/scenario_post_processor_opendss.rb
|
177
207
|
- lib/urbanopt/scenario/scenario_runner_base.rb
|
178
208
|
- lib/urbanopt/scenario/scenario_runner_osw.rb
|