tisonkun commented on code in PR #232:
URL: https://github.com/apache/datasketches-rust/pull/232#discussion_r3877441228


##########
datasketches/src/cpc/sketch.rs:
##########
@@ -471,6 +472,35 @@ impl CpcSketch {
     }
 }
 
+impl fmt::Display for CpcSketch {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let flavor = match self.flavor() {
+            Flavor::Empty => "Empty",
+            Flavor::Sparse => "Sparse",
+            Flavor::Hybrid => "Hybrid",
+            Flavor::Pinned => "Pinned",
+            Flavor::Sliding => "Sliding",
+        };
+
+        writeln!(f, "CPC Sketch Summary:")?;
+        writeln!(f, "  flavor            : {flavor}")?;
+        writeln!(f, "  lg k              : {}", self.lg_k())?;
+        writeln!(f, "  merged            : {}", self.merge_flag)?;
+        writeln!(
+            f,
+            "  lower bound       : {}",
+            self.lower_bound(NumStdDev::One)

Review Comment:
   Why `NumStdDev::One`? Could you point out the referenced implementation?



##########
datasketches/src/cpc/sketch.rs:
##########
@@ -471,6 +472,35 @@ impl CpcSketch {
     }
 }
 
+impl fmt::Display for CpcSketch {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        let flavor = match self.flavor() {
+            Flavor::Empty => "Empty",
+            Flavor::Sparse => "Sparse",
+            Flavor::Hybrid => "Hybrid",
+            Flavor::Pinned => "Pinned",
+            Flavor::Sliding => "Sliding",
+        };
+
+        writeln!(f, "CPC Sketch Summary:")?;
+        writeln!(f, "  flavor            : {flavor}")?;
+        writeln!(f, "  lg k              : {}", self.lg_k())?;
+        writeln!(f, "  merged            : {}", self.merge_flag)?;
+        writeln!(
+            f,
+            "  lower bound       : {}",
+            self.lower_bound(NumStdDev::One)
+        )?;
+        writeln!(f, "  estimate          : {}", self.estimate())?;
+        writeln!(
+            f,
+            "  upper bound       : {}",
+            self.upper_bound(NumStdDev::One)

Review Comment:
   Ditto



-- 
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]

Reply via email to