openstudio-workflow 1.1.5 → 1.2.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.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e9b4f0394bca6c06758fcaa8151bc70d06166656
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9052de122a97f74fd6d4aa573f31d14ee921709d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 6d946e5188f54cedf4e8d1dd8bf9f1bfc93a3443fd34623dd51abedf432162e036e9bcf86fc2f79a9cddd0a2d94d88c91e6f6ce8f5edc5afad31345dc8fac0e1
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d42e9fafcbf20d01b4d74281861678593993263fe72f626681993e0a03ff2bca9106d26dca24ffc34cb8b5d7940c52e60c0b06ac75b5a6c68f24b50310c299a5
         
     | 
| 
         @@ -41,6 +41,7 @@ class RunInitialization < OpenStudio::Workflow::Job 
     | 
|
| 
       41 
41 
     | 
    
         
             
                @output_adapter.communicate_started
         
     | 
| 
       42 
42 
     | 
    
         | 
| 
       43 
43 
     | 
    
         
             
                # Load various files and set basic directories for the registry
         
     | 
| 
      
 44 
     | 
    
         
            +
                # DLM: this key is the raw JSON object, it is deprecated and should not be used, use :workflow_json instead
         
     | 
| 
       44 
45 
     | 
    
         
             
                @registry.register(:workflow) { @input_adapter.workflow }
         
     | 
| 
       45 
46 
     | 
    
         
             
                raise 'Specified workflow was nil' unless @registry[:workflow]
         
     | 
| 
       46 
47 
     | 
    
         
             
                @logger.debug 'Retrieved the workflow from the adapter'
         
     | 
| 
         @@ -65,6 +66,12 @@ class RunInitialization < OpenStudio::Workflow::Job 
     | 
|
| 
       65 
66 
     | 
    
         | 
| 
       66 
67 
     | 
    
         
             
                @registry.register(:root_dir) { workflow_json.absoluteRootDir }
         
     | 
| 
       67 
68 
     | 
    
         
             
                @logger.debug "The root_dir for the datapoint is #{@registry[:root_dir]}"
         
     | 
| 
      
 69 
     | 
    
         
            +
                
         
     | 
| 
      
 70 
     | 
    
         
            +
                reports_dir = "#{@registry[:root_dir]}/reports"
         
     | 
| 
      
 71 
     | 
    
         
            +
                if File.exist?(reports_dir)
         
     | 
| 
      
 72 
     | 
    
         
            +
                  @logger.debug "Removing existing reports directory: #{reports_dir}"
         
     | 
| 
      
 73 
     | 
    
         
            +
                  FileUtils.rm_rf(reports_dir)
         
     | 
| 
      
 74 
     | 
    
         
            +
                end
         
     | 
| 
       68 
75 
     | 
    
         | 
| 
       69 
76 
     | 
    
         
             
                # create the runner with our WorkflowJSON
         
     | 
| 
       70 
77 
     | 
    
         
             
                @registry.register(:runner) { WorkflowRunner.new(@registry[:logger], @registry[:workflow_json], @registry[:openstudio_2]) }
         
     | 
| 
         @@ -181,7 +181,28 @@ module OpenStudio 
     | 
|
| 
       181 
181 
     | 
    
         
             
                        logger.warn "Value for argument '#{argument_name}' not set in argument list therefore will use default"
         
     | 
| 
       182 
182 
     | 
    
         
             
                      end
         
     | 
| 
       183 
183 
     | 
    
         
             
                    end
         
     | 
| 
       184 
     | 
    
         
            -
             
     | 
| 
      
 184 
     | 
    
         
            +
                    
         
     | 
| 
      
 185 
     | 
    
         
            +
                    # Method to add measure info to WorkflowStepResult
         
     | 
| 
      
 186 
     | 
    
         
            +
                    #
         
     | 
| 
      
 187 
     | 
    
         
            +
                    # @param [Object] result Current WorkflowStepResult
         
     | 
| 
      
 188 
     | 
    
         
            +
                    # @param [Object] measure Current BCLMeasure
         
     | 
| 
      
 189 
     | 
    
         
            +
                    def add_result_measure_info(result, measure)
         
     | 
| 
      
 190 
     | 
    
         
            +
                      begin
         
     | 
| 
      
 191 
     | 
    
         
            +
                        result.setMeasureType(measure.measureType)
         
     | 
| 
      
 192 
     | 
    
         
            +
                        result.setMeasureName(measure.name)
         
     | 
| 
      
 193 
     | 
    
         
            +
                        result.setMeasureId(measure.uid)
         
     | 
| 
      
 194 
     | 
    
         
            +
                        result.setMeasureVersionId(measure.versionId)
         
     | 
| 
      
 195 
     | 
    
         
            +
                        version_modified = measure.versionModified
         
     | 
| 
      
 196 
     | 
    
         
            +
                        if !version_modified.empty?
         
     | 
| 
      
 197 
     | 
    
         
            +
                          result.setMeasureVersionModified(version_modified.get)
         
     | 
| 
      
 198 
     | 
    
         
            +
                        end
         
     | 
| 
      
 199 
     | 
    
         
            +
                        result.setMeasureXmlChecksum(measure.xmlChecksum)
         
     | 
| 
      
 200 
     | 
    
         
            +
                        result.setMeasureClassName(measure.className)
         
     | 
| 
      
 201 
     | 
    
         
            +
                        result.setMeasureDisplayName(measure.displayName)
         
     | 
| 
      
 202 
     | 
    
         
            +
                      rescue NameError
         
     | 
| 
      
 203 
     | 
    
         
            +
                      end
         
     | 
| 
      
 204 
     | 
    
         
            +
                    end
         
     | 
| 
      
 205 
     | 
    
         
            +
                    
         
     | 
| 
       185 
206 
     | 
    
         
             
                    # Method to allow for a single measure of any type to be run
         
     | 
| 
       186 
207 
     | 
    
         
             
                    #
         
     | 
| 
       187 
208 
     | 
    
         
             
                    # @param [String] directory Location of the datapoint directory to run. This is needed
         
     | 
| 
         @@ -394,6 +415,7 @@ module OpenStudio 
     | 
|
| 
       394 
415 
     | 
    
         | 
| 
       395 
416 
     | 
    
         
             
                            current_result = runner.result
         
     | 
| 
       396 
417 
     | 
    
         
             
                            runner.incrementStep
         
     | 
| 
      
 418 
     | 
    
         
            +
                            add_result_measure_info(current_result, measure)
         
     | 
| 
       397 
419 
     | 
    
         
             
                            current_result.setStepResult('Skip'.to_StepResult)
         
     | 
| 
       398 
420 
     | 
    
         
             
                          end
         
     | 
| 
       399 
421 
     | 
    
         
             
                        else
         
     | 
| 
         @@ -431,6 +453,8 @@ module OpenStudio 
     | 
|
| 
       431 
453 
     | 
    
         
             
                            if !energyplus_output_requests
         
     | 
| 
       432 
454 
     | 
    
         
             
                              # incrementStep must be called after run
         
     | 
| 
       433 
455 
     | 
    
         
             
                              runner.incrementStep
         
     | 
| 
      
 456 
     | 
    
         
            +
                              
         
     | 
| 
      
 457 
     | 
    
         
            +
                              add_result_measure_info(result, measure)
         
     | 
| 
       434 
458 
     | 
    
         
             
                            end
         
     | 
| 
       435 
459 
     | 
    
         | 
| 
       436 
460 
     | 
    
         
             
                            options[:output_adapter].communicate_measure_result(result) if options[:output_adapter]
         
     | 
| 
         @@ -452,6 +476,8 @@ module OpenStudio 
     | 
|
| 
       452 
476 
     | 
    
         
             
                            # incrementStep must be called after run
         
     | 
| 
       453 
477 
     | 
    
         
             
                            runner.incrementStep
         
     | 
| 
       454 
478 
     | 
    
         | 
| 
      
 479 
     | 
    
         
            +
                            add_result_measure_info(result, measure)
         
     | 
| 
      
 480 
     | 
    
         
            +
                            
         
     | 
| 
       455 
481 
     | 
    
         
             
                            options[:output_adapter].communicate_measure_result(result) if options[:output_adapter]
         
     | 
| 
       456 
482 
     | 
    
         | 
| 
       457 
483 
     | 
    
         
             
                            errors = result.stepErrors
         
     | 
| 
         @@ -140,10 +140,12 @@ class WorkflowRunner < OpenStudio::Ruleset::OSRunner 
     | 
|
| 
       140 
140 
     | 
    
         | 
| 
       141 
141 
     | 
    
         
             
                  unless os_result.initialCondition.empty?
         
     | 
| 
       142 
142 
     | 
    
         
             
                    current_step.step[:result][:initial_condition] = os_result.initialCondition.get.logMessage
         
     | 
| 
      
 143 
     | 
    
         
            +
                    current_step.step[:result][:step_initial_condition] = os_result.initialCondition.get.logMessage
         
     | 
| 
       143 
144 
     | 
    
         
             
                  end
         
     | 
| 
       144 
145 
     | 
    
         | 
| 
       145 
146 
     | 
    
         
             
                  unless os_result.finalCondition.empty?
         
     | 
| 
       146 
147 
     | 
    
         
             
                    current_step.step[:result][:final_condition] = os_result.finalCondition.get.logMessage
         
     | 
| 
      
 148 
     | 
    
         
            +
                    current_step.step[:result][:step_final_condition] = os_result.finalCondition.get.logMessage
         
     | 
| 
       147 
149 
     | 
    
         
             
                  end
         
     | 
| 
       148 
150 
     | 
    
         | 
| 
       149 
151 
     | 
    
         
             
                  current_step.step[:result][:step_values] = []
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: openstudio-workflow
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Nicholas Long
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2017-03- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2017-03-17 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: bundler
         
     |