rbbt-util 5.34.23 → 5.34.25

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: 51ed402e4c2d6b490947a3b78fb4ed1db76019b6df756e089a769c64015c0d51
4
- data.tar.gz: 649b91828b6df949ef804cd67e3c15e6832cb69c5b5f62b4a7603c6960d57d28
3
+ metadata.gz: f1a0dc0772864a83c7c6b159d53dc1c5d95e7f58619c4e4b0c630e8240a621aa
4
+ data.tar.gz: c8a029debfd1ee7c820185aa1dead29575ecd173a1868692751c6a01dc7be01a
5
5
  SHA512:
6
- metadata.gz: 41eb5ddfbe457fa8bcbd870bc36f70df129722feabe1d6fdd5c5439a699a4daa0e4c27290b1ecb5c7f8f07c5f954de71e014fa42e413a699e376145a501a92a0
7
- data.tar.gz: bdbf092938b4e176c1262ff3b856374be942a6bafd87a024efe46b949942640002043aadfbda8f56fae5e3ea8685ca25564bffec4e3a3f24c5f7ea2aa4bbbfb8
6
+ metadata.gz: b151561ce56b42af19160eff58a8f45be7fedd6226d960987111e8b9d1147802eb612f96b85a47ad849476b7d4520df457ed70e91e9528d67e9e03a6959f78c4
7
+ data.tar.gz: 60b1a486a88bd2c65a4c003130c7c81de42ce72446420797132d1047be2446fce74f7cb35c80a652a1f56dcc630ba6e32d7c991a524efeab85a05325aaae1024
@@ -101,6 +101,11 @@ module HPC
101
101
 
102
102
  task = Symbol === job.overriden ? job.overriden : job.task_name
103
103
 
104
+ #override_deps = job.overriden_deps.collect do |dep|
105
+ # name = [dep.workflow.to_s, dep.task_name] * "#"
106
+ # [name, dep.path] * "="
107
+ #end.uniq * ","
108
+
104
109
  if job.overriden?
105
110
  #override_deps = job.rec_dependencies.
106
111
  # select{|dep| Symbol === dep.overriden }.
@@ -568,7 +573,7 @@ env > #{batch_options[:fenv]}
568
573
  Misc.add_defaults options,
569
574
  :batch_dir => batch_dir,
570
575
  :inputs_dir => File.join(batch_dir, "inputs_dir"),
571
- :workflows => workflows_to_load.uniq * ","
576
+ :workflows => workflows_to_load.any? ? workflows_to_load.uniq * "," : nil
572
577
 
573
578
  options[:procpath_performance] ||= File.join(batch_dir, "procpath##{procpath.gsub(',', '#')}") if procpath
574
579
 
data/lib/rbbt/util/log.rb CHANGED
@@ -131,6 +131,30 @@ module Log
131
131
  end
132
132
  end
133
133
 
134
+ def self._ignore_stdout
135
+ begin
136
+ File.open('/dev/null', 'w') do |f|
137
+ backup_stdout = STDOUT.dup
138
+ STDOUT.reopen(f)
139
+ begin
140
+ yield
141
+ ensure
142
+ STDOUT.reopen backup_stdout
143
+ backup_stdout.close
144
+ end
145
+ end
146
+ rescue Errno::ENOENT
147
+ yield
148
+ end
149
+ end
150
+
151
+
152
+ def self.ignore_stdout(&block)
153
+ LOG_MUTEX.synchronize do
154
+ _ignore_stdout &block
155
+ end
156
+ end
157
+
134
158
  def self.get_level(level)
135
159
  case level
136
160
  when Numeric
@@ -73,8 +73,10 @@ module Workflow
73
73
  return [] if dep == :skip || dep == 'skip'
74
74
 
75
75
  if not Step === dep
76
- located = Open.exists?(dep)
76
+ located = Open.exists?(dep) || Open.exists?(dep + '.info')
77
77
  dep = Workflow.load_step(dep)
78
+ else
79
+ located = true
78
80
  end
79
81
 
80
82
  dep.original_workflow ||= dep.workflow if dep.workflow
@@ -527,7 +527,7 @@ class Step
527
527
 
528
528
  def overriden?
529
529
  return true if @overriden
530
- return true if dependencies && dependencies.select{|dep| dep.overriden? }.any?
530
+ return true if dependencies && dependencies.select{|dep| TrueClass === dep.overriden }.any?
531
531
  info[:archived_info].each do |f,i|
532
532
  next if Symbol === i
533
533
  return true if i[:overriden] || i["overriden"]
@@ -577,20 +577,20 @@ class Step
577
577
 
578
578
  return [] if dependencies.nil? or dependencies.empty?
579
579
 
580
- new_dependencies = []
581
580
  if self.overriden?
582
581
  archived_deps = []
583
582
  else
584
583
  archived_deps = self.info[:archived_info] ? self.info[:archived_info].keys : []
585
584
  end
586
585
 
586
+ new_dependencies = []
587
587
  dependencies.each{|step|
588
588
  #next if self.done? && Open.exists?(info_file) && info[:dependencies] && info[:dependencies].select{|task,name,path| path == step.path }.empty?
589
589
  next if archived_deps.include? step.path
590
- next if seen.include? step.path
590
+ next if seen.include? step
591
591
  next if self.done? && connected && ! updatable?
592
592
 
593
- r = step.rec_dependencies(connected, new_dependencies.collect{|d| d.path})
593
+ r = step.rec_dependencies(connected, new_dependencies)
594
594
  new_dependencies.concat r
595
595
  new_dependencies << step
596
596
  }
@@ -31,6 +31,8 @@ module Workflow
31
31
 
32
32
  type = :step_array if file.split(".").last == 'as_step_array'
33
33
 
34
+ type = :number_array if file.split(".").last == 'as_number_array'
35
+
34
36
  type = :step_file if file.split(".").last == 'as_step_file'
35
37
 
36
38
  type = :step_file_array if file.split(".").last == 'as_step_file_array'
@@ -57,6 +59,9 @@ module Workflow
57
59
  when :step_array
58
60
  steps = Open.read(file).strip.split("\n").collect{|path| Workflow.load_step(path) }
59
61
  inputs[input.to_sym] = steps
62
+ when :number_array
63
+ numbers = Open.read(file).strip.split("\n").collect{|num| num.to_f }
64
+ inputs[input.to_sym] = numbers
60
65
  when :step
61
66
  steps = Open.read(file).strip.split("\n").collect{|path| Workflow.load_step(path) }
62
67
  inputs[input.to_sym] = steps.first
@@ -176,6 +181,8 @@ class Step
176
181
  when Step
177
182
  path = path + '.as_step_array'
178
183
  value = value.collect{|s| s.path }
184
+ when Numeric
185
+ path = path + '.as_number_array'
179
186
  end
180
187
 
181
188
  value = value * "\n"
data/lib/rbbt/workflow.rb CHANGED
@@ -437,8 +437,8 @@ module Workflow
437
437
  jobname_input = nil
438
438
  end
439
439
 
440
- if jobname_input && jobname && inputs[jobname_input].nil?
441
- inputs[jobname_input] = jobname
440
+ if jobname_input && inputs[jobname_input].nil?
441
+ inputs[jobname_input] = jobname || DEFAULT_NAME
442
442
  end
443
443
 
444
444
  real_inputs = {}
@@ -503,7 +503,7 @@ module Workflow
503
503
  when :not_overriden_dep
504
504
  job.overriden = true if has_overriden_inputs || true_overriden_deps.any?
505
505
  else
506
- job.overriden = true if has_overriden_inputs || overriden_deps.any?
506
+ job.overriden = true if has_overriden_inputs || true_overriden_deps.any?
507
507
  end
508
508
 
509
509
  job.real_inputs = real_inputs.keys
data/share/Rlib/util.R CHANGED
@@ -185,9 +185,17 @@ rbbt.tsv <- function(filename, sep = "\t", comment.char ="#", row.names=1, check
185
185
  }
186
186
 
187
187
  columns = rbbt.tsv.columns(filename, sep, comment.char=comment.char)
188
+ if (! is.null(comment.char))
189
+ columns[1] = substring(columns[1],length(comment.char) + 1)
190
+
188
191
  if (! is.null(columns)){
189
- names(data) <- columns[2:length(columns)];
190
- attributes(data)$key.field = substring(columns[1],2);
192
+ #names(data) <- columns[2:length(columns)];
193
+ if (! is.null(row.names)){
194
+ names(data) <- columns[c(-row.names)];
195
+ }else{
196
+ names(data) <- columns
197
+ }
198
+ attributes(data)$key.field = columns[1];
191
199
  }
192
200
 
193
201
  return(data);
@@ -61,7 +61,8 @@ class Step
61
61
  else
62
62
  begin
63
63
  Log.debug "Issuing SLURM job for #{self.path}"
64
- @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
64
+ #@batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
65
+ @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, $slurm_options)
65
66
  if no_load
66
67
  self
67
68
  else
@@ -61,7 +61,8 @@ class Step
61
61
  else
62
62
  begin
63
63
  Log.debug "Issuing SLURM job for #{self.path}"
64
- @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
64
+ #@batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
65
+ @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, $slurm_options)
65
66
  if no_load
66
67
  self
67
68
  else
@@ -61,7 +61,8 @@ class Step
61
61
  else
62
62
  begin
63
63
  Log.debug "Issuing SLURM job for #{self.path}"
64
- @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
64
+ #@batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
65
+ @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, $slurm_options)
65
66
  if no_load
66
67
  self
67
68
  else
@@ -37,6 +37,8 @@ when options[:tokyocabinet_bd]
37
37
  exit
38
38
  end
39
39
 
40
+ options[:fields] = options[:fields].split(/,\s*/) if options[:fields]
41
+
40
42
  parser = TSV::Parser.new TSV.get_stream(file), options
41
43
 
42
44
  dumper = TSV::Dumper.new parser.options.merge(:sep => "\t", :sep2 => '|')
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.34.23
4
+ version: 5.34.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-30 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake