datasketches 0.2.6 → 0.2.7

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/LICENSE +4 -6
  4. data/NOTICE +6 -5
  5. data/lib/datasketches/version.rb +1 -1
  6. data/vendor/datasketches-cpp/CMakeLists.txt +1 -1
  7. data/vendor/datasketches-cpp/LICENSE +4 -6
  8. data/vendor/datasketches-cpp/MANIFEST.in +0 -2
  9. data/vendor/datasketches-cpp/common/test/CMakeLists.txt +13 -2
  10. data/vendor/datasketches-cpp/common/test/catch_runner.cpp +22 -1
  11. data/vendor/datasketches-cpp/common/test/integration_test.cpp +1 -1
  12. data/vendor/datasketches-cpp/cpc/test/compression_test.cpp +1 -1
  13. data/vendor/datasketches-cpp/cpc/test/cpc_sketch_allocation_test.cpp +1 -1
  14. data/vendor/datasketches-cpp/cpc/test/cpc_sketch_test.cpp +1 -1
  15. data/vendor/datasketches-cpp/cpc/test/cpc_union_test.cpp +1 -1
  16. data/vendor/datasketches-cpp/fi/include/reverse_purge_hash_map_impl.hpp +1 -1
  17. data/vendor/datasketches-cpp/fi/test/frequent_items_sketch_custom_type_test.cpp +1 -1
  18. data/vendor/datasketches-cpp/fi/test/frequent_items_sketch_test.cpp +1 -1
  19. data/vendor/datasketches-cpp/fi/test/reverse_purge_hash_map_test.cpp +1 -1
  20. data/vendor/datasketches-cpp/hll/test/AuxHashMapTest.cpp +1 -1
  21. data/vendor/datasketches-cpp/hll/test/CouponHashSetTest.cpp +1 -1
  22. data/vendor/datasketches-cpp/hll/test/CouponListTest.cpp +1 -1
  23. data/vendor/datasketches-cpp/hll/test/CrossCountingTest.cpp +1 -1
  24. data/vendor/datasketches-cpp/hll/test/HllArrayTest.cpp +1 -1
  25. data/vendor/datasketches-cpp/hll/test/HllSketchTest.cpp +1 -1
  26. data/vendor/datasketches-cpp/hll/test/HllUnionTest.cpp +1 -1
  27. data/vendor/datasketches-cpp/hll/test/IsomorphicTest.cpp +1 -1
  28. data/vendor/datasketches-cpp/hll/test/TablesTest.cpp +1 -1
  29. data/vendor/datasketches-cpp/hll/test/ToFromByteArrayTest.cpp +1 -1
  30. data/vendor/datasketches-cpp/kll/test/kll_sketch_custom_type_test.cpp +1 -1
  31. data/vendor/datasketches-cpp/kll/test/kll_sketch_test.cpp +1 -1
  32. data/vendor/datasketches-cpp/kll/test/kll_sketch_validation.cpp +1 -1
  33. data/vendor/datasketches-cpp/kll/test/kolmogorov_smirnov_test.cpp +1 -1
  34. data/vendor/datasketches-cpp/pyproject.toml +0 -1
  35. data/vendor/datasketches-cpp/python/README.md +1 -1
  36. data/vendor/datasketches-cpp/python/pybind11Path.cmd +1 -1
  37. data/vendor/datasketches-cpp/quantiles/test/kolmogorov_smirnov_test.cpp +1 -1
  38. data/vendor/datasketches-cpp/quantiles/test/quantiles_compatibility_test.cpp +1 -1
  39. data/vendor/datasketches-cpp/quantiles/test/quantiles_sketch_test.cpp +1 -1
  40. data/vendor/datasketches-cpp/req/test/req_sketch_custom_type_test.cpp +1 -1
  41. data/vendor/datasketches-cpp/req/test/req_sketch_test.cpp +1 -1
  42. data/vendor/datasketches-cpp/sampling/test/var_opt_allocation_test.cpp +1 -1
  43. data/vendor/datasketches-cpp/sampling/test/var_opt_sketch_test.cpp +1 -1
  44. data/vendor/datasketches-cpp/sampling/test/var_opt_union_test.cpp +1 -1
  45. data/vendor/datasketches-cpp/setup.py +2 -3
  46. data/vendor/datasketches-cpp/theta/test/theta_a_not_b_test.cpp +1 -1
  47. data/vendor/datasketches-cpp/theta/test/theta_intersection_test.cpp +1 -1
  48. data/vendor/datasketches-cpp/theta/test/theta_jaccard_similarity_test.cpp +1 -1
  49. data/vendor/datasketches-cpp/theta/test/theta_setop_test.cpp +1 -1
  50. data/vendor/datasketches-cpp/theta/test/theta_sketch_test.cpp +1 -1
  51. data/vendor/datasketches-cpp/theta/test/theta_union_test.cpp +1 -1
  52. data/vendor/datasketches-cpp/tuple/include/tuple_sketch_impl.hpp +25 -31
  53. data/vendor/datasketches-cpp/tuple/test/array_of_doubles_sketch_test.cpp +1 -1
  54. data/vendor/datasketches-cpp/tuple/test/tuple_a_not_b_test.cpp +1 -1
  55. data/vendor/datasketches-cpp/tuple/test/tuple_intersection_test.cpp +1 -1
  56. data/vendor/datasketches-cpp/tuple/test/tuple_jaccard_similarity_test.cpp +1 -1
  57. data/vendor/datasketches-cpp/tuple/test/tuple_sketch_allocation_test.cpp +1 -1
  58. data/vendor/datasketches-cpp/tuple/test/tuple_sketch_test.cpp +1 -1
  59. data/vendor/datasketches-cpp/tuple/test/tuple_union_test.cpp +1 -1
  60. metadata +2 -4
  61. data/vendor/datasketches-cpp/common/test/catch.hpp +0 -17618
  62. data/vendor/datasketches-cpp/common/test/test_runner.cpp +0 -29
@@ -353,8 +353,7 @@ size_t compact_tuple_sketch<S, A>::get_serialized_size_summaries_bytes(const SD&
353
353
  template<typename S, typename A>
354
354
  template<typename SerDe>
355
355
  void compact_tuple_sketch<S, A>::serialize(std::ostream& os, const SerDe& sd) const {
356
- const bool is_single_item = entries_.size() == 1 && !this->is_estimation_mode();
357
- const uint8_t preamble_longs = this->is_empty() || is_single_item ? 1 : this->is_estimation_mode() ? 3 : 2;
356
+ const uint8_t preamble_longs = this->is_estimation_mode() ? 3 : this->is_empty() || entries_.size() == 1 ? 1 : 2;
358
357
  write(os, preamble_longs);
359
358
  const uint8_t serial_version = SERIAL_VERSION;
360
359
  write(os, serial_version);
@@ -373,28 +372,25 @@ void compact_tuple_sketch<S, A>::serialize(std::ostream& os, const SerDe& sd) co
373
372
  write(os, flags_byte);
374
373
  const uint16_t seed_hash = get_seed_hash();
375
374
  write(os, seed_hash);
376
- if (!this->is_empty()) {
377
- if (!is_single_item) {
378
- const uint32_t num_entries = static_cast<uint32_t>(entries_.size());
379
- write(os, num_entries);
380
- const uint32_t unused32 = 0;
381
- write(os, unused32);
382
- if (this->is_estimation_mode()) {
383
- write(os, this->theta_);
384
- }
385
- }
386
- for (const auto& it: entries_) {
387
- write(os, it.first);
388
- sd.serialize(os, &it.second, 1);
389
- }
375
+ if (preamble_longs > 1) {
376
+ const uint32_t num_entries = static_cast<uint32_t>(entries_.size());
377
+ write(os, num_entries);
378
+ const uint32_t unused32 = 0;
379
+ write(os, unused32);
380
+ }
381
+ if (this->is_estimation_mode()) {
382
+ write(os, this->theta_);
383
+ }
384
+ for (const auto& it: entries_) {
385
+ write(os, it.first);
386
+ sd.serialize(os, &it.second, 1);
390
387
  }
391
388
  }
392
389
 
393
390
  template<typename S, typename A>
394
391
  template<typename SerDe>
395
392
  auto compact_tuple_sketch<S, A>::serialize(unsigned header_size_bytes, const SerDe& sd) const -> vector_bytes {
396
- const bool is_single_item = entries_.size() == 1 && !this->is_estimation_mode();
397
- const uint8_t preamble_longs = this->is_empty() || is_single_item ? 1 : this->is_estimation_mode() ? 3 : 2;
393
+ const uint8_t preamble_longs = this->is_estimation_mode() ? 3 : this->is_empty() || entries_.size() == 1 ? 1 : 2;
398
394
  const size_t size = header_size_bytes + sizeof(uint64_t) * preamble_longs
399
395
  + sizeof(uint64_t) * entries_.size() + get_serialized_size_summaries_bytes(sd);
400
396
  vector_bytes bytes(size, 0, entries_.get_allocator());
@@ -418,19 +414,17 @@ auto compact_tuple_sketch<S, A>::serialize(unsigned header_size_bytes, const Ser
418
414
  ptr += copy_to_mem(flags_byte, ptr);
419
415
  const uint16_t seed_hash = get_seed_hash();
420
416
  ptr += copy_to_mem(seed_hash, ptr);
421
- if (!this->is_empty()) {
422
- if (!is_single_item) {
423
- const uint32_t num_entries = static_cast<uint32_t>(entries_.size());
424
- ptr += copy_to_mem(num_entries, ptr);
425
- ptr += sizeof(uint32_t); // unused
426
- if (this->is_estimation_mode()) {
427
- ptr += copy_to_mem(theta_, ptr);
428
- }
429
- }
430
- for (const auto& it: entries_) {
431
- ptr += copy_to_mem(it.first, ptr);
432
- ptr += sd.serialize(ptr, end_ptr - ptr, &it.second, 1);
433
- }
417
+ if (preamble_longs > 1) {
418
+ const uint32_t num_entries = static_cast<uint32_t>(entries_.size());
419
+ ptr += copy_to_mem(num_entries, ptr);
420
+ ptr += sizeof(uint32_t); // unused
421
+ }
422
+ if (this->is_estimation_mode()) {
423
+ ptr += copy_to_mem(theta_, ptr);
424
+ }
425
+ for (const auto& it: entries_) {
426
+ ptr += copy_to_mem(it.first, ptr);
427
+ ptr += sd.serialize(ptr, end_ptr - ptr, &it.second, 1);
434
428
  }
435
429
  return bytes;
436
430
  }
@@ -22,7 +22,7 @@
22
22
  #include <sstream>
23
23
  #include <array>
24
24
 
25
- #include <catch.hpp>
25
+ #include <catch2/catch.hpp>
26
26
  #include <array_of_doubles_sketch.hpp>
27
27
  #include <array_of_doubles_union.hpp>
28
28
  #include <array_of_doubles_intersection.hpp>
@@ -19,7 +19,7 @@
19
19
 
20
20
  #include <iostream>
21
21
 
22
- #include <catch.hpp>
22
+ #include <catch2/catch.hpp>
23
23
  #include <tuple_a_not_b.hpp>
24
24
  #include <theta_sketch.hpp>
25
25
  #include <stdexcept>
@@ -19,7 +19,7 @@
19
19
 
20
20
  #include <iostream>
21
21
 
22
- #include <catch.hpp>
22
+ #include <catch2/catch.hpp>
23
23
  #include <tuple_intersection.hpp>
24
24
  #include <theta_sketch.hpp>
25
25
  #include <stdexcept>
@@ -19,7 +19,7 @@
19
19
 
20
20
  #include <iostream>
21
21
 
22
- #include <catch.hpp>
22
+ #include <catch2/catch.hpp>
23
23
 
24
24
  #include "tuple_jaccard_similarity.hpp"
25
25
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  #include <iostream>
21
21
 
22
- #include <catch.hpp>
22
+ #include <catch2/catch.hpp>
23
23
  #include <tuple_sketch.hpp>
24
24
  #include <test_allocator.hpp>
25
25
  #include <test_type.hpp>
@@ -32,7 +32,7 @@ std::ostream& operator<<(std::ostream& os, const three_doubles& tuple) {
32
32
 
33
33
  }
34
34
 
35
- #include <catch.hpp>
35
+ #include <catch2/catch.hpp>
36
36
  #include <tuple_sketch.hpp>
37
37
 
38
38
  namespace datasketches {
@@ -20,7 +20,7 @@
20
20
  #include <iostream>
21
21
  #include <stdexcept>
22
22
 
23
- #include <catch.hpp>
23
+ #include <catch2/catch.hpp>
24
24
  #include <tuple_union.hpp>
25
25
  #include <theta_sketch.hpp>
26
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datasketches
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-13 00:00:00.000000000 Z
11
+ date: 2022-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice
@@ -69,12 +69,10 @@ files:
69
69
  - vendor/datasketches-cpp/common/include/quantile_sketch_sorted_view_impl.hpp
70
70
  - vendor/datasketches-cpp/common/include/serde.hpp
71
71
  - vendor/datasketches-cpp/common/test/CMakeLists.txt
72
- - vendor/datasketches-cpp/common/test/catch.hpp
73
72
  - vendor/datasketches-cpp/common/test/catch_runner.cpp
74
73
  - vendor/datasketches-cpp/common/test/integration_test.cpp
75
74
  - vendor/datasketches-cpp/common/test/test_allocator.cpp
76
75
  - vendor/datasketches-cpp/common/test/test_allocator.hpp
77
- - vendor/datasketches-cpp/common/test/test_runner.cpp
78
76
  - vendor/datasketches-cpp/common/test/test_type.hpp
79
77
  - vendor/datasketches-cpp/cpc/CMakeLists.txt
80
78
  - vendor/datasketches-cpp/cpc/include/compression_data.hpp