rbbt-util 5.34.22 → 5.34.24

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: 40183cfe120bb6545a1bb59f150bb3cac9426ce018d18485afdbf0c8f1de92b2
4
- data.tar.gz: fd625b45572be4a158bc9f08007225e284659ec9ef26fbe66a2e9ae7fb84ce9f
3
+ metadata.gz: 7359f3a8ce8bde23107f23515557f47eb7bb65ee094c64419ba5542378af1c8c
4
+ data.tar.gz: 0a030eb0b6f9648a60c11abaac383fe33b24845c288ddd7a28eb8e9aa8d8ac1c
5
5
  SHA512:
6
- metadata.gz: f9f2a5ee2e22b84c8bce0f0da023a39cb917a8210ab1c9a4daca7d67902134221fd671da62ca19a2ce02fb06049ea00f4a8a282a1906235f91380d936240b987
7
- data.tar.gz: 5124409cb58db3eea7029042ec8671e13075bd814b40a25a905a56ccc52ae660e9981f3146f8a2ecaad2c122ea6edea1ea8b4c7d1a1191a58621c797f317577c
6
+ metadata.gz: dce1b81193d5d0d7ad86140e7287228b4a9d83fe99f08c4a431e34491d3c2a6057054cc9d80a76be9d4ac34b422c8203470d53579c4ba84bee8a804b6f12a2dd
7
+ data.tar.gz: 5b1d4e2aa040b183a92ea7b3ccb45fef2e3467a7d94203fd5214a366cbc87bfd6944095888f68c0ca6c8da6d2442cd0f6685b381e4be2e5b68c07bc68365ae72
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
@@ -72,7 +72,7 @@ module Workflow
72
72
  def setup_override_dependency(dep, workflow, task_name)
73
73
  return [] if dep == :skip || dep == 'skip'
74
74
 
75
- if ! Step === dep
75
+ if not Step === dep
76
76
  located = Open.exists?(dep)
77
77
  dep = Workflow.load_step(dep)
78
78
  end
@@ -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
  }
@@ -96,7 +96,12 @@ module Workflow
96
96
  Log.debug "Opening tsv #{ input } from #{file}"
97
97
  inputs[input.to_sym] = TSV.open(file)
98
98
  when :boolean
99
- inputs[input.to_sym] = (file.read.strip == 'true')
99
+ case file.read.strip.downcase
100
+ when 'true'
101
+ inputs[input.to_sym] = true
102
+ when 'false'
103
+ inputs[input.to_sym] = false
104
+ end
100
105
  when :integer
101
106
  inputs[input.to_sym] = file.read.to_i
102
107
  when :float
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);
@@ -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.22
4
+ version: 5.34.24
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-28 00:00:00.000000000 Z
11
+ date: 2022-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake