add theta python tests, clean up typos in cpc/hll, ensure default see… · apache/datasketches-cpp@a8d95e0 · GitHub
Skip to content

Commit a8d95e0

Browse files
committed
add theta python tests, clean up typos in cpc/hll, ensure default seed supplied in theta wrapper
1 parent e073ccd commit a8d95e0

4 files changed

Lines changed: 133 additions & 8 deletions

File tree

python/src/theta_wrapper.cpp

Lines changed: 4 additions & 2 deletions

python/tests/cpc_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_cpc_example(self):
2323
k = 12 # 2^k = 4096 rows in the table
2424
n = 1 << 18 # ~256k unique values
2525

26-
# create a couple sketchrd and inject some values
26+
# create a couple sketches and inject some values
2727
# we'll have 1/4 of the values overlap
2828
cpc = cpc_sketch(k)
2929
cpc2 = cpc_sketch(k)
@@ -49,8 +49,9 @@ def test_cpc_example(self):
4949
union.update(cpc2)
5050
result = union.get_result()
5151

52-
# since CPC is deterministic, we have checked and know the
53-
# exact answer is within one standard deviation of the estimate
52+
# since our process here (including post-union CPC) is
53+
# deterministic, we have checked and know the exact
54+
# answer is within one standard deviation of the estimate
5455
self.assertLessEqual(result.get_lower_bound(1), 7 * n / 4)
5556
self.assertGreaterEqual(result.get_upper_bound(1), 7 * n / 4)
5657

python/tests/hll_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_hll_example(self):
2323
k = 12 # 2^k = 4096 rows in the table
2424
n = 1 << 18 # ~256k unique values
2525

26-
# create a couple sketchrd and inject some values
26+
# create a couple sketches and inject some values
2727
# we'll have 1/4 of the values overlap
2828
hll = hll_sketch(k, tgt_hll_type.HLL_8)
2929
hll2 = hll_sketch(k, tgt_hll_type.HLL_6)
@@ -50,8 +50,9 @@ def test_hll_example(self):
5050
result = union.get_result()
5151
self.assertEqual(result.get_estimate(), union.get_estimate())
5252

53-
# since HLL is deterministic, we have checked and know the
54-
# exact answer is within one standard deviation of the estimate
53+
# since our process here (including post-union HLL) is
54+
# deterministic, we have checked and know the exact
55+
# answer is within one standard deviation of the estimate
5556
self.assertLessEqual(union.get_lower_bound(1), 7 * n / 4)
5657
self.assertGreaterEqual(union.get_upper_bound(1), 7 * n / 4)
5758

python/tests/theta_test.py

Lines changed: 121 additions & 0 deletions

0 commit comments

Comments
 (0)