aggregate 0.2.3 → 0.2.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
  SHA256:
3
- metadata.gz: 529c02e008869ec1317db1a476a46f91a0d7d140d8a52656b30d9f7aafce8afa
4
- data.tar.gz: 99614461e232afee5e116b943bf92ee35de703f947de818973477a467d5647ce
3
+ metadata.gz: 443886b0ec9c5942e00bcf724b9fb867828d896cae4d0691682b94f0c9907f09
4
+ data.tar.gz: e9623280785d01741cc7b07a26528e64f9f273492a9cd202d2b94e9478def21a
5
5
  SHA512:
6
- metadata.gz: 8b49a303c9dd3755a5c66c1a10a94b71ccdd097af5ea824e6d5a5f246672c4efe9314841eac276dfea754542aa9f2e99857dacef17ae1e46a9fd4762f24b8b6d
7
- data.tar.gz: 7fea0c9d8b476c3fbc34b1679e1cb47313b59747212fbe39fea63d5d79017c7d8138397fd3f5e61be015cf087f9cd5f7a10d26d5d20d526c56eceffcff0c6d28
6
+ metadata.gz: 1e960a849a22191f5c9f964ef4365ba2a73389aa43cfba38a3879cfcdea4d3f8c4cd6de64cacaeb2310c7dee4fd95d284a1805c8515f12fc27560c0a54499277
7
+ data.tar.gz: 8110ec772721e648025c8e15ed3fa0f941d04a1884d7309ffd30ccf54e7b66294421c04e26d50f4f218bbf5c39f8e8c31ddb3d0af3e42e872185f01cdecf6a52
@@ -1,3 +1,3 @@
1
1
  class Aggregate
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
data/lib/aggregate.rb CHANGED
@@ -26,7 +26,7 @@ class Aggregate
26
26
  # Create a new Aggregate that maintains a binary logarithmic histogram
27
27
  # by default. Specifying values for low, high, and width configures
28
28
  # the aggregate to maintain a linear histogram with (high - low)/width buckets
29
- def initialize (low=nil, high=nil, width=nil)
29
+ def initialize(low=nil, high=nil, width=nil)
30
30
  @count = 0
31
31
  @sum = 0.0
32
32
  @sum2 = 0.0
@@ -204,7 +204,7 @@ class Aggregate
204
204
  nil != @width
205
205
  end
206
206
 
207
- def outlier? (data)
207
+ def outlier?(data)
208
208
 
209
209
  if data < @low
210
210
  @outliers_low += 1
@@ -231,7 +231,7 @@ class Aggregate
231
231
  end
232
232
  end
233
233
 
234
- def right_bucket? index, data
234
+ def right_bucket?(index, data)
235
235
 
236
236
  # check invariant
237
237
  raise unless linear?
@@ -262,7 +262,7 @@ class Aggregate
262
262
  # A data point is added to the bucket[n] where the data point
263
263
  # is less than the value represented by bucket[n], but greater
264
264
  # than the value represented by bucket[n+1]
265
- def to_index (data)
265
+ def to_index(data)
266
266
 
267
267
  # basic case is simple
268
268
  return log2(data).to_i if !linear?
data/test/ts_aggregate.rb CHANGED
@@ -38,7 +38,7 @@ class SimpleStatsTest < MiniTest::Test
38
38
  i = 0
39
39
  @stats.each do |bucket, count|
40
40
  assert_equal 2**i, bucket
41
-
41
+
42
42
  total_bucket_sum += count
43
43
  i += 1
44
44
  end
@@ -129,16 +129,16 @@ class LinearHistogramTest < MiniTest::Test
129
129
  def test_validation
130
130
 
131
131
  # Range cannot be 0
132
- assert_raises(ArgumentError) {bad_stats = Aggregate.new(32,32,4)}
132
+ assert_raises(ArgumentError) { Aggregate.new(32,32,4) }
133
133
 
134
134
  # Range cannot be negative
135
- assert_raises(ArgumentError) {bad_stats = Aggregate.new(32,16,4)}
135
+ assert_raises(ArgumentError) { Aggregate.new(32,16,4) }
136
136
 
137
137
  # Range cannot be < single bucket
138
- assert_raises(ArgumentError) {bad_stats = Aggregate.new(16,32,17)}
138
+ assert_raises(ArgumentError) { Aggregate.new(16,32,17) }
139
139
 
140
140
  # Range % width must equal 0 (for now)
141
- assert_raises(ArgumentError) {bad_stats = Aggregate.new(1,16384,1024)}
141
+ assert_raises(ArgumentError) { Aggregate.new(1,16384,1024) }
142
142
  end
143
143
 
144
144
  #XXX: Update test_bucket_contents() if you muck with @@DATA
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggregate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Ruscio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-21 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Aggregate is a Ruby class for accumulating aggregate statistics and
14
14
  includes histogram support. For a detailed README see: http://github.com/josephruscio/aggregate'
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements: []
47
- rubygems_version: 3.0.3
47
+ rubygems_version: 3.3.26
48
48
  signing_key:
49
49
  specification_version: 3
50
50
  summary: Aggregate is a Ruby class for accumulating aggregate statistics and includes