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 +4 -4
- data/lib/spout/commands/coverage.rb +1 -1
- data/lib/spout/models/outlier_result.rb +2 -1
- data/lib/spout/version.rb +1 -1
- data/lib/spout/views/index.html.erb +1 -1
- data/lib/spout/views/outliers.html.erb +32 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe29cf954727208eb8e957550db8b7f887a7c5b2
|
4
|
+
data.tar.gz: d1231cf3acdc0679c02d590fc1f7d15689a8405b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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
|
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,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAIAAAAMIAAAAiAAAAAAAAAAAAAAAAAAAARAAAAEEAAAAcAAAAwQAAACEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAADCAAAAIgAAAAAAAAAAAAAAAAAAAEQAAABBAAAAHAAAAMEAAAAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAwwAAACIAAAAAAAAAAAAAAAAAAABEAAAAQQAAABwAAADBAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAKoAAAAeAAAAAAAAAAAAAAAAAAAARAAAAEEAAAAYAAAAqwAAAB4AAAAAAAAAAAAAAAAAAAAAAA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DAACAAwAAgEAAAIBAAADwQAAA8H8AAA==">
|
8
8
|
|
9
|
-
<title>Spout
|
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>
|
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.
|
126
|
-
<code class="
|
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.
|
131
|
-
|
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.
|
136
|
-
|
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 %>
|