Class: RunPostprocess

Inherits:
OpenStudio::Workflow::Job show all
Includes:
OpenStudio::Workflow::Util::PostProcess
Defined in:
lib/openstudio/workflow/jobs/run_postprocess.rb

Overview

Clean up the run directory. Currently this class does nothing else, although eventually cleanup should become driven and responsive to options

Instance Method Summary collapse

Methods included from OpenStudio::Workflow::Util::PostProcess

#cleanup, #gather_reports, #load_sql_file, #rename_hash_keys, #run_extract_inputs_and_outputs

Constructor Details

#initialize(input_adapter, output_adapter, registry, options = {}) ⇒ RunPostprocess

Returns a new instance of RunPostprocess.



14
15
16
17
18
19
20
# File 'lib/openstudio/workflow/jobs/run_postprocess.rb', line 14

def initialize(input_adapter, output_adapter, registry, options = {})
  defaults = {
    cleanup: true
  }
  options = defaults.merge(options)
  super
end

Instance Method Details

#performObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/openstudio/workflow/jobs/run_postprocess.rb', line 22

def perform
  @logger.debug "Calling #{__method__} in the #{self.class} class"

  # do not skip post_process if halted

  if !@options[:fast]
    @logger.info 'Gathering reports'
    gather_reports(@registry[:run_dir], @registry[:root_dir], @registry[:workflow_json], @logger)
    @logger.info 'Finished gathering reports'
  end

  if @options[:cleanup]
    @logger.info 'Beginning cleanup of the run directory'
    cleanup(@registry[:run_dir], @registry[:root_dir], @logger)
    @logger.info 'Finished cleanup of the run directory'
  else
    @logger.info 'Flag for cleanup in options set to false. Moving to next step.'
  end

  @logger.info 'Finished postprocess'

  nil
end