mode 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 808b8322502a62ca8f0902865261604f91c10fb6
4
- data.tar.gz: 5257839cf15428d9586c76bfae9f0eed43eeaa72
3
+ metadata.gz: efdff2f30299e26fcb53225a2ecc9d067b276d00
4
+ data.tar.gz: c7d5c3e22b7cde0a38f51cf2e01d65d60f199542
5
5
  SHA512:
6
- metadata.gz: 70ff00782afa3768c2b56a206ce0b86d7751efc1bead5fdd3665797c3bcf9e17f68916ef19ba99a2addc32acebb5e955dab45646e939fd1bbc5e6a3b8412568a
7
- data.tar.gz: 0e12149f13ad6a40da8f8f2a34ef29b6ee8de4640a2b368c77f63b0162e766d28ab596c8fcf689de6b2fdda00d8de89209c1f93aca6b6bad312516701136464d
6
+ metadata.gz: ba7761578619bfb884531acfc5d836b26b493db2135b496b98f8b52294b84a495251ad27cd9616a489d2618a2f59791defe381987199fa245b67697a5df77e90
7
+ data.tar.gz: 49f72b8cdc4fdc5e48299ac4806e7b4eb2e1cae25cedfb29063558001874c9395affa99048e040f65933520924f362dac6f5db374aaed1da6100b0a37b988020
@@ -26,16 +26,15 @@ module Mode
26
26
 
27
27
  field_name = csv.headers[field_pos]
28
28
 
29
- say "Analyzing #{field_name} at #{path || 'input'} (Sampling #{'%.2f' % (100 * sampling_rate)}%)..."
29
+ say "Analyzing #{field_name} at #{path || 'input'}"
30
30
 
31
31
  analysis, total_time = timer_block do
32
32
  DataKit::CSV::FieldAnalyzer.analyze(csv, field_pos, {
33
- :match_type => match_type,
34
- :sampling_rate => sampling_rate
33
+ :match_type => match_type, :sampling_rate => 1
35
34
  })
36
35
  end
37
36
 
38
- say "Analyzed #{analysis.sample_count} of #{analysis.row_count} rows in #{'%.2f' % total_time} seconds\n"
37
+ say "Analyzed #{analysis.row_count} rows in #{'%.2f' % total_time} seconds\n"
39
38
 
40
39
  display(analysis)
41
40
  end
@@ -59,12 +58,6 @@ module Mode
59
58
  def match_type
60
59
  options[:match_type] ? options[:match_type].to_sym : :any
61
60
  end
62
-
63
- def sampling_rate
64
- 1
65
- # file_size = File.size(path)
66
- # options[:sample].to_f || DataKit::CSV::SchemaAnalyzer.sampling_rate(file_size)
67
- end
68
61
  end
69
62
  end
70
63
  end
@@ -24,13 +24,15 @@ module Mode
24
24
 
25
25
  say "Analyzing #{path || 'input'} (Sampling #{'%.2f' % (100 * sample_rate)}%)..."
26
26
 
27
- analyzer, total_time = timer_block do
27
+ analysis, total_time = timer_block do
28
28
  DataKit::CSV::SchemaAnalyzer.analyze(csv, :sampling_rate => sample_rate)
29
29
  end
30
30
 
31
- say "Analyzed #{analyzer.sample_count} of #{analyzer.row_count} rows in #{'%.2f' % total_time} seconds\n"
31
+ puts analysis.use_type_hints
32
32
 
33
- display(analyzer)
33
+ say "Analyzed #{analysis.sample_count} of #{analysis.row_count} rows in #{'%.2f' % total_time} seconds\n"
34
+
35
+ display(analysis)
34
36
  end
35
37
  end
36
38
 
@@ -81,7 +83,7 @@ module Mode
81
83
 
82
84
  def sample_rate
83
85
  file_size = File.size(path)
84
- options[:sample] || DataKit::CSV::SchemaAnalyzer.sampling_rate(file_size)
86
+ options[:sample].to_f || DataKit::CSV::SchemaAnalyzer.sampling_rate(file_size)
85
87
  end
86
88
  end
87
89
  end
data/lib/mode/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mode
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mode Analytics
@@ -229,4 +229,3 @@ test_files:
229
229
  - spec/fixtures/format_examples.csv.txt
230
230
  - spec/fixtures/format_examples_after_excel.csv.txt
231
231
  - spec/spec_helper.rb
232
- has_rdoc: