openstudio-workflow 1.0.0.pat1 → 1.0.0

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +16 -68
  4. data/Rakefile +9 -9
  5. data/bin/openstudio_cli +786 -0
  6. data/lib/openstudio/workflow/adapters/input/local.rb +97 -0
  7. data/lib/openstudio/workflow/adapters/output/local.rb +90 -0
  8. data/lib/openstudio/workflow/adapters/output/socket.rb +70 -0
  9. data/lib/openstudio/workflow/{jobs/run_preflight/run_preflight.rb → adapters/output/web.rb} +37 -19
  10. data/lib/openstudio/workflow/{adapter.rb → adapters/output_adapter.rb} +53 -51
  11. data/lib/openstudio/workflow/job.rb +22 -0
  12. data/lib/openstudio/workflow/jobs/{run_energyplus → resources}/monthly_report.idf +0 -0
  13. data/lib/openstudio/workflow/jobs/run_energyplus.rb +49 -0
  14. data/lib/openstudio/workflow/jobs/run_ep_measures.rb +55 -0
  15. data/lib/openstudio/workflow/jobs/run_initialization.rb +136 -0
  16. data/lib/openstudio/workflow/jobs/run_os_measures.rb +59 -0
  17. data/lib/openstudio/workflow/jobs/run_postprocess.rb +53 -0
  18. data/lib/openstudio/workflow/jobs/run_preprocess.rb +81 -0
  19. data/lib/openstudio/workflow/jobs/run_reporting_measures.rb +86 -0
  20. data/lib/openstudio/workflow/jobs/run_translation.rb +49 -0
  21. data/lib/openstudio/workflow/multi_delegator.rb +1 -3
  22. data/lib/openstudio/workflow/registry.rb +137 -0
  23. data/lib/openstudio/workflow/run.rb +182 -221
  24. data/lib/openstudio/workflow/time_logger.rb +1 -1
  25. data/lib/openstudio/workflow/util/energyplus.rb +564 -0
  26. data/lib/openstudio/workflow/util/io.rb +33 -0
  27. data/lib/openstudio/workflow/util/measure.rb +520 -0
  28. data/lib/openstudio/workflow/util/model.rb +100 -0
  29. data/lib/openstudio/workflow/util/post_process.rb +177 -0
  30. data/lib/openstudio/workflow/util/weather_file.rb +108 -0
  31. data/lib/openstudio/workflow/util.rb +14 -0
  32. data/lib/openstudio/workflow/version.rb +1 -1
  33. data/lib/openstudio/workflow_json.rb +399 -0
  34. data/lib/openstudio/workflow_runner.rb +213 -0
  35. data/lib/openstudio-workflow.rb +13 -118
  36. metadata +45 -85
  37. data/lib/openstudio/extended_runner.rb +0 -105
  38. data/lib/openstudio/workflow/adapters/local.rb +0 -101
  39. data/lib/openstudio/workflow/adapters/mongo.rb +0 -227
  40. data/lib/openstudio/workflow/jobs/lib/apply_measures.rb +0 -253
  41. data/lib/openstudio/workflow/jobs/run_energyplus/run_energyplus.rb +0 -314
  42. data/lib/openstudio/workflow/jobs/run_openstudio/run_openstudio.rb +0 -230
  43. data/lib/openstudio/workflow/jobs/run_postprocess/run_postprocess.rb +0 -110
  44. data/lib/openstudio/workflow/jobs/run_reporting_measures/run_reporting_measures.rb +0 -471
  45. data/lib/openstudio/workflow/jobs/run_runmanager/run_runmanager.rb +0 -247
  46. data/lib/openstudio/workflow/jobs/run_xml/run_xml.rb +0 -279
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c29f63c328f9be8e74c4ff7c624e182255eda3cc
4
- data.tar.gz: 9c1bfb9ea7768c7736eeb06b713b90a00c780617
3
+ metadata.gz: 41a1b251ada32dafc258c2f0fc90afbbc4ba043d
4
+ data.tar.gz: 87b2d6a43d56d43c2eb51317ec060fbdb5737026
5
5
  SHA512:
