openstudio-workflow 1.1.0 → 1.1.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.
- checksums.yaml +4 -4
- data/lib/openstudio/workflow/adapters/output/local.rb +5 -0
- data/lib/openstudio/workflow/adapters/output/socket.rb +21 -0
- data/lib/openstudio/workflow/adapters/output/web.rb +4 -0
- data/lib/openstudio/workflow/adapters/output_adapter.rb +4 -0
- data/lib/openstudio/workflow/util/measure.rb +7 -1
- data/lib/openstudio/workflow/version.rb +1 -1
- data/lib/openstudio/workflow_json.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 532be0c06d55d26e5093d3ab50408d22a959ec5e
|
4
|
+
data.tar.gz: 2d1a4981f3064bb321a26adba13b865c4cf8fa7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e993c121bd067a2ed62531e7fd53d49193fac78f50cb4965eae72346b799255935a076325aacb19bbd202150ca90b7eb4eebf7eaf532588d2e651c5fdf58465f
|
7
|
+
data.tar.gz: ca03998c2563d734ed1b975538f5b7375a270bfa79128d5142380b8e4ff51e32e90b876ae23d9afd89af829606936c6d64d0396f5aff784f7bc038cbb0619d2d
|
@@ -64,6 +64,27 @@ module OpenStudio
|
|
64
64
|
super
|
65
65
|
@socket.write(line)
|
66
66
|
end
|
67
|
+
|
68
|
+
def communicate_measure_result(result, options = {})
|
69
|
+
super
|
70
|
+
|
71
|
+
step_result = result.stepResult
|
72
|
+
initial_condition = result.stepInitialCondition
|
73
|
+
final_condition = result.stepFinalCondition
|
74
|
+
errors = result.stepErrors
|
75
|
+
warnings = result.stepWarnings
|
76
|
+
infos = result.stepInfo
|
77
|
+
|
78
|
+
# Mirrors WorkflowStepResult::string
|
79
|
+
tab = ' '
|
80
|
+
@socket.write("#{tab}Result: #{step_result.get.valueName}\n") if !step_result.empty?
|
81
|
+
@socket.write("#{tab}Initial Condition: #{initial_condition.get}\n") if !initial_condition.empty?
|
82
|
+
@socket.write("#{tab}Final Condition: #{final_condition.get}\n") if !final_condition.empty?
|
83
|
+
errors.each {|error| @socket.write("#{tab}Error: #{error}\n") }
|
84
|
+
warnings.each {|warning| @socket.write("#{tab}Warn: #{warning}\n") }
|
85
|
+
infos.each {|info| @socket.write("#{tab}Info: #{info}\n") }
|
86
|
+
end
|
87
|
+
|
67
88
|
end
|
68
89
|
end
|
69
90
|
end
|
@@ -39,6 +39,10 @@ module OpenStudio
|
|
39
39
|
instance.communicate_energyplus_stdout line, options
|
40
40
|
end
|
41
41
|
|
42
|
+
def communicate_measure_result(result, options = {})
|
43
|
+
instance.communicate_measure_result result, options
|
44
|
+
end
|
45
|
+
|
42
46
|
def communicate_measure_attributes(measure_attributes, options = {})
|
43
47
|
instance.communicate_measure_attributes measure_attributes, options
|
44
48
|
end
|
@@ -414,11 +414,15 @@ module OpenStudio
|
|
414
414
|
# add the error to the osw.out
|
415
415
|
runner.registerError("#{e.message}\n\t#{e.backtrace.join("\n\t")}")
|
416
416
|
|
417
|
+
result = runner.result
|
418
|
+
|
417
419
|
if !energyplus_output_requests
|
418
420
|
# incrementStep must be called after run
|
419
421
|
runner.incrementStep
|
420
422
|
end
|
421
423
|
|
424
|
+
options[:output_adapter].communicate_measure_result(result) if options[:output_adapter]
|
425
|
+
|
422
426
|
log_message = "Runner error #{__FILE__} failed with #{e.message}, #{e.backtrace.join("\n")}"
|
423
427
|
raise log_message
|
424
428
|
end
|
@@ -435,9 +439,11 @@ module OpenStudio
|
|
435
439
|
|
436
440
|
# incrementStep must be called after run
|
437
441
|
runner.incrementStep
|
442
|
+
|
443
|
+
options[:output_adapter].communicate_measure_result(result) if options[:output_adapter]
|
438
444
|
|
439
445
|
errors = result.stepErrors
|
440
|
-
|
446
|
+
|
441
447
|
fail "Measure #{measure_dir_name} reported an error with #{errors}" if errors.size != 0
|
442
448
|
logger.debug "Running of measure '#{measure_dir_name}' completed. Post-processing measure output"
|
443
449
|
|
@@ -54,6 +54,13 @@ unless s.respond_to?(:to_VariantType)
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
57
|
+
unless s.respond_to?(:valueName)
|
58
|
+
class String
|
59
|
+
def valueName
|
60
|
+
self
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
57
64
|
|
58
65
|
# WorkflowStepResultValue_Shim provides a shim interface to the WorkflowStepResultValue class in OpenStudio 2.X when running in OpenStudio 1.X
|
59
66
|
class WorkflowStepResultValue_Shim
|
@@ -94,6 +101,20 @@ class WorkflowStepResult_Shim
|
|
94
101
|
@result = result
|
95
102
|
end
|
96
103
|
|
104
|
+
def stepInitialCondition
|
105
|
+
if @result[:initial_condition]
|
106
|
+
return Optional_Shim.new(@result[:initial_condition])
|
107
|
+
end
|
108
|
+
return Optional_Shim.new(nil)
|
109
|
+
end
|
110
|
+
|
111
|
+
def stepFinalCondition
|
112
|
+
if @result[:final_condition]
|
113
|
+
return Optional_Shim.new(@result[:final_condition])
|
114
|
+
end
|
115
|
+
return Optional_Shim.new(nil)
|
116
|
+
end
|
117
|
+
|
97
118
|
def stepErrors
|
98
119
|
return @result[:step_errors]
|
99
120
|
end
|
@@ -121,6 +142,7 @@ class WorkflowStepResult_Shim
|
|
121
142
|
def setStepResult(step_result)
|
122
143
|
@result[:step_result] = step_result
|
123
144
|
end
|
145
|
+
|
124
146
|
end
|
125
147
|
|
126
148
|
# WorkflowStep_Shim provides a shim interface to the WorkflowStep class in OpenStudio 2.X when running in OpenStudio 1.X
|
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.1.
|
4
|
+
version: 1.1.1
|
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-02-
|
12
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|