Copilot commented on code in PR #287:
URL: https://github.com/apache/datasketches-rust/pull/287#discussion_r4177224670
##########
datasketches/src/tdigest/sketch.rs:
##########
@@ -1640,8 +1653,7 @@ impl TDigestView<'_> {
if value > self.max {
return Some(1.0);
}
- // one centroid and value == min == max
- if self.centroids.len() == 1 {
+ if self.min == self.max {
Review Comment:
`TDigestMut::rank` still returns `0.5` whenever `self.buffer.len() == 1`
(lines 493–495), so a mutable weighted single-centroid digest never reaches
this corrected `min == max` check. For the new `(min=0, mean=50, max=100,
weight=10)` case, `rank(18.75)` therefore returns `0.5`, while the frozen
digest returns `0.25`. The mutable shortcut should also be restricted to `min
== max` (and the regression should exercise both APIs).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]