6
- metadata.gz: 4e3ab5fce7038567f820f1bfb17ec6287ecdf76842d672d077b8033ed69f600b4297ecce41322b765e7ad847d5003801005575ddb7c99da11bdff24be26e784e
7
- data.tar.gz: 4efcf97529a9a83871b70fd84c303e8b6c209cd4fe75ed0c6a278b16228e9675b202e9a5a78917216bfb0ed4ae5bbefa66c122af2f5f8650e8a423f1eac4130b
6
+ metadata.gz: 52e7e0b922390bf6ba53039a35d31da5db0a5d1936d014147158c878ec6366b86f39186f6b5834783e46e63d06577933acc369aa21fb6b194be77341ddb66f77
7
+ data.tar.gz: e307a06376afd682d42a8f02e07450eb939fba1d07bd7d4d096966a7b6d7aad1fc27286ad8d349c089490b5287dc125bf36c972192daed8448835a051fb3853c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  OpenStudio::Workflow Change Log
2
2
  ==================================
3
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
+
4
16
  Version 0.2.0
5
17
  ------------------
6
18
  * Use EnergyPlus that is packaged with OpenStudio. The branch of this repo is no longer tied to the version of EnergyPlus
data/README.md CHANGED
@@ -1,68 +1,24 @@
1
1
  # OpenStudio::Workflow
