You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2020/02/19 23:07:18 UTC

[incubator-datasketches-cpp] 03/03: expose only hll's get_estimate() method in python warpper

This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a commit to branch hll_single_estimate_call
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git

commit e7ac6ffa4c7a05b3cc1ac871c55acc05fac73645
Author: Jon Malkin <jm...@users.noreply.github.com>
AuthorDate: Wed Feb 19 15:06:57 2020 -0800

    expose only hll's get_estimate() method in python warpper
---
 python/src/hll_wrapper.cpp | 2 --
 python/tests/hll_test.py   | 7 -------
 2 files changed, 9 deletions(-)

diff --git a/python/src/hll_wrapper.cpp b/python/src/hll_wrapper.cpp
index 24b3530..cd57d15 100644
--- a/python/src/hll_wrapper.cpp
+++ b/python/src/hll_wrapper.cpp
@@ -84,7 +84,6 @@ void init_hll(py::module &m) {
     .def_property_readonly("lg_config_k", &hll_sketch::get_lg_config_k)
     .def_property_readonly("tgt_type", &hll_sketch::get_target_type)
     .def("get_estimate", &hll_sketch::get_estimate)
-    .def("get_composite_estimate", &hll_sketch::get_composite_estimate)
     .def("get_lower_bound", &hll_sketch::get_lower_bound, py::arg("num_std_devs"))
     .def("get_upper_bound", &hll_sketch::get_upper_bound, py::arg("num_std_devs"))
     .def("is_compact", &hll_sketch::is_compact)
@@ -113,7 +112,6 @@ void init_hll(py::module &m) {
     .def_property_readonly("lg_config_k", &hll_union::get_lg_config_k)
     .def_property_readonly("tgt_type", &hll_union::get_target_type)
     .def("get_estimate", &hll_union::get_estimate)
-    .def("get_composite_estimate", &hll_union::get_composite_estimate)
     .def("get_lower_bound", &hll_union::get_lower_bound, py::arg("num_std_devs"))
     .def("get_upper_bound", &hll_union::get_upper_bound, py::arg("num_std_devs"))
     .def("is_compact", &hll_union::is_compact)
diff --git a/python/tests/hll_test.py b/python/tests/hll_test.py
index 0fb727e..9403362 100644
--- a/python/tests/hll_test.py
+++ b/python/tests/hll_test.py
@@ -34,9 +34,6 @@ class HllTest(unittest.TestCase):
             hll.update(i)
             hll2.update(i + offset)
         
-        # although we provide get_composite_estimate() and get_estimate(),
-        # the latter will always give the best available estimate.  we
-        # recommend using get_estimate().
         # we can check that the upper and lower bounds bracket the
         # estimate, without needing to know the exact value.
         self.assertLessEqual(hll.get_lower_bound(1), hll.get_estimate())
@@ -78,9 +75,7 @@ class HllTest(unittest.TestCase):
         hll.update(3.14159) # double data
 
         self.assertLessEqual(hll.get_lower_bound(1), hll.get_estimate())
-        self.assertLessEqual(hll.get_lower_bound(1), hll.get_composite_estimate())
         self.assertGreaterEqual(hll.get_upper_bound(1), hll.get_estimate())
-        self.assertGreaterEqual(hll.get_upper_bound(1), hll.get_composite_estimate())
 
         self.assertEqual(hll.lg_config_k, k)
         self.assertEqual(hll.tgt_type, tgt_hll_type.HLL_6)
@@ -115,9 +110,7 @@ class HllTest(unittest.TestCase):
         union.update(1.4142136)
 
         self.assertLessEqual(union.get_lower_bound(1), union.get_estimate())
-        self.assertLessEqual(union.get_lower_bound(1), union.get_composite_estimate())
         self.assertGreaterEqual(union.get_upper_bound(1), union.get_estimate())
-        self.assertGreaterEqual(union.get_upper_bound(1), union.get_composite_estimate())
 
         self.assertEqual(union.lg_config_k, k)
         self.assertFalse(union.is_compact())


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org