openstudio-workflow 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +89 -77
- data/README.md +67 -93
- data/Rakefile +36 -36
- data/lib/openstudio-workflow.rb +65 -65
- data/lib/openstudio/workflow/adapters/input/local.rb +311 -324
- data/lib/openstudio/workflow/adapters/output/local.rb +158 -161
- data/lib/openstudio/workflow/adapters/output/socket.rb +106 -107
- data/lib/openstudio/workflow/adapters/output/web.rb +82 -82
- data/lib/openstudio/workflow/adapters/output_adapter.rb +163 -163
- data/lib/openstudio/workflow/job.rb +57 -57
- data/lib/openstudio/workflow/jobs/resources/monthly_report.idf +222 -222
- data/lib/openstudio/workflow/jobs/run_energyplus.rb +70 -70
- data/lib/openstudio/workflow/jobs/run_ep_measures.rb +73 -73
- data/lib/openstudio/workflow/jobs/run_initialization.rb +203 -203
- data/lib/openstudio/workflow/jobs/run_os_measures.rb +89 -89
- data/lib/openstudio/workflow/jobs/run_postprocess.rb +73 -73
- data/lib/openstudio/workflow/jobs/run_preprocess.rb +104 -104
- data/lib/openstudio/workflow/jobs/run_reporting_measures.rb +118 -118
- data/lib/openstudio/workflow/jobs/run_translation.rb +84 -84
- data/lib/openstudio/workflow/multi_delegator.rb +62 -62
- data/lib/openstudio/workflow/registry.rb +172 -172
- data/lib/openstudio/workflow/run.rb +342 -328
- data/lib/openstudio/workflow/time_logger.rb +96 -96
- data/lib/openstudio/workflow/util.rb +49 -49
- data/lib/openstudio/workflow/util/energyplus.rb +575 -605
- data/lib/openstudio/workflow/util/io.rb +68 -68
- data/lib/openstudio/workflow/util/measure.rb +658 -650
- data/lib/openstudio/workflow/util/model.rb +151 -151
- data/lib/openstudio/workflow/util/post_process.rb +235 -238
- data/lib/openstudio/workflow/util/weather_file.rb +143 -143
- data/lib/openstudio/workflow/version.rb +40 -40
- data/lib/openstudio/workflow_json.rb +475 -476
- data/lib/openstudio/workflow_runner.rb +263 -268
- metadata +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb02ff2b9ba68076ad3bd7bdd0b07a790db0a90e
|
4
|
+
data.tar.gz: 84f8b7b245040cbef4aae3b45a5b2fe973f0ace8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466afdf8aaea899d0567f97c1df7674b5a80af09ebc3044410cc3f6a752952e3d65fc9c281aea0480bdfdc13b239819ed4eab4e5d251d194f915929131741e4b
|
7
|
+
data.tar.gz: 7c8f671a81404622f1257077cd24bfd77ab405efe4ec1d6fc8fe45688ed9905509005d27f55658dedecbc46be020c695ac41bc18431be7a22e355775499a6bc3
|
data/CHANGELOG.md
CHANGED
@@ -1,77 +1,89 @@
|
|
1
|
-
OpenStudio::Workflow Change Log
|
2
|
-
==================================
|
3
|
-
|
4
|
-
Version 1.3.
|
5
|
-
|
6
|
-
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
* Remove
|
19
|
-
* Update
|
20
|
-
|
21
|
-
Version 0.
|
22
|
-
|
23
|
-
* Use
|
24
|
-
*
|
25
|
-
*
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
*
|
30
|
-
*
|
31
|
-
*
|
32
|
-
|
33
|
-
Version 0.
|
34
|
-
------------------
|
35
|
-
*
|
36
|
-
*
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
*
|
41
|
-
*
|
42
|
-
*
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
*
|
48
|
-
*
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
*
|
53
|
-
*
|
54
|
-
*
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
*
|
60
|
-
*
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
*
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
1
|
+
OpenStudio::Workflow Change Log
|
2
|
+
==================================
|
3
|
+
|
4
|
+
Version 1.3.5
|
5
|
+
-------------
|
6
|
+
|
7
|
+
* Allow reporting to fail gracefully so HTML reports are returned Fixed [this](https://github.com/NREL/OpenStudio/issues/864).
|
8
|
+
* Allow EMS:OutputVariable in reporting measure
|
9
|
+
* Fixes [#93](https://github.com/NREL/OpenStudio-workflow-gem/issues/93) - Pass Model to the arguments method of ReportingMeasure
|
10
|
+
* Update README
|
11
|
+
* Remove CircleCI in favor of Jenkins
|
12
|
+
* Update license and copyright
|
13
|
+
* Improve speed by not loading REXML unless needed
|
14
|
+
* Fix ChangeBuildingLocation test failure
|
15
|
+
|
16
|
+
Version 1.3.4
|
17
|
+
-------------
|
18
|
+
* Remove support for Ruby 2.0
|
19
|
+
* Update license
|
20
|
+
|
21
|
+
Version '1.0.0-rc1'
|
22
|
+
-------------------
|
23
|
+
* Use specific version of OpenStudio Analysis Gem
|
24
|
+
* Fix tests
|
25
|
+
* Remove to_underscore method (use OpenStudio.toUnderscoreCase(...) if needed)
|
26
|
+
|
27
|
+
Version '1.0.0-alpha.0'
|
28
|
+
-----------------------
|
29
|
+
* Support new workflow for PAT 2.0. Many of these changes are breaking changes
|
30
|
+
* Remove rake from gemspec
|
31
|
+
* Update rubyzip to version 1.2
|
32
|
+
|
33
|
+
Version 0.2.0
|
34
|
+
------------------
|
35
|
+
* Use EnergyPlus that is packaged with OpenStudio. The branch of this repo is no longer tied to the version of EnergyPlus
|
36
|
+
* Update find_energyplus to use new OpenStudio method instead of RUBYLIB env var
|
37
|
+
* Update dependencies
|
38
|
+
* Support tests running on Docker
|
39
|
+
* Skip the PAT tests for now since they are broken
|
40
|
+
* Remove snake_case method as it conflicts with another libraries method, now called to_underscore
|
41
|
+
* Add test for persisting JSONs as reports. Rename reports in the form of <measure_name_underscored>_<report_name>.<ext>
|
42
|
+
* Always add in Monthly Reports (Deprecate the :run_monthly_reports option)
|
43
|
+
* Remove the old Standard Reports and use the version in the OpenStudio Release (along with the calibration report)
|
44
|
+
|
45
|
+
Version 0.1.1
|
46
|
+
------------------
|
47
|
+
* Catch exception when loading a measure file.
|
48
|
+
* Enable running simulations on windows and mac
|
49
|
+
* Use rubyzip gem instead of system call
|
50
|
+
* Fix the double directory which caused the zip files to behave strangely on windows
|
51
|
+
* New find_energyplus method which tries to use OpenStudio's version of EnergyPlus
|
52
|
+
* Copy all EnergyPlus files into run directory
|
53
|
+
* Better cleanup after EnergyPlus simulation
|
54
|
+
* Read machine information from /etc/openstudio-server directory, if available
|
55
|
+
|
56
|
+
Version 0.1.0
|
57
|
+
-------------
|
58
|
+
* Tests for programmatically creating the analysis.json files from the OpenStudio-analysis-gem
|
59
|
+
* Upgrade to EnergyPlus 8.2. Right now the run energyplus and run runmanager job hard code these paths.
|
60
|
+
* Upgrade and fix Facter facts to grab the correct ip address when running on EC2
|
61
|
+
|
62
|
+
Version 0.0.4
|
63
|
+
-------------
|
64
|
+
* Include rubyXL gem for reading/writing MS Excel files
|
65
|
+
* Remove invalid characters from OpenStudio Measure Attributes. /[|!@#\$%^&\*\(\)\{\}\\\[\]|;:'",<.>\/?\+=]+/
|
66
|
+
* Fix objective functions to read from any of the results hash, not just the standard report legacy
|
67
|
+
* Add time logger and reporting measure
|
68
|
+
|
69
|
+
Version 0.0.3
|
70
|
+
--------------
|
71
|
+
* Allow measures to set weather file in a measure and have it update what EnergyPlus uses for the weather file.
|
72
|
+
* OpenStudio::Workflow.run_energyplus method added to just run energyplus.
|
73
|
+
* Remove AASM (act as state machine) and replace with simple tracking of the state. Interface is the same except there is now no need to pass in the States.
|
74
|
+
* Catch EnergyPlus errors (non-zero exits), Fatal Errors in eplusout.err, and invalid weather files.
|
75
|
+
* Force UTF-8 version upon reading the eplusout.err file
|
76
|
+
|
77
|
+
Version 0.0.2
|
78
|
+
--------------
|
79
|
+
|
80
|
+
* Support reporting measures
|
81
|
+
* Reduce logging messages
|
82
|
+
* Keep IDF files
|
83
|
+
* Remove mtr and eso files after simulation completes
|
84
|
+
* If measure changes weather file, then use the new weather file with the analysis.json weather path
|
85
|
+
|
86
|
+
Version 0.0.1
|
87
|
+
--------------
|
88
|
+
|
89
|
+
* Initial release with basic workflow implemented to support running OpenStudio measure-based workflows
|
data/README.md
CHANGED
@@ -1,93 +1,67 @@
|
|
1
|
-
# OpenStudio::Workflow
|
2
|
-
|
3
|
-
[![
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
## Testing
|
69
|
-
|
70
|
-
The preferred way for testing is to run rspec either natively or via docker.
|
71
|
-
|
72
|
-
### Locally
|
73
|
-
|
74
|
-
```
|
75
|
-
rspec spec/
|
76
|
-
```
|
77
|
-
|
78
|
-
### Docker
|
79
|
-
|
80
|
-
```
|
81
|
-
export OPENSTUDIO_VERSION=1.13.0
|
82
|
-
docker run -v $(pwd):/var/simdata/openstudio \
|
83
|
-
nrel/openstudio:$OPENSTUDIO_VERSION \
|
84
|
-
/var/simdata/openstudio/test/bin/docker-run.sh
|
85
|
-
```
|
86
|
-
|
87
|
-
## Contributing
|
88
|
-
|
89
|
-
1. Fork it ( https://github.com/NREL/OpenStudio-workflow/fork )
|
90
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
91
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
92
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
93
|
-
5. Create a new Pull Request
|
1
|
+
# OpenStudio::Workflow
|
2
|
+
|
3
|
+
[![Dependency Status](https://www.versioneye.com/user/projects/5531fb7b10e714121100102e/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5531fb7b10e714121100102e)
|
4
|
+
|
5
|
+
## OpenStudio Workflow Gem
|
6
|
+
|
7
|
+
This branch is the development branch for the OpenStudio workflow gem.
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
The OpenStudio Workflow Gem has the following dependencies:
|
11
|
+
|
12
|
+
* Ruby 2.2.4
|
13
|
+
* OpenStudio 2.x
|
14
|
+
|
15
|
+
[OpenStudio](http://developer.nrel.gov/downloads/buildings/openstudio/builds/) needs to be installed and in your path. On Mac/Linux it is easiest to add the following to your .bash_profile or /etc/profile.d/<file>.sh to ensure OpenStudio loads. Assuming OpenStudio 2.9.1 installed:
|
16
|
+
|
17
|
+
export RUBYLIB=/usr/local/openstudio-2.9.1/Ruby
|
18
|
+
|
19
|
+
Add this line to your application's Gemfile:
|
20
|
+
|
21
|
+
gem 'OpenStudio-workflow'
|
22
|
+
|
23
|
+
And then execute:
|
24
|
+
|
25
|
+
bundle install
|
26
|
+
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
$ gem install openstudio-workflow
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
There are currently two adapters to run OpenStudio workflow. The first is a simple Local adapter allowing the user to pass in the directory to simulation. The directory must have an [analysis/problem JSON file](spec/files/local_ex1/analysis_1.json) and a [datapoint JSON file](spec/files/local_ex1/datapoint_1.json).
|
34
|
+
|
35
|
+
The workflow manager will use these data (and the measures, seed model, and weather data) to assemble and execute the standard workflow of (preflight->openstudio measures->energyplus->postprocess).
|
36
|
+
|
37
|
+
r = OpenStudio::Workflow.load 'Local', '/home/user/a_directory', options
|
38
|
+
r.run
|
39
|
+
|
40
|
+
There are also socket and web-based adapters that have yet to be documented.
|
41
|
+
|
42
|
+
## Testing
|
43
|
+
|
44
|
+
The preferred way for testing is to run rspec either natively or via docker.
|
45
|
+
|
46
|
+
### Locally
|
47
|
+
|
48
|
+
```
|
49
|
+
rspec spec/
|
50
|
+
```
|
51
|
+
|
52
|
+
### Docker
|
53
|
+
|
54
|
+
```
|
55
|
+
export OPENSTUDIO_VERSION=2.9.1
|
56
|
+
docker run -v $(pwd):/var/simdata/openstudio \
|
57
|
+
nrel/openstudio:$OPENSTUDIO_VERSION \
|
58
|
+
/var/simdata/openstudio/test/bin/docker-run.sh
|
59
|
+
```
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
1. Fork it ( https://github.com/NREL/OpenStudio-workflow/fork )
|
64
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
65
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
66
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
67
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
Bundler.setup
|
3
|
-
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
|
6
|
-
# Always create spec reports
|
7
|
-
require 'ci/reporter/rake/rspec'
|
8
|
-
|
9
|
-
# Gem tasks
|
10
|
-
require 'bundler/gem_tasks'
|
11
|
-
|
12
|
-
RSpec::Core::RakeTask.new('spec:unit') do |spec|
|
13
|
-
spec.rspec_opts =
|
14
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
15
|
-
end
|
16
|
-
|
17
|
-
task 'spec:unit' => 'ci:setup:rspec'
|
18
|
-
task default: 'spec:unit'
|
19
|
-
|
20
|
-
require 'rubocop/rake_task'
|
21
|
-
desc 'Run RuboCop on the lib directory'
|
22
|
-
RuboCop::RakeTask.new(:rubocop) do |task|
|
23
|
-
task.options = ['--no-color', '--out=rubocop-results.xml']
|
24
|
-
task.formatters = ['RuboCop::Formatter::CheckstyleFormatter']
|
25
|
-
task.requires = ['rubocop/formatter/checkstyle_formatter']
|
26
|
-
# don't abort rake on failure
|
27
|
-
task.fail_on_error = false
|
28
|
-
end
|
29
|
-
|
30
|
-
require 'openstudio-workflow'
|
31
|
-
desc 'test extracting zip'
|
32
|
-
task :test_zip do
|
33
|
-
f = File.join(File.dirname(__FILE__), 'spec/files/example_models/the_project.zip')
|
34
|
-
puts "Trying to extract #{f}"
|
35
|
-
OpenStudio::Workflow.extract_archive(f, 'junk_out', true)
|
36
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
Bundler.setup
|
3
|
+
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
|
6
|
+
# Always create spec reports
|
7
|
+
require 'ci/reporter/rake/rspec'
|
8
|
+
|
9
|
+
# Gem tasks
|
10
|
+
require 'bundler/gem_tasks'
|
11
|
+
|
12
|
+
RSpec::Core::RakeTask.new('spec:unit') do |spec|
|
13
|
+
spec.rspec_opts = ['--format', 'progress', '--format', 'CI::Reporter::RSpec']
|
14
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
15
|
+
end
|
16
|
+
|
17
|
+
task 'spec:unit' => 'ci:setup:rspec'
|
18
|
+
task default: 'spec:unit'
|
19
|
+
|
20
|
+
require 'rubocop/rake_task'
|
21
|
+
desc 'Run RuboCop on the lib directory'
|
22
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
23
|
+
task.options = ['--no-color', '--out=rubocop-results.xml']
|
24
|
+
task.formatters = ['RuboCop::Formatter::CheckstyleFormatter']
|
25
|
+
task.requires = ['rubocop/formatter/checkstyle_formatter']
|
26
|
+
# don't abort rake on failure
|
27
|
+
task.fail_on_error = false
|
28
|
+
end
|
29
|
+
|
30
|
+
require 'openstudio-workflow'
|
31
|
+
desc 'test extracting zip'
|
32
|
+
task :test_zip do
|
33
|
+
f = File.join(File.dirname(__FILE__), 'spec/files/example_models/the_project.zip')
|
34
|
+
puts "Trying to extract #{f}"
|
35
|
+
OpenStudio::Workflow.extract_archive(f, 'junk_out', true)
|
36
|
+
end
|
data/lib/openstudio-workflow.rb
CHANGED
@@ -1,65 +1,65 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
3
|
-
# All rights reserved.
|
4
|
-
# Redistribution and use in source and binary forms, with or without
|
5
|
-
# modification, are permitted provided that the following conditions are met:
|
6
|
-
#
|
7
|
-
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
-
# this list of conditions and the following disclaimer.
|
9
|
-
#
|
10
|
-
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
-
# this list of conditions and the following disclaimer in the documentation
|
12
|
-
# and/or other materials provided with the distribution.
|
13
|
-
#
|
14
|
-
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
-
# may be used to endorse or promote products derived from this software without
|
16
|
-
# specific prior written permission from the respective party.
|
17
|
-
#
|
18
|
-
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
-
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
-
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
-
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
-
#
|
23
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
-
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
-
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
-
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
-
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
-
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
-
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
-
# *******************************************************************************
|
35
|
-
|
36
|
-
require 'fileutils'
|
37
|
-
require 'json'
|
38
|
-
require 'pathname'
|
39
|
-
|
40
|
-
require_relative 'openstudio/workflow/version'
|
41
|
-
require_relative 'openstudio/workflow/multi_delegator'
|
42
|
-
require_relative 'openstudio/workflow/run'
|
43
|
-
require_relative 'openstudio/workflow/job'
|
44
|
-
require_relative 'openstudio/workflow/time_logger'
|
45
|
-
require_relative 'openstudio/workflow/registry'
|
46
|
-
require_relative 'openstudio/workflow/util'
|
47
|
-
require 'openstudio'
|
48
|
-
require_relative 'openstudio/workflow_runner'
|
49
|
-
|
50
|
-
module OpenStudio
|
51
|
-
module Workflow
|
52
|
-
|
53
|
-
|
54
|
-
# Extract an archive to a specific location
|
55
|
-
#
|
56
|
-
# @param archive_filename [String] Path and name of the file to extract
|
57
|
-
# @param destination [String] Path to extract to
|
58
|
-
# @param overwrite [Boolean] If true, will overwrite any extracted file that may already exist
|
59
|
-
#
|
60
|
-
def extract_archive(archive_filename, destination, overwrite = true)
|
61
|
-
zf = OpenStudio::UnzipFile.new(archive_filename)
|
62
|
-
zf.extractAllFiles(destination)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
1
|
+
# *******************************************************************************
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
|
3
|
+
# All rights reserved.
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
+
# may be used to endorse or promote products derived from this software without
|
16
|
+
# specific prior written permission from the respective party.
|
17
|
+
#
|
18
|
+
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
+
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
+
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
+
#
|
23
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
26
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
|
27
|
+
# GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
28
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
29
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
30
|
+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
31
|
+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
32
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
33
|
+
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
# *******************************************************************************
|
35
|
+
|
36
|
+
require 'fileutils'
|
37
|
+
require 'json'
|
38
|
+
require 'pathname'
|
39
|
+
|
40
|
+
require_relative 'openstudio/workflow/version'
|
41
|
+
require_relative 'openstudio/workflow/multi_delegator'
|
42
|
+
require_relative 'openstudio/workflow/run'
|
43
|
+
require_relative 'openstudio/workflow/job'
|
44
|
+
require_relative 'openstudio/workflow/time_logger'
|
45
|
+
require_relative 'openstudio/workflow/registry'
|
46
|
+
require_relative 'openstudio/workflow/util'
|
47
|
+
require 'openstudio'
|
48
|
+
require_relative 'openstudio/workflow_runner'
|
49
|
+
|
50
|
+
module OpenStudio
|
51
|
+
module Workflow
|
52
|
+
module_function
|
53
|
+
|
54
|
+
# Extract an archive to a specific location
|
55
|
+
#
|
56
|
+
# @param archive_filename [String] Path and name of the file to extract
|
57
|
+
# @param destination [String] Path to extract to
|
58
|
+
# @param overwrite [Boolean] If true, will overwrite any extracted file that may already exist
|
59
|
+
#
|
60
|
+
def extract_archive(archive_filename, destination, overwrite = true)
|
61
|
+
zf = OpenStudio::UnzipFile.new(archive_filename)
|
62
|
+
zf.extractAllFiles(destination)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|