rbbt-util 5.44.1 → 6.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rbbt +67 -90
- data/etc/app.d/base.rb +2 -2
- data/etc/app.d/semaphores.rb +3 -3
- data/lib/rbbt/annotations/annotated_array.rb +207 -207
- data/lib/rbbt/annotations/refactor.rb +27 -0
- data/lib/rbbt/annotations/util.rb +282 -282
- data/lib/rbbt/annotations.rb +343 -320
- data/lib/rbbt/association/database.rb +200 -225
- data/lib/rbbt/association/index.rb +294 -291
- data/lib/rbbt/association/item.rb +227 -227
- data/lib/rbbt/association/open.rb +35 -34
- data/lib/rbbt/association/util.rb +0 -169
- data/lib/rbbt/association.rb +2 -4
- data/lib/rbbt/entity/identifiers.rb +119 -118
- data/lib/rbbt/entity/refactor.rb +12 -0
- data/lib/rbbt/entity.rb +319 -315
- data/lib/rbbt/hpc/batch.rb +72 -53
- data/lib/rbbt/hpc/lsf.rb +2 -2
- data/lib/rbbt/hpc/orchestrate/batches.rb +2 -2
- data/lib/rbbt/hpc/orchestrate/chains.rb +25 -5
- data/lib/rbbt/hpc/orchestrate/rules.rb +2 -2
- data/lib/rbbt/hpc/orchestrate.rb +19 -13
- data/lib/rbbt/hpc/slurm.rb +18 -18
- data/lib/rbbt/knowledge_base/entity.rb +13 -5
- data/lib/rbbt/knowledge_base/query.rb +2 -2
- data/lib/rbbt/knowledge_base/registry.rb +32 -31
- data/lib/rbbt/knowledge_base/traverse.rb +1 -1
- data/lib/rbbt/knowledge_base.rb +1 -1
- data/lib/rbbt/monitor.rb +36 -25
- data/lib/rbbt/persist/refactor.rb +166 -0
- data/lib/rbbt/persist/tsv/tokyocabinet.rb +105 -105
- data/lib/rbbt/persist/tsv.rb +187 -185
- data/lib/rbbt/persist.rb +556 -551
- data/lib/rbbt/refactor.rb +20 -0
- data/lib/rbbt/resource/path/refactor.rb +178 -0
- data/lib/rbbt/resource/path.rb +317 -497
- data/lib/rbbt/resource/util.rb +0 -48
- data/lib/rbbt/resource.rb +3 -390
- data/lib/rbbt/tsv/accessor.rb +2 -838
- data/lib/rbbt/tsv/attach.rb +303 -299
- data/lib/rbbt/tsv/change_id.rb +244 -245
- data/lib/rbbt/tsv/csv.rb +87 -85
- data/lib/rbbt/tsv/dumper.rb +2 -100
- data/lib/rbbt/tsv/excel.rb +26 -24
- data/lib/rbbt/tsv/field_index.rb +4 -1
- data/lib/rbbt/tsv/filter.rb +3 -2
- data/lib/rbbt/tsv/index.rb +2 -284
- data/lib/rbbt/tsv/manipulate.rb +750 -747
- data/lib/rbbt/tsv/marshal.rb +3 -3
- data/lib/rbbt/tsv/matrix.rb +2 -2
- data/lib/rbbt/tsv/parallel/through.rb +2 -1
- data/lib/rbbt/tsv/parallel/traverse.rb +783 -781
- data/lib/rbbt/tsv/parser.rb +678 -678
- data/lib/rbbt/tsv/refactor.rb +195 -0
- data/lib/rbbt/tsv/stream.rb +253 -251
- data/lib/rbbt/tsv/util.rb +420 -420
- data/lib/rbbt/tsv.rb +210 -208
- data/lib/rbbt/util/R/eval.rb +4 -4
- data/lib/rbbt/util/R/plot.rb +62 -166
- data/lib/rbbt/util/R.rb +21 -18
- data/lib/rbbt/util/cmd.rb +2 -318
- data/lib/rbbt/util/color.rb +269 -269
- data/lib/rbbt/util/colorize.rb +89 -89
- data/lib/rbbt/util/concurrency/processes/refactor.rb +22 -0
- data/lib/rbbt/util/concurrency/processes/worker.rb +2 -2
- data/lib/rbbt/util/concurrency/processes.rb +389 -386
- data/lib/rbbt/util/config.rb +169 -167
- data/lib/rbbt/util/iruby.rb +20 -0
- data/lib/rbbt/util/log/progress/report.rb +241 -241
- data/lib/rbbt/util/log/progress/util.rb +99 -99
- data/lib/rbbt/util/log/progress.rb +102 -102
- data/lib/rbbt/util/log/refactor.rb +49 -0
- data/lib/rbbt/util/log.rb +486 -532
- data/lib/rbbt/util/migrate.rb +1 -1
- data/lib/rbbt/util/misc/concurrent_stream.rb +248 -246
- data/lib/rbbt/util/misc/development.rb +12 -11
- data/lib/rbbt/util/misc/exceptions.rb +117 -112
- data/lib/rbbt/util/misc/format.rb +2 -230
- data/lib/rbbt/util/misc/indiferent_hash.rb +2 -107
- data/lib/rbbt/util/misc/inspect.rb +2 -476
- data/lib/rbbt/util/misc/lock.rb +109 -106
- data/lib/rbbt/util/misc/omics.rb +9 -1
- data/lib/rbbt/util/misc/pipes.rb +765 -793
- data/lib/rbbt/util/misc/refactor.rb +20 -0
- data/lib/rbbt/util/misc/ssw.rb +27 -17
- data/lib/rbbt/util/misc/system.rb +0 -15
- data/lib/rbbt/util/misc.rb +39 -20
- data/lib/rbbt/util/named_array/refactor.rb +4 -0
- data/lib/rbbt/util/named_array.rb +3 -220
- data/lib/rbbt/util/open/refactor.rb +7 -0
- data/lib/rbbt/util/open.rb +3 -857
- data/lib/rbbt/util/procpath.rb +6 -6
- data/lib/rbbt/util/python/paths.rb +27 -0
- data/lib/rbbt/util/python/run.rb +115 -0
- data/lib/rbbt/util/python/script.rb +110 -0
- data/lib/rbbt/util/python/util.rb +3 -3
- data/lib/rbbt/util/python.rb +22 -81
- data/lib/rbbt/util/semaphore.rb +152 -148
- data/lib/rbbt/util/simpleopt.rb +9 -8
- data/lib/rbbt/util/ssh/refactor.rb +19 -0
- data/lib/rbbt/util/ssh.rb +122 -118
- data/lib/rbbt/util/tar.rb +117 -115
- data/lib/rbbt/util/tmpfile.rb +69 -67
- data/lib/rbbt/util/version.rb +2 -0
- data/lib/rbbt/workflow/refactor/entity.rb +11 -0
- data/lib/rbbt/workflow/refactor/export.rb +66 -0
- data/lib/rbbt/workflow/refactor/inputs.rb +24 -0
- data/lib/rbbt/workflow/refactor/recursive.rb +64 -0
- data/lib/rbbt/workflow/refactor/task_info.rb +65 -0
- data/lib/rbbt/workflow/refactor.rb +153 -0
- data/lib/rbbt/workflow/remote_workflow/driver/ssh.rb +55 -32
- data/lib/rbbt/workflow/remote_workflow/remote_step/rest.rb +3 -1
- data/lib/rbbt/workflow/remote_workflow/remote_step/ssh.rb +14 -5
- data/lib/rbbt/workflow/remote_workflow/remote_step.rb +19 -7
- data/lib/rbbt/workflow/remote_workflow.rb +6 -1
- data/lib/rbbt/workflow/step/run.rb +766 -766
- data/lib/rbbt/workflow/step/save_load_inputs.rb +254 -254
- data/lib/rbbt/workflow/step.rb +2 -362
- data/lib/rbbt/workflow/task.rb +118 -118
- data/lib/rbbt/workflow/usage.rb +289 -287
- data/lib/rbbt/workflow/util/archive.rb +6 -5
- data/lib/rbbt/workflow/util/data.rb +1 -1
- data/lib/rbbt/workflow/util/orchestrator.rb +249 -246
- data/lib/rbbt/workflow/util/trace.rb +79 -44
- data/lib/rbbt/workflow.rb +4 -882
- data/lib/rbbt-util.rb +21 -13
- data/lib/rbbt.rb +16 -3
- data/python/rbbt/__init__.py +19 -1
- data/share/Rlib/plot.R +37 -37
- data/share/Rlib/svg.R +22 -5
- data/share/install/software/lib/install_helpers +1 -1
- data/share/rbbt_commands/hpc/list +2 -3
- data/share/rbbt_commands/hpc/orchestrate +4 -4
- data/share/rbbt_commands/hpc/tail +2 -0
- data/share/rbbt_commands/hpc/task +10 -7
- data/share/rbbt_commands/lsf/list +2 -3
- data/share/rbbt_commands/lsf/orchestrate +4 -4
- data/share/rbbt_commands/lsf/tail +2 -0
- data/share/rbbt_commands/lsf/task +10 -7
- data/share/rbbt_commands/migrate +1 -1
- data/share/rbbt_commands/pbs/list +2 -3
- data/share/rbbt_commands/pbs/orchestrate +4 -4
- data/share/rbbt_commands/pbs/tail +2 -0
- data/share/rbbt_commands/pbs/task +10 -7
- data/share/rbbt_commands/resource/produce +8 -1
- data/share/rbbt_commands/slurm/list +2 -3
- data/share/rbbt_commands/slurm/orchestrate +4 -4
- data/share/rbbt_commands/slurm/tail +2 -0
- data/share/rbbt_commands/slurm/task +10 -7
- data/share/rbbt_commands/system/clean +5 -5
- data/share/rbbt_commands/system/status +5 -5
- data/share/rbbt_commands/tsv/get +2 -3
- data/share/rbbt_commands/tsv/info +10 -13
- data/share/rbbt_commands/tsv/keys +18 -14
- data/share/rbbt_commands/tsv/slice +2 -2
- data/share/rbbt_commands/tsv/transpose +6 -2
- data/share/rbbt_commands/workflow/info +20 -24
- data/share/rbbt_commands/workflow/list +1 -1
- data/share/rbbt_commands/workflow/prov +20 -13
- data/share/rbbt_commands/workflow/server +11 -1
- data/share/rbbt_commands/workflow/task +76 -71
- data/share/rbbt_commands/workflow/write_info +26 -9
- data/share/software/opt/ssw/ssw.c +861 -0
- data/share/software/opt/ssw/ssw.h +130 -0
- data/share/workflow_config.ru +3 -3
- metadata +40 -2
data/lib/rbbt/workflow/usage.rb
CHANGED
@@ -1,287 +1,289 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
puts
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
if
|
31
|
-
|
32
|
-
|
33
|
-
puts " #{Log.color :yellow, task.name.to_s}:"
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
puts unless Log.compact
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
the '
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
when
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
if child
|
131
|
-
|
132
|
-
|
133
|
-
description << "" << task_name.to_s
|
134
|
-
|
135
|
-
description << "
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
puts
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
task_name = task
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
puts Log.color :
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
inputs
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
puts
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
workflow.
|
286
|
-
|
287
|
-
|
1
|
+
require_relative '../refactor'
|
2
|
+
Rbbt.require_instead 'scout/workflow/usage'
|
3
|
+
#require 'rbbt/util/simpleopt'
|
4
|
+
#
|
5
|
+
#module Task
|
6
|
+
# def doc(workflow = nil, deps = nil)
|
7
|
+
# puts Log.color(:yellow, "## #{ name }") << ":"
|
8
|
+
# puts "\n" << Misc.format_paragraph(description.strip) << "\n" if description and not description.empty?
|
9
|
+
# puts
|
10
|
+
#
|
11
|
+
# selects = []
|
12
|
+
# if inputs.any?
|
13
|
+
# inputs.zip(input_types.values_at(*inputs)).select{|i,t| t.to_sym == :select && input_options[i] && input_options[i][:select_options] }.each{|i,t| selects << [i, input_options[i][:select_options]] }
|
14
|
+
# puts SOPT.input_doc(inputs, input_types, input_descriptions, input_defaults, true)
|
15
|
+
# puts
|
16
|
+
# end
|
17
|
+
#
|
18
|
+
# if deps and deps.any?
|
19
|
+
# puts Log.color(:magenta, "Inputs from dependencies:")
|
20
|
+
# puts
|
21
|
+
# seen = []
|
22
|
+
# task_inputs = dep_inputs deps, workflow
|
23
|
+
# task_inputs.each do |task,new_inputs|
|
24
|
+
# new_inputs.zip(task.input_types.values_at(*new_inputs)).select do |i,t|
|
25
|
+
# t.to_sym == :select && task.input_options.include?(i) && task.input_options[i][:select_options]
|
26
|
+
# end.each do |i,t|
|
27
|
+
# selects << [i, task.input_options[i][:select_options]]
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# next if new_inputs.empty?
|
31
|
+
#
|
32
|
+
# if task.workflow and task.workflow != workflow
|
33
|
+
# puts " #{Log.color :yellow, ["[#{task.workflow.to_s}]", task.name.to_s] *" "}:"
|
34
|
+
# else
|
35
|
+
# puts " #{Log.color :yellow, task.name.to_s}:"
|
36
|
+
# end
|
37
|
+
# puts unless Log.compact
|
38
|
+
# puts SOPT.input_doc(new_inputs, task.input_types, task.input_descriptions, task.input_defaults, true)
|
39
|
+
# puts unless Log.compact
|
40
|
+
# end
|
41
|
+
# puts
|
42
|
+
# end
|
43
|
+
#
|
44
|
+
# case
|
45
|
+
# when (input_types.values & [:array]).any?
|
46
|
+
# puts Log.color(:green, Misc.format_paragraph("Lists are specified as arguments using ',' or '|'. When specified as files the '\\n'
|
47
|
+
# also works in addition to the others. You may use the '--array_separator' option
|
48
|
+
# the change this default. Whenever a file is specified it may also accept STDIN using
|
49
|
+
# the '-' character."))
|
50
|
+
# puts
|
51
|
+
#
|
52
|
+
# when (input_types.values & [:text, :tsv]).any?
|
53
|
+
# puts Log.color(:green, Misc.format_paragraph("Whenever a file is specified it may also accept STDIN using the '-' character."))
|
54
|
+
# puts
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# puts Log.color(:magenta, "Returns: ") << Log.color(:blue, result_type.to_s) << "\n"
|
58
|
+
# puts
|
59
|
+
#
|
60
|
+
# if selects.any?
|
61
|
+
# puts Log.color(:magenta, "Input select options")
|
62
|
+
# puts
|
63
|
+
# selects.collect{|p| p}.uniq.each do |input,options|
|
64
|
+
# puts Log.color(:blue, input.to_s + ": ") << Misc.format_paragraph(options.collect{|o| Array === o ? o.first.to_s : o.to_s} * ", ") << "\n"
|
65
|
+
# puts unless Log.compact
|
66
|
+
# end
|
67
|
+
# puts
|
68
|
+
# end
|
69
|
+
# end
|
70
|
+
#end
|
71
|
+
#
|
72
|
+
#module Workflow
|
73
|
+
#
|
74
|
+
# def dep_tree(name, seen = [])
|
75
|
+
# @dep_tree ||= {}
|
76
|
+
# @dep_tree[name] ||= begin
|
77
|
+
# dep_tree = {}
|
78
|
+
# self.task_dependencies[name.to_sym].reverse.each do |dep|
|
79
|
+
# next if seen.include? dep
|
80
|
+
# seen << dep
|
81
|
+
# dep = dep.first if Array === dep && dep.length == 1
|
82
|
+
# dep = dep.dependency if DependencyBlock === dep
|
83
|
+
#
|
84
|
+
# workflow, task = case dep
|
85
|
+
# when Array
|
86
|
+
# dep.values_at 0, 1
|
87
|
+
# when Symbol, String
|
88
|
+
# [self, dep]
|
89
|
+
# else
|
90
|
+
# next
|
91
|
+
# end
|
92
|
+
#
|
93
|
+
#
|
94
|
+
# key = [workflow, task]
|
95
|
+
#
|
96
|
+
# dep_tree[key] = workflow.dep_tree(task, seen)
|
97
|
+
# end if name && self.task_dependencies[name.to_sym]
|
98
|
+
# dep_tree
|
99
|
+
# end
|
100
|
+
# end
|
101
|
+
#
|
102
|
+
# def _prov_tasks(tree)
|
103
|
+
# tasks = []
|
104
|
+
# heap = [tree]
|
105
|
+
# while heap.any?
|
106
|
+
# t = heap.pop
|
107
|
+
# t.each do |k,v|
|
108
|
+
# tasks << k
|
109
|
+
# heap << v
|
110
|
+
# end
|
111
|
+
# end
|
112
|
+
# tasks
|
113
|
+
# end
|
114
|
+
#
|
115
|
+
# def prov_string(tree)
|
116
|
+
# description = ""
|
117
|
+
#
|
118
|
+
# last = nil
|
119
|
+
# seen = Set.new
|
120
|
+
#
|
121
|
+
# tasks = _prov_tasks(tree)
|
122
|
+
# tasks.each do |workflow,task_name|
|
123
|
+
#
|
124
|
+
# next if seen.include?([workflow,task_name])
|
125
|
+
#
|
126
|
+
# child = last && last.include?([workflow, task_name])
|
127
|
+
# first = last.nil?
|
128
|
+
# last = _prov_tasks(workflow.dep_tree(task_name))
|
129
|
+
#
|
130
|
+
# break if child
|
131
|
+
#
|
132
|
+
# if child
|
133
|
+
# description << "->" << task_name.to_s
|
134
|
+
# elsif first
|
135
|
+
# description << "" << task_name.to_s
|
136
|
+
# else
|
137
|
+
# description << ";" << task_name.to_s
|
138
|
+
# end
|
139
|
+
#
|
140
|
+
# seen << [workflow, task_name]
|
141
|
+
# end
|
142
|
+
# description
|
143
|
+
# end
|
144
|
+
#
|
145
|
+
# def prov_tree(tree, offset = 0, seen = [])
|
146
|
+
#
|
147
|
+
# return "" if tree.empty?
|
148
|
+
#
|
149
|
+
# lines = []
|
150
|
+
#
|
151
|
+
# offset_str = " " * offset
|
152
|
+
#
|
153
|
+
# lines << offset_str
|
154
|
+
#
|
155
|
+
# tree.each do |p,dtree|
|
156
|
+
# next if seen.include?(p)
|
157
|
+
# seen.push(p)
|
158
|
+
# workflow, task = p
|
159
|
+
# lines << offset_str + [workflow.to_s, task.to_s] * "#" + "\n" + workflow.prov_tree(dtree, offset + 1, seen)
|
160
|
+
# end
|
161
|
+
#
|
162
|
+
# lines * "\n"
|
163
|
+
# end
|
164
|
+
#
|
165
|
+
# def doc(task = nil, abridge = false)
|
166
|
+
#
|
167
|
+
# if task.nil?
|
168
|
+
# puts Log.color :magenta, self.to_s
|
169
|
+
# puts Log.color :magenta, "=" * self.to_s.length
|
170
|
+
#
|
171
|
+
# if self.documentation[:title] and not self.documentation[:title].empty?
|
172
|
+
# puts
|
173
|
+
# puts Misc.format_paragraph self.documentation[:title]
|
174
|
+
# end
|
175
|
+
#
|
176
|
+
# if self.documentation[:description] and not self.documentation[:description].empty?
|
177
|
+
# puts
|
178
|
+
# puts Misc.format_paragraph self.documentation[:description]
|
179
|
+
# end
|
180
|
+
# puts
|
181
|
+
#
|
182
|
+
# puts Log.color :magenta, "## TASKS"
|
183
|
+
# if self.documentation[:task_description] and not self.documentation[:task_description].empty?
|
184
|
+
# puts
|
185
|
+
# puts Misc.format_paragraph self.documentation[:task_description]
|
186
|
+
# end
|
187
|
+
# puts
|
188
|
+
#
|
189
|
+
# final = Set.new
|
190
|
+
# not_final = Set.new
|
191
|
+
# tasks.each do |name,task|
|
192
|
+
# tree = dep_tree(name)
|
193
|
+
# not_final += tree.keys
|
194
|
+
# final << name unless not_final.include?(name)
|
195
|
+
# end
|
196
|
+
#
|
197
|
+
# not_final.each do |p|
|
198
|
+
# final -= [p.last]
|
199
|
+
# end
|
200
|
+
#
|
201
|
+
# tasks.each do |name,task|
|
202
|
+
# description = task.description || ""
|
203
|
+
# description = description.split("\n\n").first
|
204
|
+
#
|
205
|
+
# next if abridge && ! final.include?(name)
|
206
|
+
# puts Misc.format_definition_list_item(name.to_s, description, Log.tty_size || 80, 30, :yellow)
|
207
|
+
#
|
208
|
+
# prov_string = prov_string(dep_tree(name))
|
209
|
+
# puts Misc.format_paragraph Log.color(:blue, "->" + prov_string) if prov_string && ! prov_string.empty?
|
210
|
+
# end
|
211
|
+
#
|
212
|
+
# else
|
213
|
+
#
|
214
|
+
# if Task === task
|
215
|
+
# task_name = task.name
|
216
|
+
# else
|
217
|
+
# task_name = task
|
218
|
+
# task = self.tasks[task_name]
|
219
|
+
# end
|
220
|
+
#
|
221
|
+
# #dependencies = self.rec_dependencies(task_name).collect{|dep_name| Array === dep_name ? dep_name.first.tasks[dep_name[1].to_sym] : self.tasks[dep_name.to_sym]}
|
222
|
+
# task.doc(self, self.rec_dependencies(task_name))
|
223
|
+
#
|
224
|
+
# dep_tree = {[self, task_name] => dep_tree(task_name)}
|
225
|
+
# prov_tree = prov_tree(dep_tree)
|
226
|
+
# if prov_tree && ! prov_tree.empty? && prov_tree.split("\n").length > 2
|
227
|
+
#
|
228
|
+
# puts Log.color :magenta, "## DEPENDENCY GRAPH (abridged)"
|
229
|
+
# puts
|
230
|
+
# prov_tree.split("\n").each do |line|
|
231
|
+
# next if line.strip.empty?
|
232
|
+
# if m = line.match(/^( *)(\w+?)#(\w*)/i)
|
233
|
+
# offset, workflow, task_name = m.values_at 1, 2, 3
|
234
|
+
# puts [offset, Log.color(:magenta, workflow), "#", Log.color(:yellow, task_name)] * ""
|
235
|
+
# else
|
236
|
+
# puts Log.color :blue, line
|
237
|
+
# end
|
238
|
+
# end
|
239
|
+
# puts
|
240
|
+
# end
|
241
|
+
#
|
242
|
+
# if self.examples.include? task_name
|
243
|
+
# self.examples[task_name].each do |example|
|
244
|
+
#
|
245
|
+
# puts Log.color(:magenta, "Example ") << Log.color(:green, example) + " -- " + Log.color(:blue, example_dir[task_name][example])
|
246
|
+
#
|
247
|
+
# inputs = self.example(task_name, example)
|
248
|
+
#
|
249
|
+
# inputs.each do |input, type, file|
|
250
|
+
# case type
|
251
|
+
# when :tsv, :array, :text, :file
|
252
|
+
# lines = file.read.split("\n")
|
253
|
+
# head = lines[0..5].compact * "\n\n"
|
254
|
+
# head = head[0..500]
|
255
|
+
# puts Misc.format_definition_list_item(input, head, 1000, -1, :blue).gsub(/\n\s*\n/,"\n")
|
256
|
+
# puts '...' if lines.length > 6
|
257
|
+
# else
|
258
|
+
# puts Misc.format_definition_list_item(input, file.read, Log.tty_size, 20, :blue)
|
259
|
+
# end
|
260
|
+
# end
|
261
|
+
# puts
|
262
|
+
# end
|
263
|
+
# end
|
264
|
+
# end
|
265
|
+
# end
|
266
|
+
#
|
267
|
+
# def SOPT_str(task)
|
268
|
+
# sopt_options = []
|
269
|
+
# self.rec_inputs(task.name).each do |name|
|
270
|
+
# short = name.to_s.chars.first
|
271
|
+
# boolean = self.rec_input_types(task.name)[name].to_sym == :boolean
|
272
|
+
#
|
273
|
+
# sopt_options << "-#{short}--#{name}#{boolean ? "" : "*"}"
|
274
|
+
# end
|
275
|
+
#
|
276
|
+
# sopt_options * ":"
|
277
|
+
# end
|
278
|
+
#
|
279
|
+
# def get_SOPT(task)
|
280
|
+
# sopt_option_string = self.SOPT_str(task)
|
281
|
+
# SOPT.get sopt_option_string
|
282
|
+
# end
|
283
|
+
#
|
284
|
+
# def self.get_SOPT(workflow, task)
|
285
|
+
# workflow = Workflow.require_workflow workflow if String === workflow
|
286
|
+
# task = workflow.tasks[task.to_sym] if String === task || Symbol === task
|
287
|
+
# workflow.get_SOPT(task)
|
288
|
+
# end
|
289
|
+
#end
|
@@ -28,7 +28,7 @@ class Step
|
|
28
28
|
seen = Set.new
|
29
29
|
while deps.any?
|
30
30
|
path = deps.shift
|
31
|
-
dep =
|
31
|
+
dep = Step.load path
|
32
32
|
seen << dep.path
|
33
33
|
dep.dependencies.each do |dep|
|
34
34
|
next if seen.include? dep.path
|
@@ -83,10 +83,10 @@ class Step
|
|
83
83
|
while deps.any?
|
84
84
|
path = deps.shift
|
85
85
|
|
86
|
-
dep =
|
86
|
+
dep = Step.load path
|
87
87
|
seen << dep.path
|
88
88
|
|
89
|
-
dep.load_dependencies_from_info
|
89
|
+
#dep.load_dependencies_from_info
|
90
90
|
|
91
91
|
dep.dependencies.each do |dep|
|
92
92
|
next if seen.include? dep.path
|
@@ -96,7 +96,7 @@ class Step
|
|
96
96
|
end
|
97
97
|
|
98
98
|
rec_dependencies.each do |path|
|
99
|
-
dep = Workflow.load_step path
|
99
|
+
dep = Workflow.load_step path.dup
|
100
100
|
job_files << dep.path
|
101
101
|
job_files << dep.files_dir if Dir.glob(dep.files_dir + '/*').any?
|
102
102
|
job_files << dep.info_file if File.exist?(dep.info_file)
|
@@ -120,7 +120,8 @@ class Step
|
|
120
120
|
if File.directory?(target)
|
121
121
|
CMD.cmd_log("rsync #{MAIN_RSYNC_ARGS} --copy-unsafe-links '#{ tmpdir }/' '#{ target }/'")
|
122
122
|
else
|
123
|
-
|
123
|
+
Misc.tarize('.', target)
|
124
|
+
#CMD.cmd_log("tar cvhzf '#{target}' ./*")
|
124
125
|
end
|
125
126
|
end
|
126
127
|
Log.debug "Archive finished at: #{target}"
|