rbbt-util 5.21.8 → 5.21.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/util/misc/pipes.rb +5 -0
- data/lib/rbbt/workflow/accessor.rb +1 -1
- data/share/rbbt_commands/workflow/info +7 -0
- data/share/rbbt_commands/workflow/prov +76 -1
- 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: b865dd691227ababbe46a03ea0ed6960754aea22
|
4
|
+
data.tar.gz: 7d68152324663bf6e220f3f66faa9e585815f30f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff5692023b4ba9aaca267200230eca86ef7f269a7d76f0d1770e4adc54dd436101bf98023f252c01c970c51a01bf311a88b31d7251fded28a4a5394870312149
|
7
|
+
data.tar.gz: f1cc66e3892f332b0dca011c06a3b952f0517f18aba6b3e3dda8550b4d3503d77702a90abad1aa65b06256ebea5e566f3f14fc46b2d1994814c7e9ac623970a0
|
data/lib/rbbt/util/misc/pipes.rb
CHANGED
@@ -16,6 +16,7 @@ $ rbbt workflow info <job-result>
|
|
16
16
|
-h--help Help
|
17
17
|
-a--all Print all info entries
|
18
18
|
-r--recursive Print recursive input values
|
19
|
+
-o--original Print original object
|
19
20
|
EOF
|
20
21
|
|
21
22
|
SOPT.usage if options[:help]
|
@@ -59,6 +60,12 @@ end
|
|
59
60
|
step = get_step file
|
60
61
|
|
61
62
|
info = step.info
|
63
|
+
|
64
|
+
if options[:original]
|
65
|
+
puts info.inspect
|
66
|
+
exit 0
|
67
|
+
end
|
68
|
+
|
62
69
|
dependencies = info[:dependencies]
|
63
70
|
inputs = info[:inputs]
|
64
71
|
status = info[:status]
|
@@ -19,6 +19,7 @@ Examine the provenance of a job result
|
|
19
19
|
$ rbbt workflow prov <job-result>
|
20
20
|
|
21
21
|
-h--help Help
|
22
|
+
-p--plot* draw the dependency plot into <file.png>
|
22
23
|
EOF
|
23
24
|
|
24
25
|
SOPT.usage if options[:help]
|
@@ -82,4 +83,78 @@ end
|
|
82
83
|
step = get_step file
|
83
84
|
$main_mtime = File.exist?(step.path) ? File.mtime(step.path) : nil
|
84
85
|
|
85
|
-
|
86
|
+
def adjacency(step)
|
87
|
+
|
88
|
+
info = step.info || {}
|
89
|
+
path = step.path
|
90
|
+
status = info[:status] || :missing
|
91
|
+
status = "remote" if Open.remote?(path)
|
92
|
+
if status == 'remote'
|
93
|
+
workflow, task, name = path.sub(/\{.*/,'').split("/")[-3..-1]
|
94
|
+
else
|
95
|
+
workflow, task, name = path.split("/")[-3..-1]
|
96
|
+
end
|
97
|
+
name = name.split(":").last
|
98
|
+
status = :unsync if status == :done and not File.exist? path
|
99
|
+
edge_info = {:status => status, :workflow => workflow, :task => task, :name => name, :label => task, :shape => shapes[workflow], :color => status == 'remote' ? 'blue' : 'green'}
|
100
|
+
id = Misc.digest(path)
|
101
|
+
edges = []
|
102
|
+
node_info = {}
|
103
|
+
node_info[id] = edge_info
|
104
|
+
if info[:dependencies]
|
105
|
+
info[:dependencies].each do |task,name,path|
|
106
|
+
dep = get_step path
|
107
|
+
_id, _edges, _node_info = adjacency(dep)
|
108
|
+
edges << [id, _id]
|
109
|
+
edges.concat _edges
|
110
|
+
node_info.merge!(_node_info)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
[id, edges, node_info]
|
115
|
+
end
|
116
|
+
|
117
|
+
if options[:plot]
|
118
|
+
id, edges, node_info = adjacency(step)
|
119
|
+
node_info[id][:color] = 'red'
|
120
|
+
TmpFile.with_file do |edge_file|
|
121
|
+
Open.write(edge_file) do |f|
|
122
|
+
f.puts "from,to"
|
123
|
+
edges.each do |from,to|
|
124
|
+
f.puts [from,to]*","
|
125
|
+
end
|
126
|
+
end
|
127
|
+
TmpFile.with_file do |node_info_file|
|
128
|
+
Open.write(node_info_file) do |f|
|
129
|
+
fields = node_info.first.last.keys
|
130
|
+
f.puts "id," + fields * ","
|
131
|
+
node_info.each do |id,info|
|
132
|
+
f.puts ([id] + info.values_at(*fields)) * ","
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
require 'rbbt/util/R'
|
137
|
+
|
138
|
+
ppp Open.read edge_file
|
139
|
+
ppp Open.read node_info_file
|
140
|
+
|
141
|
+
R.run <<-EOF
|
142
|
+
nodes <- read.csv("#{node_info_file}", header=T, as.is=T)
|
143
|
+
links <- read.csv("#{edge_file}", header=T, as.is=T)
|
144
|
+
|
145
|
+
library(igraph)
|
146
|
+
|
147
|
+
net <- graph.data.frame(links, nodes, directed=T)
|
148
|
+
net <- simplify(net, remove.multiple = F, remove.loops = T)
|
149
|
+
|
150
|
+
png("#{options[:plot]}")
|
151
|
+
plot(net, edge.arrow.size=0.4, vertex.label=net$label, vertex.color=net$color)
|
152
|
+
dev.off()
|
153
|
+
EOF
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
else
|
158
|
+
puts report(step).strip
|
159
|
+
end
|
160
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.21.
|
4
|
+
version: 5.21.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|