spout 0.8.0.beta6 → 0.8.0.beta7

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
  SHA1:
3
- metadata.gz: e6045b21354f8f0af4c207823913ef0a75a12fb7
4
- data.tar.gz: aa6e0e604deeec131d8641370c674df7d411065f
3
+ metadata.gz: fe29cf954727208eb8e957550db8b7f887a7c5b2
4
+ data.tar.gz: d1231cf3acdc0679c02d590fc1f7d15689a8405b
5
5
  SHA512:
6
- metadata.gz: 5a5c0432dd78583502043ad987fdf75727b5322de35bf799b1d9ea6c114129a823cc057463785c662c4867ede530a8425fcddd1c81788014d459f85837e95af5
7
- data.tar.gz: 0a95fe2f9d085d2f7108f7fa2d22f5ac33c43a9361cdaf54d226913a2d085dd718f21ad0c1c4006b61effe9950d4d54c8f234c6e7c44da23f0accb146a94c220
6
+ metadata.gz: 17622fa7556b40aedbe2670ff20d1e6e6e9668dbed835b59e1a11d4ac506757c4a8934536c0a6d2b5eccaeb649845124d4ce5aa50a6f240e96176e95b2ab1e2d
7
+ data.tar.gz: 4a87ec0fa442bec34c88bd5ebec53ae0615a9da2f76de6f0858c7fb9de728067a95efcbb944884098bfae1160cb64b3313ae1f9789a8b8416c2d3730b1c9b40b
@@ -32,7 +32,7 @@ module Spout
32
32
  end
33
33
 
34
34
  variable_ids = Dir.glob("variables/**/*.json").collect{ |file| file.gsub(/^(.*)\/|\.json$/, '').downcase }
35
- @extra_variable_ids = variable_ids - @subject_loader.all_methods.keys
35
+ @extra_variable_ids = (variable_ids - @subject_loader.all_methods.keys).sort
36
36
 
37
37
  @matching_results.sort!{|a,b| [b[2].number_of_errors, a[0].to_s, a[1].to_s] <=> [a[2].number_of_errors, b[0].to_s, b[1].to_s]}
38
38
 
@@ -4,7 +4,7 @@ require 'spout/helpers/json_loader'
4
4
  module Spout
5
5
  module Models
6
6
  class OutlierResult
7
- attr_reader :csv_files, :method, :major_outliers, :minor_outliers, :outliers, :weight, :units
7
+ attr_reader :csv_files, :method, :major_outliers, :minor_outliers, :outliers, :weight, :units, :median
8
8
 
9
9
  def initialize(subjects, method, csv_files)
10
10
  @values = subjects.collect(&method.to_sym)
@@ -23,6 +23,7 @@ module Spout
23
23
  end
24
24
  variable = Spout::Helpers::JsonLoader::get_variable(method)
25
25
  @units = (variable.kind_of?(Hash) ? variable['units'] : nil)
26
+ @median = @values.median
26
27
  end
27
28
 
28
29
  def calculate_outliers!
data/lib/spout/version.rb CHANGED
@@ -3,7 +3,7 @@ module Spout
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
5
  TINY = 0
6
- BUILD = "beta6" # nil, "pre", "rc", "rc2"
6
+ BUILD = "beta7" # nil, "pre", "rc", "rc2"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
9
9
  end
@@ -65,7 +65,7 @@ tfoot td {
65
65
  <div class="container" style="margin-top:30px">
66
66
  <div class="jumbotron">
67
67
  <h1>You made Spout cry... :'-(</h1>
68
- <p>No CSVs found in <code><%= Dir.pwd %>/csvs/</code></p>
68
+ <p>No CSVs found in <code><%= Dir.pwd %>/csvs/<%= @standard_version %>/</code></p>
69
69
  </div>
70
70
  </div>
71
71
  <% else %>
@@ -6,7 +6,7 @@
6
6
  <meta name="author" content="">
7
7
  <link rel="shortcut icon" href="data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAIAAAAMIAAAAiAAAAAAAAAAAAAAAAAAAARAAAAEEAAAAcAAAAwQAAACEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAADCAAAAIgAAAAAAAAAAAAAAAAAAAEQAAABBAAAAHAAAAMEAAAAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAwwAAACIAAAAAAAAAAAAAAAAAAABEAAAAQQAAABwAAADBAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjg8AAI4PAACODwAAjg8AAIABAADgYQAA4mEAAAAAAAAAAAAAjgMAAIIDAACAAwAAgEAAAIBAAADwQAAA8H8AAA==">
8
8
 
9
- <title>Spout Coverage</title>
9
+ <title>Spout Outliers</title>
10
10
 
11
11
  <!-- Bootstrap core CSS -->
12
12
  <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
@@ -106,10 +106,9 @@ tfoot td {
106
106
  <tr>
107
107
  <th>CSV</th>
108
108
  <th>Column</th>
109
- <th>Units</th>
109
+ <th>Median</th>
110
110
  <th>Major Outliers</th>
111
111
  <th>Minor Outliers</th>
112
- <th>Outliers</th>
113
112
  </tr>
114
113
  </thead>
115
114
  <tbody>
@@ -120,21 +119,44 @@ tfoot td {
120
119
  <code class="<%= 'success' if outlier_result.outliers.size == 0 %>"><%= csv_file %><code><br />
121
120
  <% end %></td>
122
121
  <td><%= outlier_result.method %></td>
123
- <td><%= outlier_result.units %></td>
124
122
  <td>
125
- <% outlier_result.major_outliers.collect{|v| v.round(2)}.uniq.each do |value| %>
126
- <code class="danger"><%= value %></code>
123
+ <% if outlier_result.median.kind_of?(Numeric) %>
124
+ <code class="default"><%= number_with_delimiter(outlier_result.median.round(2)) %></code>
127
125
  <% end %>
126
+ <%= outlier_result.units %>
128
127
  </td>
129
128
  <td>
130
- <% outlier_result.minor_outliers.collect{|v| v.round(2)}.uniq.each do |value| %>
131
- <code class="warning"><%= value %></code>
129
+ <% outliers = outlier_result.major_outliers.collect{|v| v.round(2)}.uniq %>
130
+ <% if outliers.size > 6 %>
131
+ <% outliers.first(3).each do |value| %>
132
+ <code class="danger"><%= number_with_delimiter(value) %></code>
133
+ <% end %>
134
+ <code class="default">...</code>
135
+ <% outliers.last(3).each do |value| %>
136
+ <code class="danger"><%= number_with_delimiter(value) %></code>
137
+ <% end %>
138
+ <% else %>
139
+ <% outliers.each do |value| %>
140
+ <code class="danger"><%= number_with_delimiter(value) %></code>
141
+ <% end %>
132
142
  <% end %>
133
143
  </td>
134
144
  <td>
135
- <% outlier_result.outliers.collect{|v| v.round(2)}.uniq.each do |value| %>
136
- <code class="default"><%= value %></code>
145
+ <% outliers = outlier_result.minor_outliers.collect{|v| v.round(2)}.uniq %>
146
+ <% if outliers.size > 6 %>
147
+ <% outliers.first(3).each do |value| %>
148
+ <code class="warning"><%= number_with_delimiter(value) %></code>
149
+ <% end %>
150
+ <code class="default">...</code>
151
+ <% outliers.last(3).each do |value| %>
152
+ <code class="warning"><%= number_with_delimiter(value) %></code>
153
+ <% end %>
154
+ <% else %>
155
+ <% outliers.each do |value| %>
156
+ <code class="warning"><%= number_with_delimiter(value) %></code>
157
+ <% end %>
137
158
  <% end %>
159
+
138
160
  </td>
139
161
  </tr>
140
162
  <% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.beta6
4
+ version: 0.8.0.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Remo Mueller