rbbt-util 5.26.64 → 5.26.65

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: 7bd22f35bc9c5df2532c012ed9b2fb22ab633b6fea46cf8f37788666299e3a56
4
- data.tar.gz: c1622be1de59d46f6cd936ec035e1937af5a5cde973fbefa56b014718327842b
3
+ metadata.gz: a075c6d52728fbc0017d8a0e8bd951785bfdd64a6b8592b6f9c79364ee0f4cff
4
+ data.tar.gz: 30bc09799c5f97fed9c5b4a2419046bc1ed9fc7c9ad183e8a57f31baa52c0e23
5
5
  SHA512:
6
- metadata.gz: a775d015e542fbe25be63c18fe90cd89086d2cbfc462ff88c402bf8f36239fb0f8adaff5aaa3c963f6cc3b21a9246010b8ff82406f0f1a4e145c8c0ccdbaaf9e
7
- data.tar.gz: 35a2bbb82e71e0dfbb9dd8ddd96f207dfe207a3a139251bd98e7ec8107794775432b049ccdd077daf1a1c8361bd368a0182eefc913cbb62f1a9e8361c016637e
6
+ metadata.gz: c0b364de6b4c8fa7de8a518ebf26f731288b54a0849568894105fa86a430a1b9799d1adf6a02dbc4471c3d47841d8374bbe66e6cda78c9bc9ffa0fba7764ce7c
7
+ data.tar.gz: 9df674dd7b3cfe4c4d7114f2e3452faa8bd1daedcec064bfc453b8d12186c6fac5df073932ae45dba3e30bded9f4beea96115fc740c3b2f19aed16103a84c3c7
data/lib/rbbt/util/log.rb CHANGED
@@ -134,11 +134,11 @@ module Log
134
134
  end
135
135
 
136
136
  def self.up_lines(num = 1)
137
- "\033[#{num+1}F\033[2K"
137
+ nocolor ? "" : "\033[#{num+1}F\033[2K"
138
138
  end
139
139
 
140
140
  def self.down_lines(num = 1)
141
- "\033[#{num+1}E"
141
+ nocolor ? "" : "\033[#{num+1}E"
142
142
  end
143
143
 
144
144
  def self.return_line
@@ -10,68 +10,6 @@ module Log
10
10
  end
11
11
 
12
12
  attr_accessor :history, :mean_max, :max_history
13
- #def thr
14
- # count = (@ticks - @last_count).to_f
15
- # if @last_time.nil?
16
- # seconds = 0.001
17
- # else
18
- # seconds = Time.now - @last_time
19
- # end
20
- # thr = count / seconds
21
- #end
22
-
23
-
24
- #def thr_msg
25
- # thr = self.thr
26
- # if @history.nil?
27
- # @history ||= [thr]
28
- # else
29
- # @history << thr
30
- # max_history ||= case
31
- # when @ticks > 20
32
- # count = @ticks - @last_count
33
- # if @max
34
- # times = @max / count
35
- # num = times / 20
36
- # num = 2 if num < 2
37
- # else
38
- # num = 10
39
- # end
40
- # count * num
41
- # else
42
- # 20
43
- # end
44
- # max_history = 30 if max_history > 30
45
- # max_history = 100
46
- # @history.shift if @history.length > max_history
47
- # end
48
-
49
- # @mean_max ||= 0
50
- # if @history.length > 3
51
-
52
- # w_mean = 0
53
- # total_w = 0
54
- # @history.each_with_index do |v,i|
55
- # c = i ** 10
56
- # w_mean += v * c
57
- # total_w += c
58
- # end
59
- # mean = @mean = w_mean.to_f / total_w
60
-
61
- # @mean_max = mean if mean > @mean_max
62
- # end
63
-
64
- # if mean.nil? or mean.to_i > 1
65
- # str = "#{ Log.color :blue, thr.to_i.to_s } per sec."
66
- # str << " #{ Log.color :yellow, mean.to_i.to_s } avg. #{Log.color :yellow, @mean_max.to_i.to_s} max." if @mean_max > 0
67
- # else
68
- # str = "#{ Log.color :blue, (1/thr).ceil.to_s } secs each"
69
- # str << " #{ Log.color :yellow, (1/mean).ceil.to_s } avg. #{Log.color :yellow, (1/@mean_max).ceil.to_s} min." if @mean_max > 0
70
- # end
71
-
72
- # str
73
- #end
74
-
75
13
  def thr_msg
76
14
  if @history.nil?
77
15
  @history ||= [[@ticks, Time.now] ]
data/share/Rlib/util.R CHANGED
@@ -228,6 +228,10 @@ rbbt.tsv2matrix <- function(data){
228
228
  return(new);
229
229
  }
230
230
 
231
+ rbbt.tsv2tibble <- function(data){
232
+ as_tibble(data, rownames=attr(data, 'key.field'))
233
+ }
234
+
231
235
  rbbt.tsv.write <- function(filename, data, key.field = NULL, extra_headers = NULL, eol="\n", ...){
232
236
 
233
237
  if (is.null(key.field)){ key.field = attributes(data)$key.field;}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.26.64
4
+ version: 5.26.65
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez