Module: OpenStudio::Workflow
- Extended by:
- Workflow
- Included in:
- Workflow
- Defined in:
- lib/openstudio-workflow.rb,
lib/openstudio/workflow/run.rb,
lib/openstudio/workflow/adapter.rb,
lib/openstudio/workflow/version.rb,
lib/openstudio/workflow/adapters/local.rb,
lib/openstudio/workflow/adapters/mongo.rb,
lib/openstudio/workflow/jobs/lib/apply_measures.rb
Defined Under Namespace
Modules: Adapters, ApplyMeasures Classes: Adapter, Run
Constant Summary collapse
- VERSION =
'0.0.2'
Instance Method Summary collapse
-
#load(adapter_name, run_directory, options = {}) ⇒ Object
Create a new workflow instance using the defined adapter and UUID.
Instance Method Details
#load(adapter_name, run_directory, options = {}) ⇒ Object
Create a new workflow instance using the defined adapter and UUID
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/openstudio-workflow.rb', line 63 def load(adapter_name, run_directory, = {}) defaults = { adapter_options: {} } = defaults.merge() # Convert various paths to absolute paths if [:adapter_options] && [:adapter_options][:mongoid_path] && (Pathname.new [:adapter_options][:mongoid_path]).absolute? == false [:adapter_options][:mongoid_path] = File. [:adapter_options][:mongoid_path] end if [:analysis_root_path] && (Pathname.new [:analysis_root_path]).absolute? == false [:analysis_root_path] = File. [:analysis_root_path] end unless (Pathname.new run_directory).absolute? # relative to wherever you are running the script run_directory = File. run_directory end adapter = load_adapter adapter_name, [:adapter_options] run_klass = OpenStudio::Workflow::Run.new(adapter, run_directory, ) # return the run class run_klass end |