openstudio-workflow 1.3.4 → 1.3.5

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +89 -77
  3. data/README.md +67 -93
  4. data/Rakefile +36 -36
  5. data/lib/openstudio-workflow.rb +65 -65
  6. data/lib/openstudio/workflow/adapters/input/local.rb +311 -324
  7. data/lib/openstudio/workflow/adapters/output/local.rb +158 -161
  8. data/lib/openstudio/workflow/adapters/output/socket.rb +106 -107
  9. data/lib/openstudio/workflow/adapters/output/web.rb +82 -82
  10. data/lib/openstudio/workflow/adapters/output_adapter.rb +163 -163
  11. data/lib/openstudio/workflow/job.rb +57 -57
  12. data/lib/openstudio/workflow/jobs/resources/monthly_report.idf +222 -222
  13. data/lib/openstudio/workflow/jobs/run_energyplus.rb +70 -70
  14. data/lib/openstudio/workflow/jobs/run_ep_measures.rb +73 -73
  15. data/lib/openstudio/workflow/jobs/run_initialization.rb +203 -203
  16. data/lib/openstudio/workflow/jobs/run_os_measures.rb +89 -89
  17. data/lib/openstudio/workflow/jobs/run_postprocess.rb +73 -73
  18. data/lib/openstudio/workflow/jobs/run_preprocess.rb +104 -104
  19. data/lib/openstudio/workflow/jobs/run_reporting_measures.rb +118 -118
  20. data/lib/openstudio/workflow/jobs/run_translation.rb +84 -84
  21. data/lib/openstudio/workflow/multi_delegator.rb +62 -62
  22. data/lib/openstudio/workflow/registry.rb +172 -172
  23. data/lib/openstudio/workflow/run.rb +342 -328
  24. data/lib/openstudio/workflow/time_logger.rb +96 -96
  25. data/lib/openstudio/workflow/util.rb +49 -49
  26. data/lib/openstudio/workflow/util/energyplus.rb +575 -605
  27. data/lib/openstudio/workflow/util/io.rb +68 -68
  28. data/lib/openstudio/workflow/util/measure.rb +658 -650
  29. data/lib/openstudio/workflow/util/model.rb +151 -151
  30. data/lib/openstudio/workflow/util/post_process.rb +235 -238
  31. data/lib/openstudio/workflow/util/weather_file.rb +143 -143
  32. data/lib/openstudio/workflow/version.rb +40 -40
  33. data/lib/openstudio/workflow_json.rb +475 -476
  34. data/lib/openstudio/workflow_runner.rb +263 -268
  35. metadata +24 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd5e1d2530fa9c784c895a46aa301e0dd2ff8ed3
4
- data.tar.gz: d969e8477b3f95eb62fcf00d1f610e18564f7cf6
3
+ metadata.gz: fb02ff2b9ba68076ad3bd7bdd0b07a790db0a90e
4
+ data.tar.gz: 84f8b7b245040cbef4aae3b45a5b2fe973f0ace8
5
5
  SHA512:
6
- metadata.gz: 37a2892034e72bd02e8fcb298138eeb80eb5084a52bc3c5afbd369de65d3e3af561d0d1253676ddb1e0499e4643e9023c45e7fa28725f492cdad46c0cb64b9df
7
- data.tar.gz: 5ca11c5f3ab37a66293fc2b5039e124ae4ad6fe1a7ac3867b75afaa0cbf363bd4406814852c99a057d19064e85f757e8aef81e9288de3c8399965b1547e2c319
6
+ metadata.gz: 466afdf8aaea899d0567f97c1df7674b5a80af09ebc3044410cc3f6a752952e3d65fc9c281aea0480bdfdc13b239819ed4eab4e5d251d194f915929131741e4b
7
+ data.tar.gz: 7c8f671a81404622f1257077cd24bfd77ab405efe4ec1d6fc8fe45688ed9905509005d27f55658dedecbc46be020c695ac41bc18431be7a22e355775499a6bc3
@@ -1,77 +1,89 @@
1
- OpenStudio::Workflow Change Log
2
- ==================================
3
-
4
- Version 1.3.4 (Unreleased)
5
- --------------------------
6
- * Remove support for Ruby 2.0
7
- * Update license
8
-
9
- Version '1.0.0-rc1'
10
- -------------------
11
- * Use specific version of OpenStudio Analysis Gem
12
- * Fix tests
13
- * Remove to_underscore method (use OpenStudio.toUnderscoreCase(...) if needed)
14
-
15
- Version '1.0.0-alpha.0'
16
- -----------------------
17
- * Support new workflow for PAT 2.0. Many of these changes are breaking changes
18
- * Remove rake from gemspec
19
- * Update rubyzip to version 1.2
20
-
21
- Version 0.2.0
22
- ------------------
23
- * Use EnergyPlus that is packaged with OpenStudio. The branch of this repo is no longer tied to the version of EnergyPlus
24
- * Update find_energyplus to use new OpenStudio method instead of RUBYLIB env var
25
- * Update dependencies
26
- * Support tests running on Docker
27
- * Skip the PAT tests for now since they are broken
28
- * Remove snake_case method as it conflicts with another libraries method, now called to_underscore
29
- * Add test for persisting JSONs as reports. Rename reports in the form of <measure_name_underscored>_<report_name>.<ext>
30
- * Always add in Monthly Reports (Deprecate the :run_monthly_reports option)
31
- * Remove the old Standard Reports and use the version in the OpenStudio Release (along with the calibration report)
32
-
33
- Version 0.1.1
34
- ------------------
35
- * Catch exception when loading a measure file.
36
- * Enable running simulations on windows and mac
37
- * Use rubyzip gem instead of system call
38
- * Fix the double directory which caused the zip files to behave strangely on windows
39
- * New find_energyplus method which tries to use OpenStudio's version of EnergyPlus
40
- * Copy all EnergyPlus files into run directory
41
- * Better cleanup after EnergyPlus simulation
42
- * Read machine information from /etc/openstudio-server directory, if available
43
-
44
- Version 0.1.0
45
- -------------
46
- * Tests for programmatically creating the analysis.json files from the OpenStudio-analysis-gem
47
- * Upgrade to EnergyPlus 8.2. Right now the run energyplus and run runmanager job hard code these paths.
48
- * Upgrade and fix Facter facts to grab the correct ip address when running on EC2
49
-
50
- Version 0.0.4
51
- -------------
52
- * Include rubyXL gem for reading/writing MS Excel files
53
- * Remove invalid characters from OpenStudio Measure Attributes. /[|!@#\$%^&\*\(\)\{\}\\\[\]|;:'",<.>\/?\+=]+/
54
- * Fix objective functions to read from any of the results hash, not just the standard report legacy
55
- * Add time logger and reporting measure
56
-
57
- Version 0.0.3
58
- --------------
59
- * Allow measures to set weather file in a measure and have it update what EnergyPlus uses for the weather file.
60
- * OpenStudio::Workflow.run_energyplus method added to just run energyplus.
61
- * 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.
62
- * Catch EnergyPlus errors (non-zero exits), Fatal Errors in eplusout.err, and invalid weather files.
63
- * Force UTF-8 version upon reading the eplusout.err file
64
-
65
- Version 0.0.2
66
- --------------
67
-
68
- * Support reporting measures
69
- * Reduce logging messages
70
- * Keep IDF files
71
- * Remove mtr and eso files after simulation completes
72
- * If measure changes weather file, then use the new weather file with the analysis.json weather path
73
-
74
- Version 0.0.1
75
- --------------
76
-
77
- * Initial release with basic workflow implemented to support running OpenStudio measure-based workflows
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
- [![Circle CI](https://circleci.com/gh/NREL/OpenStudio-workflow-gem/tree/develop.svg?style=svg)](https://circleci.com/gh/NREL/OpenStudio-workflow-gem/tree/develop)
4
- [![Coverage Status](https://coveralls.io/repos/NREL/OpenStudio-workflow-gem/badge.svg?branch=develop&service=github)](https://coveralls.io/github/NREL/OpenStudio-workflow-gem?branch=develop)
5
- [![Dependency Status](https://www.versioneye.com/user/projects/5531fb7b10e714121100102e/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5531fb7b10e714121100102e)
6
-
7
- ## OpenStudio Workflow Gem
8
-
9
- This branch is the development branch for the OpenStudio workflow gem.
10
- ## Installation
11
-
12
- The OpenStudio Workflow Gem has the following dependencies:
13
-
14
- * Ruby 2.0
15
- * OpenStudio with Ruby 2.0 bindings
16
- * EnergyPlus 8.3 (assuming OpenStudio >= 1.7.2)
17
- * MongoDB if using MongoDB Adapter (or when running rspec)
18
-
19
- [OpenStudio](http://developer.nrel.gov/downloads/buildings/openstudio/builds/) needs to be installed
20
- 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 can be loaded.
21
-
22
- export OPENSTUDIO_ROOT=/usr/local
23
- export RUBYLIB=$OPENSTUDIO_ROOT/lib/ruby/site_ruby/2.0.0
24
-
25
- Add this line to your application's Gemfile:
26
-
27
- gem 'OpenStudio-workflow'
28
-
29
- And then execute:
30
-
31
- Mac/Linux:
32
-
33
- $ bundle
34
-
35
- Windows (avoids native extensions):
36
-
37
- $ bundle install --without xml profile
38
-
39
- Or install it yourself as:
40
-
41
- $ gem install OpenStudio-workflow
42
-
43
- ## Usage
44
-
45
- Note that the branches of the Workflow Gem depict which version of EnergyPlus is in use. The develop branch at the
46
- moment should not be used.
47
-
48
- There are currently two adapters to run OpenStudio workflow. The first is a simple Local adapter
49
- allowing the user to pass in the directory to simulation. The directory must have an
50
- [analysis/problem JSON file](spec/files/local_ex1/analysis_1.json) and a [datapoint JSON file](spec/files/local_ex1/datapoint_1.json).
51
- The workflow manager will use these data (and the measures, seed model, and weather data) to assemble and
52
- execute the standard workflow of (preflight->openstudio measures->energyplus->postprocess).
53
-
54
- r = OpenStudio::Workflow.load 'Local', '/home/user/a_directory', options
55
- r.run
56
-
57
- The workflow manager can also use MongoDB to receive instructions on the workflow to run and the data point values.
58
-
59
- ## Caveats and Todos
60
-
61
- ### Todos
62
-
63
- * Add a test to ensure that the models being returned contain alterations after apply_measure
64
- * Add unit tests for each util method
65
- * Define and document the complete set of options for the adapter and run classes
66
- * Implement better error handling with custom exception classes
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 = %w(--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
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
@@ -1,65 +1,65 @@
1
- # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2018, 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
- extend self
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