datasketches 0.2.6 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/LICENSE +4 -6
- data/NOTICE +6 -5
- data/ext/datasketches/kll_wrapper.cpp +20 -20
- data/ext/datasketches/theta_wrapper.cpp +2 -2
- data/lib/datasketches/version.rb +1 -1
- data/vendor/datasketches-cpp/CMakeLists.txt +9 -1
- data/vendor/datasketches-cpp/LICENSE +4 -6
- data/vendor/datasketches-cpp/MANIFEST.in +21 -4
- data/vendor/datasketches-cpp/common/CMakeLists.txt +5 -2
- data/vendor/datasketches-cpp/common/include/common_defs.hpp +10 -0
- data/vendor/datasketches-cpp/common/include/kolmogorov_smirnov_impl.hpp +6 -6
- data/vendor/datasketches-cpp/common/include/memory_operations.hpp +1 -0
- data/vendor/datasketches-cpp/common/include/{quantile_sketch_sorted_view.hpp → quantiles_sorted_view.hpp} +60 -25
- data/vendor/datasketches-cpp/common/include/quantiles_sorted_view_impl.hpp +125 -0
- data/vendor/datasketches-cpp/common/{test/test_runner.cpp → include/version.hpp.in} +15 -8
- data/vendor/datasketches-cpp/common/test/CMakeLists.txt +37 -7
- data/vendor/datasketches-cpp/common/test/catch_runner.cpp +22 -1
- data/vendor/datasketches-cpp/common/test/integration_test.cpp +1 -1
- data/vendor/datasketches-cpp/common/test/quantiles_sorted_view_test.cpp +459 -0
- data/vendor/datasketches-cpp/cpc/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/cpc/test/compression_test.cpp +1 -1
- data/vendor/datasketches-cpp/cpc/test/cpc_sketch_allocation_test.cpp +1 -1
- data/vendor/datasketches-cpp/cpc/test/cpc_sketch_test.cpp +1 -1
- data/vendor/datasketches-cpp/cpc/test/cpc_union_test.cpp +1 -1
- data/vendor/datasketches-cpp/fi/include/frequent_items_sketch.hpp +28 -44
- data/vendor/datasketches-cpp/fi/include/frequent_items_sketch_impl.hpp +70 -78
- data/vendor/datasketches-cpp/fi/include/reverse_purge_hash_map.hpp +11 -4
- data/vendor/datasketches-cpp/fi/include/reverse_purge_hash_map_impl.hpp +17 -10
- data/vendor/datasketches-cpp/fi/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/fi/test/frequent_items_sketch_custom_type_test.cpp +55 -42
- data/vendor/datasketches-cpp/fi/test/frequent_items_sketch_test.cpp +1 -1
- data/vendor/datasketches-cpp/fi/test/reverse_purge_hash_map_test.cpp +4 -4
- data/vendor/datasketches-cpp/hll/include/Hll4Array-internal.hpp +2 -2
- data/vendor/datasketches-cpp/hll/test/AuxHashMapTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/hll/test/CouponHashSetTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/CouponListTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/CrossCountingTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/HllArrayTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/HllSketchTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/HllUnionTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/IsomorphicTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/TablesTest.cpp +1 -1
- data/vendor/datasketches-cpp/hll/test/ToFromByteArrayTest.cpp +1 -1
- data/vendor/datasketches-cpp/kll/include/kll_helper.hpp +0 -32
- data/vendor/datasketches-cpp/kll/include/kll_sketch.hpp +176 -233
- data/vendor/datasketches-cpp/kll/include/kll_sketch_impl.hpp +337 -395
- data/vendor/datasketches-cpp/kll/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/kll/test/kll_sketch_custom_type_test.cpp +27 -27
- data/vendor/datasketches-cpp/kll/test/kll_sketch_test.cpp +197 -233
- data/vendor/datasketches-cpp/kll/test/kll_sketch_validation.cpp +42 -32
- data/vendor/datasketches-cpp/kll/test/kolmogorov_smirnov_test.cpp +1 -1
- data/vendor/datasketches-cpp/pyproject.toml +17 -13
- data/vendor/datasketches-cpp/python/CMakeLists.txt +8 -1
- data/vendor/datasketches-cpp/python/README.md +1 -1
- data/vendor/datasketches-cpp/python/datasketches/PySerDe.py +104 -0
- data/vendor/datasketches-cpp/python/datasketches/__init__.py +22 -0
- data/vendor/datasketches-cpp/python/include/py_serde.hpp +113 -0
- data/vendor/datasketches-cpp/python/jupyter/ThetaSketchNotebook.ipynb +31 -24
- data/vendor/datasketches-cpp/python/pybind11Path.cmd +19 -1
- data/vendor/datasketches-cpp/python/src/__init__.py +17 -1
- data/vendor/datasketches-cpp/python/src/datasketches.cpp +9 -3
- data/vendor/datasketches-cpp/python/src/kll_wrapper.cpp +18 -54
- data/vendor/datasketches-cpp/python/src/py_serde.cpp +111 -0
- data/vendor/datasketches-cpp/python/src/quantiles_wrapper.cpp +17 -53
- data/vendor/datasketches-cpp/python/src/req_wrapper.cpp +17 -55
- data/vendor/datasketches-cpp/python/src/vector_of_kll.cpp +62 -67
- data/vendor/datasketches-cpp/python/src/vo_wrapper.cpp +47 -14
- data/vendor/datasketches-cpp/python/tests/__init__.py +16 -0
- data/vendor/datasketches-cpp/python/tests/req_test.py +1 -1
- data/vendor/datasketches-cpp/python/tests/vo_test.py +25 -1
- data/vendor/datasketches-cpp/quantiles/include/quantiles_sketch.hpp +135 -180
- data/vendor/datasketches-cpp/quantiles/include/quantiles_sketch_impl.hpp +205 -210
- data/vendor/datasketches-cpp/quantiles/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/quantiles/test/kolmogorov_smirnov_test.cpp +1 -1
- data/vendor/datasketches-cpp/quantiles/test/quantiles_compatibility_test.cpp +20 -19
- data/vendor/datasketches-cpp/quantiles/test/quantiles_sketch_test.cpp +241 -233
- data/vendor/datasketches-cpp/req/include/req_compactor.hpp +15 -9
- data/vendor/datasketches-cpp/req/include/req_compactor_impl.hpp +35 -19
- data/vendor/datasketches-cpp/req/include/req_sketch.hpp +126 -147
- data/vendor/datasketches-cpp/req/include/req_sketch_impl.hpp +265 -245
- data/vendor/datasketches-cpp/req/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/req/test/req_sketch_custom_type_test.cpp +27 -27
- data/vendor/datasketches-cpp/req/test/req_sketch_test.cpp +117 -104
- data/vendor/datasketches-cpp/sampling/include/var_opt_sketch.hpp +22 -46
- data/vendor/datasketches-cpp/sampling/include/var_opt_sketch_impl.hpp +180 -207
- data/vendor/datasketches-cpp/sampling/include/var_opt_union.hpp +18 -39
- data/vendor/datasketches-cpp/sampling/include/var_opt_union_impl.hpp +75 -85
- data/vendor/datasketches-cpp/sampling/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/sampling/test/var_opt_allocation_test.cpp +7 -7
- data/vendor/datasketches-cpp/sampling/test/var_opt_sketch_test.cpp +3 -3
- data/vendor/datasketches-cpp/sampling/test/var_opt_union_test.cpp +5 -5
- data/vendor/datasketches-cpp/setup.py +14 -3
- data/vendor/datasketches-cpp/theta/include/theta_sketch_impl.hpp +15 -25
- data/vendor/datasketches-cpp/theta/include/theta_update_sketch_base.hpp +0 -9
- data/vendor/datasketches-cpp/theta/include/theta_update_sketch_base_impl.hpp +5 -5
- data/vendor/datasketches-cpp/theta/test/CMakeLists.txt +1 -1
- data/vendor/datasketches-cpp/theta/test/theta_a_not_b_test.cpp +1 -1
- data/vendor/datasketches-cpp/theta/test/theta_intersection_test.cpp +1 -1
- data/vendor/datasketches-cpp/theta/test/theta_jaccard_similarity_test.cpp +1 -1
- data/vendor/datasketches-cpp/theta/test/theta_setop_test.cpp +1 -1
- data/vendor/datasketches-cpp/theta/test/theta_sketch_test.cpp +3 -2
- data/vendor/datasketches-cpp/theta/test/theta_union_test.cpp +1 -1
- data/vendor/datasketches-cpp/tox.ini +26 -0
- data/vendor/datasketches-cpp/tuple/include/tuple_sketch.hpp +36 -12
- data/vendor/datasketches-cpp/tuple/include/tuple_sketch_impl.hpp +41 -35
- data/vendor/datasketches-cpp/tuple/test/CMakeLists.txt +2 -1
- data/vendor/datasketches-cpp/tuple/test/array_of_doubles_sketch_test.cpp +1 -1
- data/vendor/datasketches-cpp/tuple/test/engagement_test.cpp +299 -0
- data/vendor/datasketches-cpp/tuple/test/tuple_a_not_b_test.cpp +1 -1
- data/vendor/datasketches-cpp/tuple/test/tuple_intersection_test.cpp +1 -1
- data/vendor/datasketches-cpp/tuple/test/tuple_jaccard_similarity_test.cpp +1 -1
- data/vendor/datasketches-cpp/tuple/test/tuple_sketch_allocation_test.cpp +1 -1
- data/vendor/datasketches-cpp/tuple/test/tuple_sketch_test.cpp +27 -1
- data/vendor/datasketches-cpp/tuple/test/tuple_union_test.cpp +1 -1
- data/vendor/datasketches-cpp/version.cfg.in +1 -0
- metadata +14 -7
- data/vendor/datasketches-cpp/common/include/quantile_sketch_sorted_view_impl.hpp +0 -91
- data/vendor/datasketches-cpp/common/test/catch.hpp +0 -17618
@@ -17,7 +17,7 @@
|
|
17
17
|
* under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
#include <catch.hpp>
|
20
|
+
#include <catch2/catch.hpp>
|
21
21
|
#include <cmath>
|
22
22
|
#include <sstream>
|
23
23
|
#include <fstream>
|
@@ -52,7 +52,7 @@ static void quantiles_decode_and_check(uint16_t k, uint64_t n, const std::string
|
|
52
52
|
std::string filename = testBinaryInputPath + filestr.str();
|
53
53
|
|
54
54
|
is.open(filename, std::ios::binary);
|
55
|
-
auto sketch_stream = quantiles_double_sketch::deserialize(is, serde<double>(), 0);
|
55
|
+
auto sketch_stream = quantiles_double_sketch::deserialize(is, serde<double>(), std::less<double>(), 0);
|
56
56
|
is.close();
|
57
57
|
REQUIRE(sketch_stream.get_quantile(median_rank) == expected_median);
|
58
58
|
|
@@ -62,7 +62,8 @@ static void quantiles_decode_and_check(uint16_t k, uint64_t n, const std::string
|
|
62
62
|
(std::istreambuf_iterator<char>(infile)),
|
63
63
|
(std::istreambuf_iterator<char>()));
|
64
64
|
infile.close();
|
65
|
-
auto sketch_bytes = quantiles_double_sketch::deserialize(bytes.data(), bytes.size(), serde<double>(),
|
65
|
+
auto sketch_bytes = quantiles_double_sketch::deserialize(bytes.data(), bytes.size(), serde<double>(),
|
66
|
+
std::less<double>(), 0);
|
66
67
|
REQUIRE(sketch_bytes.get_quantile(median_rank) == expected_median);
|
67
68
|
}
|
68
69
|
|
@@ -73,50 +74,50 @@ TEST_CASE("quantiles compatibility", "[quantiles_compatibility]") {
|
|
73
74
|
|
74
75
|
SECTION("Qk128_n50_v0.3.0.sk") {
|
75
76
|
// file: Qk128_n50_v0.3.0.sk
|
76
|
-
// median:
|
77
|
-
quantiles_decode_and_check(128, 50, "0.3.0",
|
77
|
+
// median: 25
|
78
|
+
quantiles_decode_and_check(128, 50, "0.3.0", 25);
|
78
79
|
}
|
79
80
|
|
80
81
|
SECTION("Qk128_n1000_v0.3.0.sk") {
|
81
82
|
// file: Qk128_n1000_v0.3.0.sk
|
82
|
-
// median:
|
83
|
-
quantiles_decode_and_check(128, 1000, "0.3.0",
|
83
|
+
// median: ~500
|
84
|
+
quantiles_decode_and_check(128, 1000, "0.3.0", 497);
|
84
85
|
}
|
85
86
|
|
86
87
|
SECTION("Qk128_n50_v0.6.0.sk") {
|
87
88
|
// file: Qk128_n50_v0.6.0.sk
|
88
|
-
// median:
|
89
|
-
quantiles_decode_and_check(128, 50, "0.6.0",
|
89
|
+
// median: 25
|
90
|
+
quantiles_decode_and_check(128, 50, "0.6.0", 25);
|
90
91
|
}
|
91
92
|
|
92
93
|
SECTION("Qk128_n1000_v0.6.0.sk") {
|
93
94
|
// file: Qk128_n1000_v0.6.0.sk
|
94
|
-
// median:
|
95
|
-
quantiles_decode_and_check(128, 1000, "0.6.0",
|
95
|
+
// median: ~500
|
96
|
+
quantiles_decode_and_check(128, 1000, "0.6.0", 497);
|
96
97
|
}
|
97
98
|
|
98
99
|
SECTION("Qk128_n50_v0.8.0.sk") {
|
99
100
|
// file: Qk128_n50_v0.8.0.sk
|
100
|
-
// median:
|
101
|
-
quantiles_decode_and_check(128, 50, "0.8.0",
|
101
|
+
// median: 25
|
102
|
+
quantiles_decode_and_check(128, 50, "0.8.0", 25);
|
102
103
|
}
|
103
104
|
|
104
105
|
SECTION("Qk128_n1000_v0.8.0.sk") {
|
105
106
|
// file: Qk128_n1000_v0.8.0.sk
|
106
|
-
// median:
|
107
|
-
quantiles_decode_and_check(128, 1000, "0.8.0",
|
107
|
+
// median: ~500
|
108
|
+
quantiles_decode_and_check(128, 1000, "0.8.0", 497);
|
108
109
|
}
|
109
110
|
|
110
111
|
SECTION("Qk128_n50_v0.8.3.sk") {
|
111
112
|
// file: Qk128_n50_v0.8.3.sk
|
112
|
-
// median:
|
113
|
-
quantiles_decode_and_check(128, 50, "0.8.3",
|
113
|
+
// median: 25
|
114
|
+
quantiles_decode_and_check(128, 50, "0.8.3", 25);
|
114
115
|
}
|
115
116
|
|
116
117
|
SECTION("Qk128_n1000_v0.8.3.sk") {
|
117
118
|
// file: Qk128_n1000_v0.8.3.sk
|
118
|
-
// median:
|
119
|
-
quantiles_decode_and_check(128, 1000, "0.8.3",
|
119
|
+
// median: ~500
|
120
|
+
quantiles_decode_and_check(128, 1000, "0.8.3", 497);
|
120
121
|
}
|
121
122
|
|
122
123
|
// cleanup
|