combo_data 0.0.1 → 0.0.2

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: 666509fb955a1c397e5c4edc70374e5533a79339
4
- data.tar.gz: efe126f84a931246077df6da5349297f91542284
3
+ metadata.gz: 64a45ca20b228dedaaf1cdbd7261d1ff9909654e
4
+ data.tar.gz: 19dbece0dc1e4189ca6262a2120beeecdf2479c3
5
5
  SHA512:
6
- metadata.gz: c25c1f498f8ee1a988b5608628c1c5f1e769435a53fa1390eea7e3c7a5b4b59e4e3d9d5fcfbe6510a074c2a602c25ca7d6b50f8f63f807f24c85c8f5b1181bce
7
- data.tar.gz: d4d0dcfffd66a9747937262b3b6d0d1e36b5ce3eb539bd68143b9a929edfff47f2a93fc0ef264a13e20ff73e5760c66e9c3e3215f437943cfc82bfc81fd5a371
6
+ metadata.gz: bb4683a0a6a121b8511aa0e6f605daa8ee15e3faeeb7b0fe26345c83a698d6802a3d4c7cdb5db2a83617c896a41b114d37c2d0c79478f5e762c94ef457882c9c
7
+ data.tar.gz: ff860f86d3c91bacc438071bdcc94764e77e6cab8f155fef2bcecc65fa4d229b9cb7d4aebdfc41ee0a8e2ffea412f8d71628a8fbad5a57dc9ee6cd8f2a65dab4
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # ComboData
2
2
 
3
- TODO: Write a gem description
3
+ Analyze a data set for combinations adding to a given value.
4
+
5
+ Analyze a data set for pairs with a difference of a given value.
4
6
 
5
7
  ## Installation
6
8
 
@@ -17,8 +19,37 @@ Or install it yourself as:
17
19
  $ gem install combo_data
18
20
 
19
21
  ## Usage
22
+
23
+ Create a ComboData::DataSet object with an array of values:
24
+
25
+ data_set = ComboData::DataSet.new((1..1000).to_a)
26
+
27
+ Analyze the data set for combinations adding to a given value.
28
+
29
+ data_set.combinations_summing_to 20
30
+ => {[1, 19]=>20, [2, 18]=>20, [3, 17]=>20, [4, 16]=>20, [5, 15]=>20, [6, 14]=>20, [7, 13]=>20, [8, 12]=>20, [9, 11]=>20, [20]=>20}
31
+
32
+ Change the max combination length:
33
+
34
+ data_set.max_combination_length = 3 # defaults to 2
35
+ => 3
36
+ hate.combinations_summing_to 20
37
+ => {[1, 2, 17]=>20, [1, 3, 16]=>20, [1, 4, 15]=>20, [1, 5, 14]=>20, [1, 6, 13]=>20, [1, 7, 12]=>20, [1, 8, 11]=>20, [1, 9, 10]=>20, [2, 3, 15]=>20, [2, 4, 14]=>20, [2, 5, 13]=>20, [2, 6, 12]=>20, [2, 7, 11]=>20, [2, 8, 10]=>20, [3, 4, 13]=>20, [3, 5, 12]=>20, [3, 6, 11]=>20, [3, 7, 10]=>20, [3, 8, 9]=>20, [4, 5, 11]=>20, [4, 6, 10]=>20, [4, 7, 9]=>20, [5, 6, 9]=>20, [5, 7, 8]=>20, [1, 19]=>20, [2, 18]=>20, [3, 17]=>20, [4, 16]=>20, [5, 15]=>20, [6, 14]=>20, [7, 13]=>20, [8, 12]=>20, [9, 11]=>20, [20]=>20}
38
+
39
+ Analyze the data set for pairs with a difference of a given value.
40
+
41
+ data_set.pairs_with_a_difference_of 997
42
+ => {[1, 998]=>997, [2, 999]=>997, [3, 1000]=>997}
43
+
44
+ Change the timeout for processing:
45
+
46
+ data_set.timeout = 120 # seconds, defaults to 60
47
+ => 120
48
+
49
+ Change the precision while making comparisons:
20
50
 
21
- TODO: Write usage instructions here
51
+ data_set.precision = 3 # decimal places
52
+ => 3
22
53
 
23
54
  ## Contributing
24
55
 
data/combo_data.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["ksmith@wspackaging.com"]
11
11
  spec.description = %q{Perform analysis of data sets.}
12
12
  spec.summary = %q{Data Analysis}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/K-Y-L-E/combo_data"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -1,3 +1,3 @@
1
1
  module ComboData
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combo_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Smith
@@ -54,7 +54,7 @@ files:
54
54
  - lib/combo_data.rb
55
55
  - lib/combo_data/combo_data.rb
56
56
  - lib/combo_data/version.rb
57
- homepage: ''
57
+ homepage: https://github.com/K-Y-L-E/combo_data
58
58
  licenses:
59
59
  - MIT
60
60
  metadata: {}