openstudio-workflow 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +77 -72
  3. data/README.md +93 -93
  4. data/Rakefile +36 -36
  5. data/lib/openstudio-workflow.rb +65 -49
  6. data/lib/openstudio/workflow/adapters/input/local.rb +324 -301
  7. data/lib/openstudio/workflow/adapters/output/local.rb +161 -97
  8. data/lib/openstudio/workflow/adapters/output/socket.rb +107 -91
  9. data/lib/openstudio/workflow/adapters/output/web.rb +82 -66
  10. data/lib/openstudio/workflow/adapters/output_adapter.rb +163 -147
  11. data/lib/openstudio/workflow/job.rb +57 -22
  12. data/lib/openstudio/workflow/jobs/resources/monthly_report.idf +222 -222
  13. data/lib/openstudio/workflow/jobs/run_energyplus.rb +70 -54
  14. data/lib/openstudio/workflow/jobs/run_ep_measures.rb +73 -57
  15. data/lib/openstudio/workflow/jobs/run_initialization.rb +203 -171
  16. data/lib/openstudio/workflow/jobs/run_os_measures.rb +89 -73
  17. data/lib/openstudio/workflow/jobs/run_postprocess.rb +73 -57
  18. data/lib/openstudio/workflow/jobs/run_preprocess.rb +104 -80
  19. data/lib/openstudio/workflow/jobs/run_reporting_measures.rb +118 -102
  20. data/lib/openstudio/workflow/jobs/run_translation.rb +84 -68
  21. data/lib/openstudio/workflow/multi_delegator.rb +62 -46
  22. data/lib/openstudio/workflow/registry.rb +172 -137
  23. data/lib/openstudio/workflow/run.rb +328 -312
  24. data/lib/openstudio/workflow/time_logger.rb +96 -53
  25. data/lib/openstudio/workflow/util.rb +49 -14
  26. data/lib/openstudio/workflow/util/energyplus.rb +605 -570
  27. data/lib/openstudio/workflow/util/io.rb +68 -33
  28. data/lib/openstudio/workflow/util/measure.rb +650 -615
  29. data/lib/openstudio/workflow/util/model.rb +151 -100
  30. data/lib/openstudio/workflow/util/post_process.rb +238 -187
  31. data/lib/openstudio/workflow/util/weather_file.rb +143 -108
  32. data/lib/openstudio/workflow/version.rb +40 -24
  33. data/lib/openstudio/workflow_json.rb +476 -443
  34. data/lib/openstudio/workflow_runner.rb +268 -252
  35. metadata +23 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e5a9601e5611b104e5792e19244ce26b6284cbf
4
- data.tar.gz: 5f2b299f1fe8d2fb59fa23ed95ea06bf9205a0d0
3
+ metadata.gz: bd5e1d2530fa9c784c895a46aa301e0dd2ff8ed3
4
+ data.tar.gz: d969e8477b3f95eb62fcf00d1f610e18564f7cf6
5
5
  SHA512:
6
- metadata.gz: 07efdb7225ff08f4dbd072f7295f6a68f8167dca99f9a6ddccd8f7d1788abe08394afbad44391f67ce8949eafe5666db8ae1e3054080020fc542d622c4523ff9
7
- data.tar.gz: 142223bb274337978404772e277adc8bf07a3d674f7cec6a3da1403505bb13e3a1ec170549044dafb08c387d75a1afd54ae45b8c3afd3351df323f34acfc86cf
6
+ metadata.gz: 37a2892034e72bd02e8fcb298138eeb80eb5084a52bc3c5afbd369de65d3e3af561d0d1253676ddb1e0499e4643e9023c45e7fa28725f492cdad46c0cb64b9df
7
+ data.tar.gz: 5ca11c5f3ab37a66293fc2b5039e124ae4ad6fe1a7ac3867b75afaa0cbf363bd4406814852c99a057d19064e85f757e8aef81e9288de3c8399965b1547e2c319
data/CHANGELOG.md CHANGED
@@ -1,72 +1,77 @@
1
- OpenStudio::Workflow Change Log
2
- ==================================
3
-
4
- Version '1.0.0-rc1' (Not released)
5
- -------------------
6
- * Use specific version of OpenStudio Analysis Gem
7
- * Fix tests
8
- * Remove to_underscore method (use OpenStudio.toUnderscoreCase(...) if needed)
9
-
10
- Version '1.0.0-alpha.0'
11
- -----------------------
12
- * Support new workflow for PAT 2.0. Many of these changes are breaking changes
13
- * Remove rake from gemspec
14
- * Update rubyzip to version 1.2
15
-
16
- Version 0.2.0
17
- ------------------
18
- * Use EnergyPlus that is packaged with OpenStudio. The branch of this repo is no longer tied to the version of EnergyPlus
19
- * Update find_energyplus to use new OpenStudio method instead of RUBYLIB env var
20
- * Update dependencies
21
- * Support tests running on Docker
22
- * Skip the PAT tests for now since they are broken
23
- * Remove snake_case method as it conflicts with another libraries method, now called to_underscore
24
- * Add test for persisting JSONs as reports. Rename reports in the form of <measure_name_underscored>_<report_name>.<ext>
25
- * Always add in Monthly Reports (Deprecate the :run_monthly_reports option)
26
- * Remove the old Standard Reports and use the version in the OpenStudio Release (along with the calibration report)
27
-
28
- Version 0.1.1
29
- ------------------
30
- * Catch exception when loading a measure file.
31
- * Enable running simulations on windows and mac
32
- * Use rubyzip gem instead of system call
33
- * Fix the double directory which caused the zip files to behave strangely on windows
34
- * New find_energyplus method which tries to use OpenStudio's version of EnergyPlus
35
- * Copy all EnergyPlus files into run directory
36
- * Better cleanup after EnergyPlus simulation
37
- * Read machine information from /etc/openstudio-server directory, if available
38
-
39
- Version 0.1.0
40
- -------------
41
- * Tests for programmatically creating the analysis.json files from the OpenStudio-analysis-gem
42
- * Upgrade to EnergyPlus 8.2. Right now the run energyplus and run runmanager job hard code these paths.
43
- * Upgrade and fix Facter facts to grab the correct ip address when running on EC2
44
-
45
- Version 0.0.4
46
- -------------
47
- * Include rubyXL gem for reading/writing MS Excel files
48
- * Remove invalid characters from OpenStudio Measure Attributes. /[|!@#\$%^&\*\(\)\{\}\\\[\]|;:'",<.>\/?\+=]+/
49
- * Fix objective functions to read from any of the results hash, not just the standard report legacy
50
- * Add time logger and reporting measure
51
-
52
- Version 0.0.3
53
- --------------
54
- * Allow measures to set weather file in a measure and have it update what EnergyPlus uses for the weather file.
55
- * OpenStudio::Workflow.run_energyplus method added to just run energyplus.
56
- * 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.
57
- * Catch EnergyPlus errors (non-zero exits), Fatal Errors in eplusout.err, and invalid weather files.
58
- * Force UTF-8 version upon reading the eplusout.err file
59
-
60
- Version 0.0.2
61
- --------------
62
-
63
- * Support reporting measures
64
- * Reduce logging messages
65
- * Keep IDF files
66
- * Remove mtr and eso files after simulation completes
67
- * If measure changes weather file, then use the new weather file with the analysis.json weather path
68
-
69
- Version 0.0.1
70
- --------------
71
-
72
- * Initial release with basic workflow implemented to support running OpenStudio measure-based workflows
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
data/README.md CHANGED
@@ -1,93 +1,93 @@
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
+ [![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
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 = %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,49 +1,65 @@
1
- ######################################################################
2
- # Copyright (c) 2008-2014, Alliance for Sustainable Energy.
3
- # All rights reserved.
4
- #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation; either
8
- # version 2.1 of the License, or (at your option) any later version.
9
- #
10
- # This library is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- # Lesser General Public License for more details.
14
- #
15
- # You should have received a copy of the GNU Lesser General Public
16
- # License along with this library; if not, write to the Free Software
17
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
- ######################################################################
19
-
20
- require 'fileutils'
21
- require 'json'
22
- require 'pathname'
23
-
24
- require_relative 'openstudio/workflow/version'
25
- require_relative 'openstudio/workflow/multi_delegator'
26
- require_relative 'openstudio/workflow/run'
27
- require_relative 'openstudio/workflow/job'
28
- require_relative 'openstudio/workflow/time_logger'
29
- require_relative 'openstudio/workflow/registry'
30
- require_relative 'openstudio/workflow/util'
31
- require 'openstudio'
32
- require_relative 'openstudio/workflow_runner'
33
-
34
- module OpenStudio
35
- module Workflow
36
- extend self
37
-
38
- # Extract an archive to a specific location
39
- #
40
- # @param archive_filename [String] Path and name of the file to extract
41
- # @param destination [String] Path to extract to
42
- # @param overwrite [Boolean] If true, will overwrite any extracted file that may already exist
43
- #
44
- def extract_archive(archive_filename, destination, overwrite = true)
45
- zf = OpenStudio::UnzipFile.new(archive_filename)
46
- zf.extractAllFiles(destination)
47
- end
48
- end
49
- end
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