rbbt-util 5.26.64 → 5.26.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rbbt/util/log.rb +2 -2
- data/lib/rbbt/util/log/progress/report.rb +0 -62
- data/share/Rlib/util.R +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a075c6d52728fbc0017d8a0e8bd951785bfdd64a6b8592b6f9c79364ee0f4cff
|
4
|
+
data.tar.gz: 30bc09799c5f97fed9c5b4a2419046bc1ed9fc7c9ad183e8a57f31baa52c0e23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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;}
|