miga-base 0.7.8.0 → 0.7.9.0

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: 5cce1edf29f5f41ad7a53225978513597f2234abd781c5f179c9f45f9d6f1ec2
4
- data.tar.gz: 846a570b68efe9dba8acbc1434c55752373d9864df2cea2ff467330bf7e8b1ac
3
+ metadata.gz: d699b0ec0f4b7097439d64083fec6f3187662f9bcfa5d9921aebb27cdfd1c263
4
+ data.tar.gz: 7ebffb85482969f3304e643a638fdc6f45439da8d2f11d9b8cffe27713c6e286
5
5
  SHA512:
6
- metadata.gz: 123117d43c4ef4200ebe4a51cb14d19e48b89d249e66fa27b6e0834cf1c3b738535c3f514856e373259428c42543a25886744b4a8a6775f75b587d0a557e4d48
7
- data.tar.gz: fa178d1e899da25212983bf7640cc391f3922e560d5d5ee4ff072781b6301013d928212868c9db1590dfcd1f41449e07b5019765dc866d02295226c9ed8a3e2d
6
+ metadata.gz: d6517ec344ff45a1ec79db56250ad0c15423b6eac0bf4cad07def7e17dde238c3c7064a70df9f50a2411ec3b2dae27756483ba92c192553cf8fdcc9104acf730
7
+ data.tar.gz: 8858ed1fed6861deff6137950c42c6f8a872c9406dc6ef3969676642f3c945de21395c4c5975e6885ede2059f9ea9c11620ec3c764774dc0f5deeb9ac058bb7f
@@ -14,7 +14,7 @@ class MiGA::Cli::Action::Stats < MiGA::Cli::Action
14
14
  ) { |v| cli[:key] = v }
15
15
  opt.on(
16
16
  '--compute-and-save',
17
- 'Compute and saves the statistics'
17
+ 'Compute and save the statistics'
18
18
  ) { |v| cli[:compute] = v }
19
19
  opt.on(
20
20
  '--try-load',
@@ -26,6 +26,10 @@ class MiGA::Cli::Action::Summary < MiGA::Cli::Action
26
26
  '--with-units',
27
27
  'Include units in each cell'
28
28
  ) { |v| cli[:units] = v }
29
+ opt.on(
30
+ '--compute-and-save',
31
+ 'Compute and save the statistics if not yet available'
32
+ ) { |v| cli[:compute] = v }
29
33
  end
30
34
  end
31
35
 
@@ -34,7 +38,8 @@ class MiGA::Cli::Action::Summary < MiGA::Cli::Action
34
38
  ds = cli.load_and_filter_datasets
35
39
  cli.say 'Loading results'
36
40
  stats = ds.map do |d|
37
- r = d.add_result(cli[:result].to_sym, false)
41
+ r = d.result(cli[:result])
42
+ r.compute_stats if cli[:compute] && !r.nil? && r[:stats].empty?
38
43
  s = r.nil? ? {} : r[:stats]
39
44
  s.tap { |i| i[:dataset] = d.name }
40
45
  end
@@ -90,7 +90,8 @@ module MiGA::Common::Format
90
90
  end
91
91
  fh.close
92
92
 
93
- o = { n: l.size, tot: l.inject(:+), max: l.max }
93
+ o = { n: l.size, tot: l.inject(0, :+), max: l.max }
94
+ return o if o[:tot].zero?
94
95
  o[:avg] = o[:tot].to_f / l.size
95
96
  o[:var] = l.map { |a| a**2 }.inject(:+).to_f / l.size - o[:avg]**2
96
97
  o[:sd] = Math.sqrt o[:var]
@@ -106,7 +107,8 @@ module MiGA::Common::Format
106
107
  break if pos >= thr
107
108
  end
108
109
  o[:med] = o[:n].even? ?
109
- 0.5 * l[o[:n] / 2 - 1, 2].inject(:+) : l[(o[:n] - 1) / 2]
110
+ 0.5 * l[o[:n] / 2 - 1, 2].inject(:+) :
111
+ l[(o[:n] - 1) / 2]
110
112
  end
111
113
  o
112
114
  end
@@ -8,7 +8,7 @@ module MiGA
8
8
  # - Float representing the major.minor version.
9
9
  # - Integer representing gem releases of the current version.
10
10
  # - Integer representing minor changes that require new version number.
11
- VERSION = [0.7, 8, 0]
11
+ VERSION = [0.7, 9, 0]
12
12
 
13
13
  ##
14
14
  # Nickname for the current major.minor version.
@@ -16,7 +16,7 @@ module MiGA
16
16
 
17
17
  ##
18
18
  # Date of the current gem release.
19
- VERSION_DATE = Date.new(2020, 6, 7)
19
+ VERSION_DATE = Date.new(2020, 6, 8)
20
20
 
21
21
  ##
22
22
  # Reference of MiGA.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8.0
4
+ version: 0.7.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-07 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons