You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by "AlexanderSaydakov (via GitHub)" <gi...@apache.org> on 2024/02/13 23:17:28 UTC

[PR] better naming, no forced compression [datasketches-cpp]

AlexanderSaydakov opened a new pull request, #423:
URL: https://github.com/apache/datasketches-cpp/pull/423

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] better naming, no forced compression [datasketches-cpp]

Posted by "AlexanderSaydakov (via GitHub)" <gi...@apache.org>.
AlexanderSaydakov merged PR #423:
URL: https://github.com/apache/datasketches-cpp/pull/423


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] better naming, no forced compression [datasketches-cpp]

Posted by "jmalkin (via GitHub)" <gi...@apache.org>.
jmalkin commented on code in PR #423:
URL: https://github.com/apache/datasketches-cpp/pull/423#discussion_r1493131728


##########
tdigest/include/tdigest_impl.hpp:
##########
@@ -111,18 +111,18 @@ double tdigest<T, A>::get_rank(T value) const {
   const T last_mean = centroids_.back().get_mean();
   if (value > last_mean) {
     if (max_ - last_mean > 0) {
-      if (value == max_) return 1.0 - 0.5 / total_weight_;
-        return 1 - ((1 + (max_ - value) / (max_ - last_mean) * (centroids_.back().get_weight() / 2.0 - 1.0)) / total_weight_); // ?
+      if (value == max_) return 1.0 - 0.5 / centroids_weight_;
+        return 1.0 - ((1.0 + (max_ - value) / (max_ - last_mean) * (centroids_.back().get_weight() / 2.0 - 1.0)) / centroids_weight_); // ?
     }
     return 1; // should never happen
   }
 
-  auto lower = std::lower_bound(centroids_.begin(), centroids_.end(), centroid(value, 1), centroid_cmp(false));
+  auto lower = std::lower_bound(centroids_.begin(), centroids_.end(), centroid(value, 1), centroid_cmp());
   if (lower == centroids_.end()) throw std::logic_error("lower == end in get_rank()");
-  auto upper = std::upper_bound(lower, centroids_.end(), centroid(value, 1), centroid_cmp(false));
+  auto upper = std::upper_bound(lower, centroids_.end(), centroid(value, 1), centroid_cmp());
   if (upper == centroids_.begin()) throw std::logic_error("upper == begin in get_rank()");
   if (value < lower->get_mean()) --lower;
-  if (upper == centroids_.end() || (upper != centroids_.begin() && !((upper - 1)->get_mean() < value))) --upper;
+  if (upper == centroids_.end() || !((upper - 1)->get_mean() < value)) --upper;

Review Comment:
   Not sure what this does so I'll have to trust that it's correct



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] better naming, no forced compression [datasketches-cpp]

Posted by "coveralls (via GitHub)" <gi...@apache.org>.
coveralls commented on PR #423:
URL: https://github.com/apache/datasketches-cpp/pull/423#issuecomment-1942827948

   ## Pull Request Test Coverage Report for [Build 7894017898](https://coveralls.io/builds/65681058)
   
   
   ### Details
   
   * **-6** of **38**   **(84.21%)**  changed or added relevant lines in **2** files are covered.
   * No unchanged relevant lines lost coverage.
   * Overall coverage increased (+**0.005%**) to **98.704%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [tdigest/include/tdigest_impl.hpp](https://coveralls.io/builds/65681058/source?filename=tdigest%2Finclude%2Ftdigest_impl.hpp#L55) | 29 | 35 | 82.86%
   <!-- | **Total:** | **32** | **38** | **84.21%** | -->
   
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/65681058/badge)](https://coveralls.io/builds/65681058) |
   | :-- | --: |
   | Change from base [Build 7893537380](https://coveralls.io/builds/65680166): |  0.005% |
   | Covered Lines: | 16377 |
   | Relevant Lines: | 16592 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] better naming, no forced compression [datasketches-cpp]

Posted by "AlexanderSaydakov (via GitHub)" <gi...@apache.org>.
AlexanderSaydakov commented on code in PR #423:
URL: https://github.com/apache/datasketches-cpp/pull/423#discussion_r1496562699


##########
tdigest/include/tdigest_impl.hpp:
##########
@@ -111,18 +111,18 @@ double tdigest<T, A>::get_rank(T value) const {
   const T last_mean = centroids_.back().get_mean();
   if (value > last_mean) {
     if (max_ - last_mean > 0) {
-      if (value == max_) return 1.0 - 0.5 / total_weight_;
-        return 1 - ((1 + (max_ - value) / (max_ - last_mean) * (centroids_.back().get_weight() / 2.0 - 1.0)) / total_weight_); // ?
+      if (value == max_) return 1.0 - 0.5 / centroids_weight_;
+        return 1.0 - ((1.0 + (max_ - value) / (max_ - last_mean) * (centroids_.back().get_weight() / 2.0 - 1.0)) / centroids_weight_); // ?
     }
     return 1; // should never happen
   }
 
-  auto lower = std::lower_bound(centroids_.begin(), centroids_.end(), centroid(value, 1), centroid_cmp(false));
+  auto lower = std::lower_bound(centroids_.begin(), centroids_.end(), centroid(value, 1), centroid_cmp());
   if (lower == centroids_.end()) throw std::logic_error("lower == end in get_rank()");
-  auto upper = std::upper_bound(lower, centroids_.end(), centroid(value, 1), centroid_cmp(false));
+  auto upper = std::upper_bound(lower, centroids_.end(), centroid(value, 1), centroid_cmp());
   if (upper == centroids_.begin()) throw std::logic_error("upper == begin in get_rank()");
   if (value < lower->get_mean()) --lower;
-  if (upper == centroids_.end() || (upper != centroids_.begin() && !((upper - 1)->get_mean() < value))) --upper;
+  if (upper == centroids_.end() || !((upper - 1)->get_mean() < value)) --upper;

Review Comment:
   there is a check already just above that if (upper == begin) throw



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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