2
- [![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)
3
- [![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)
4
- [![Dependency Status](https://www.versioneye.com/user/projects/5531fb7b10e714121100102e/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5531fb7b10e714121100102e)
2
+ [![Circle CI](https://circleci.com/gh/NREL/OpenStudio-workflow-gem/tree/osw.svg?style=svg)](https://circleci.com/gh/NREL/OpenStudio-workflow-gem/tree/osw)
3
+ [![Coverage Status](https://coveralls.io/repos/NREL/OpenStudio-workflow-gem/badge.svg?branch=osw&service=github)](https://coveralls.io/github/NREL/OpenStudio-workflow-gem?branch=osw)
5
4
 
6
- Run an EnergyPlus simulation using a file-based workflow that is read from a Local or MongoDB adapter.
5
+ ## OpenStudio Workflow branch
7
6
 
8
- ## Installation
9
-
10
- The OpenStudio Workflow Gem has the following dependencies:
11
-
12
- * Ruby 2.0
13
- * OpenStudio with Ruby 2.0 bindings
14
- * EnergyPlus 8.3 (assuming OpenStudio >= 1.7.2)
15
- * MongoDB if using MongoDB Adapter (or when running rspec)
16
-
17
- [OpenStudio](http://developer.nrel.gov/downloads/buildings/openstudio/builds/) needs to be installed
18
- 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.
19
-
20
- export OPENSTUDIO_ROOT=/usr/local
21
- export RUBYLIB=$OPENSTUDIO_ROOT/lib/ruby/site_ruby/2.0.0
22
-
23
- Add this line to your application's Gemfile:
24
-
25
- gem 'OpenStudio-workflow'
26
-
27
- And then execute:
28
-
29
- Mac/Linux:
30
-
31
- $ bundle
32
-
33
- Windows (avoids native extensions):
34
-
35
- $ bundle install --without xml profile
36
-
37
- Or install it yourself as:
38
-
39
- $ gem install OpenStudio-workflow
40
-
41
- ## Usage
42
-
43
- Note that the branches of the Workflow Gem depict which version of EnergyPlus is in use. The develop branch at the
44
- moment should not be used.
45
-
46
- There are currently two adapters to run OpenStudio workflow. The first is a simple Local adapter
47
- allowing the user to pass in the directory to simulation. The directory must have an
48
- [analysis/problem JSON file](spec/files/local_ex1/analysis_1.json) and a [datapoint JSON file](spec/files/local_ex1/datapoint_1.json).
49
- The workflow manager will use these data (and the measures, seed model, and weather data) to assemble and
50
- execute the standard workflow of (preflight->openstudio measures->energyplus->postprocess).
51
-
52
- r = OpenStudio::Workflow.load 'Local', '/home/user/a_directory', options
53
- r.run
54
-
55
- The workflow manager can also use MongoDB to receive instructions on the workflow to run and the data point values.
7
+ This branch is the development branch for the OpenStudio 2.0 workflow gem. This will become the primary branch when OpenStudio 2.0 is released.
56
8
 
57
9
  ## Caveats and Todos
58
10
 
59
11
  ### Todos
60
12
 
61
- * Read the analysis.json file to determine the states that are going to run instead of (or in addition to) passing them into the constructor
13
+ * Find a better home for monthly_reports.idf
14
+ * Fix issues around where standard reports and calibration reports run (and make them optional enabled)
15
+ * Move registry into the WorkflowRunner class; this includes logging
16
+ * Add a test to ensure that the models being returned contain alterations after apply_measure
17
+ * Add unit tests for each util method
18
+ * Clean up log messages (and code flow) for @current_state in run.rb
19
+ * Define and document the complete set of options for the adapter and run classes
62
20
  * Implement better error handling with custom exception classes
63
21
  * Add a results adapter to return a string as the last call based on the source of the call. (e.g. R, command line, C++, etc).
64
- * Implement a logger in the Adapters, right now they are unable to log
65
- * Hook up the measure group based workflows
66
22
 
67
23
  ## Testing
68
24
 
@@ -71,24 +27,16 @@ The preferred way for testing is to run rspec either natively or via docker. The
71
27
  ### Locally
72
28
 
73
29
  ```
74
- rake
30
+ rspec spec/
75
31
  ```
76
32
 
77
33
  ### Docker
78
34
 
79
- To run all the tests automatically run:
80
- ```
81
- docker run --rm -v $(pwd):/var/simdata/openstudio nrel/docker-test-containers:openstudio-1.8.5-mongo-2.4 /var/simdata/openstudio/test/bin/docker-run.sh
82
- ```
83
-
84
- To run the tests inside docker and enable debugging, then create a bash shell in docker with:
85
35
  ```
86
- docker run -it --rm -v $(pwd):/var/simdata/openstudio nrel/docker-test-containers:openstudio-1.8.5-mongo-2.4 bash
87
- service mongodb start
88
- bundle update
89
- rake
90
- # or
91
- bundle exec rspec <file>:<line>
36
+ export OPENSTUDIO_VERSION=1.13.0
37
+ docker run -v $(pwd):/var/simdata/openstudio \
38
+ nrel/openstudio:$OPENSTUDIO_VERSION \
39
+ /var/simdata/openstudio/test/bin/docker-run.sh
92
40
  ```
93
41
 
94
42
  ## Contributing
data/Rakefile CHANGED
@@ -1,12 +1,5 @@
1
1
  require 'bundler'
2
-
3
- begin
4
- Bundler.setup
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts 'Run `bundle install` to install missing gems'
8
- exit e.status_code
9
- end
2
+ Bundler.setup
10
3
 
11
4
  require 'rspec/core/rake_task'
12
5
 
@@ -22,6 +15,7 @@ RSpec::Core::RakeTask.new('spec:unit') do |spec|
22
15
  end
23
16
 
24
17
  task 'spec:unit' => 'ci:setup:rspec'
18
+ task default: 'spec:unit'
25
19
 
26
20
  require 'rubocop/rake_task'
27
21
  desc 'Run RuboCop on the lib directory'
@@ -33,4 +27,10 @@ RuboCop::RakeTask.new(:rubocop) do |task|
33
27
  task.fail_on_error = false
34
28
  end
35
29
 
36
- task default: 'spec:unit'
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