openstudio-workflow 0.0.1

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.
@@ -0,0 +1,24 @@
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
+ module OpenStudio
21
+ module Workflow
22
+ VERSION = "0.0.1"
23
+ end
24
+ end
@@ -0,0 +1,69 @@
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 'aasm'
21
+ require 'pp'
22
+ require 'multi_json'
23
+ require 'colored'
24
+ require 'fileutils'
25
+ require 'json' # needed for a single pretty generate call
26
+
27
+ begin
28
+ require 'facter'
29
+ rescue LoadError => e
30
+ puts 'Could not load Facter. Will not be able to save the IP address to the log'.red
31
+ end
32
+
33
+ require 'openstudio/workflow/version'
34
+ require 'openstudio/workflow/multi_delegator'
35
+ require 'openstudio/workflow/run'
36
+
37
+ begin
38
+ require 'openstudio'
39
+ $openstudio_gem = true
40
+ rescue LoadError => e
41
+ $openstudio_gem = false
42
+ puts 'OpenStudio did not load, but most functionality is still available. Will try to continue...'.red
43
+ end
44
+
45
+ module OpenStudio
46
+ module Workflow
47
+ extend self
48
+
49
+ # Create a new workflow instance using the defined adapter and UUID
50
+ def load(adapter_name, run_directory, options={})
51
+ defaults = {adapter_options: {}}
52
+ options = defaults.merge(options)
53
+ adapter = load_adapter adapter_name, options[:adapter_options]
54
+ run_klass = OpenStudio::Workflow::Run.new(adapter, run_directory, options)
55
+ # return the run class
56
+ run_klass
57
+ end
58
+
59
+ private
60
+
61
+ def load_adapter(name, adapter_options={})
62
+ require "openstudio/workflow/adapters/#{name.downcase}"
63
+ klass_name = name.to_s.split('_').map(&:capitalize) * ''
64
+ #pp "#{klass_name} is the adapter class name"
65
+ klass = OpenStudio::Workflow::Adapters.const_get(klass_name).new(adapter_options)
66
+ klass
67
+ end
68
+ end
69
+ end
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: openstudio-workflow
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Nicholas Long
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: aasm
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: multi_json
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.10.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.10.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: colored
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ description: Run OpenStudio based simulations using EnergyPlus
84
+ email:
85
+ - nicholas.long@nrel.gov
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - lib/openstudio/workflow/adapter.rb
91
+ - lib/openstudio/workflow/adapters/local.rb
92
+ - lib/openstudio/workflow/adapters/mongo.rb
93
+ - lib/openstudio/workflow/jobs/run_energyplus/run_energyplus.rb
94
+ - lib/openstudio/workflow/jobs/run_openstudio/monthly_report.idf
95
+ - lib/openstudio/workflow/jobs/run_openstudio/run_openstudio.rb
96
+ - lib/openstudio/workflow/jobs/run_postprocess/packaged_measures/README.md
97
+ - lib/openstudio/workflow/jobs/run_postprocess/packaged_measures/StandardReports/measure.rb
98
+ - lib/openstudio/workflow/jobs/run_postprocess/packaged_measures/StandardReports/measure.xml
99
+ - lib/openstudio/workflow/jobs/run_postprocess/packaged_measures/StandardReports/resources/report.html.in
100
+ - lib/openstudio/workflow/jobs/run_postprocess/run_postprocess.rb
101
+ - lib/openstudio/workflow/jobs/run_preflight/run_preflight.rb
102
+ - lib/openstudio/workflow/jobs/run_xml/run_xml.rb
103
+ - lib/openstudio/workflow/multi_delegator.rb
104
+ - lib/openstudio/workflow/run.rb
105
+ - lib/openstudio/workflow/version.rb
106
+ - lib/openstudio-workflow.rb
107
+ - README.md
108
+ - CHANGELOG.md
109
+ - Rakefile
110
+ homepage: https://github.com/NREL/OpenStudio-workflow-gem
111
+ licenses:
112
+ - LGPL
113
+ metadata: {}
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - '>='
121
+ - !ruby/object:Gem::Version
122
+ version: 1.9.3
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubyforge_project:
130
+ rubygems_version: 2.0.14
131
+ signing_key:
132
+ specification_version: 4
133
+ summary: Workflow Manager
134
+ test_files: []