rbbt-util 5.32.0 → 5.32.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef9271207cbe69c725a4ab3a8553295d3b68e5f04ec1bfd25ad4654f162ed9cb
4
- data.tar.gz: '087009c9ac6b4fee6d9fa7bceb003e050a0cc1e73f96987ec792c07388760633'
3
+ metadata.gz: 4491182540571f16f4059ec742f210152862e77bda8c31355285c81daf8bfd8e
4
+ data.tar.gz: 313a4e9252f8b443fef52b4267e94b177f9cacd36a89d6db63010b4ae7fb275f
5
5
  SHA512:
6
- metadata.gz: b031c1143992b4c75eeeabcb231d656af2927a5bc46a0ea3527c4c90b7ffcc5eb44b0ec02ef9e31d4879fcf2b3192165ba5b22cd1978dc5250eec355f2556bdc
7
- data.tar.gz: eb43875132a5f4ddc7ff9ae5dcaed7677c6bff84a4d61454cad9a83361d2a3dd63432cd5b28c656cd9e7bb589b8517bbdd3b57c0fa370527724d3ae55810b0cb
6
+ metadata.gz: 81b4b06eac8a44027a0c0f97510c75a2b0f3daf6594da4cd977c5d197318ee7e22db35e0c12f68dced5ab5aa0c1f0c152be77ed7bafe8c5588f2d274292b2035
7
+ data.tar.gz: 5ea83c058de9bde5bbae17b1c08308a7311c5c48d1c589f236300c3f437b667bd7012ad48a2c4890ab0c924168916809569367155b3a9300723a9c6596837d52
data/lib/rbbt/tsv/csv.rb CHANGED
@@ -8,6 +8,7 @@ module TSV
8
8
  noheaders = ! headers
9
9
 
10
10
  type = options.delete :type
11
+ cast = options.delete :cast
11
12
  merge = options.delete :merge
12
13
  key_field = options.delete :key_field
13
14
  fields = options.delete :fields
@@ -46,6 +47,10 @@ module TSV
46
47
  else
47
48
  key, *values = row
48
49
  end
50
+
51
+ if cast
52
+ values = values.collect{|v| v.send cast }
53
+ end
49
54
 
50
55
  case type
51
56
  when :double, :flat
@@ -97,6 +97,7 @@ class Step
97
97
  Open.ln_s(value.path, path)
98
98
  when type.to_s == "file"
99
99
  if String === value && File.exists?(value)
100
+ value = File.expand_path(value)
100
101
  Open.ln_s(value, path)
101
102
  else
102
103
  value = value.collect{|v| v = "#{v}" if Path === v; v }if Array === value
@@ -1,6 +1,6 @@
1
1
  class Step
2
2
 
3
- MAIN_RSYNC_ARGS="-avztAXHP"
3
+ MAIN_RSYNC_ARGS="-avztAXHP --copy-links"
4
4
 
5
5
  def self.link_job(path, target_dir, task = nil, workflow = nil)
6
6
  Path.setup(target_dir)
@@ -70,8 +70,8 @@ module Workflow
70
70
 
71
71
  start = data.column("Start.second").values.flatten.collect{|v| v.to_f}.min
72
72
  eend = data.column("End.second").values.flatten.collect{|v| v.to_f}.max
73
- total = eend - start
74
- Log.info "Total time elapsed: #{total} seconds"
73
+ total = eend - start unless eend.nil? || start.nil?
74
+ Log.info "Total time elapsed: #{total} seconds" if total
75
75
 
76
76
  data
77
77
  end
@@ -178,7 +178,6 @@ rbbt.png_plot('#{plot}', 'plot(timeline)', width=#{width}, height=#{height}, poi
178
178
  jobs = []
179
179
  seed_jobs.each do |step|
180
180
  jobs += step.rec_dependencies + [step]
181
-
182
181
  step.info[:archived_info].each do |path,ainfo|
183
182
  archived_step = Step.new path
184
183
  class << archived_step
@@ -188,9 +187,10 @@ rbbt.png_plot('#{plot}', 'plot(timeline)', width=#{width}, height=#{height}, poi
188
187
  end
189
188
  jobs << archived_step
190
189
  end if step.info[:archived_info]
190
+
191
191
  end
192
192
 
193
- jobs = jobs.uniq.sort_by{|job| t = job.info[:done]; t || Open.mtime(job.path) || 0 }
193
+ jobs = jobs.uniq.sort_by{|job| t = job.info[:started]; t || Open.mtime(job.path) || Time.now }
194
194
 
195
195
  data = trace_job_times(jobs, options[:fix_gap])
196
196
 
@@ -200,10 +200,10 @@ rbbt.png_plot('#{plot}', 'plot(timeline)', width=#{width}, height=#{height}, poi
200
200
 
201
201
  raise "No jobs to process" if data.size == 0
202
202
 
203
- plot, size, width, height = options.values_at :plot, :width, :height
203
+ plot, size, width, height = options.values_at :plot, :size, :width, :height
204
204
 
205
205
  size = 800 if size.nil?
206
- width = size * 2 if width.nil?
206
+ width = size.to_i * 2 if width.nil?
207
207
  height = size if height.nil?
208
208
 
209
209
  plot_trace_job_times(data, plot, width, height) if plot
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.32.0
4
+ version: 5.32.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-15 00:00:00.000000000 Z
11
+ date: 2021-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake