tisonkun opened a new pull request, #370:
URL: https://github.com/apache/datasketches-rust/pull/370

   ## Summary
   
   This PR improves API safety, consistency, and ergonomics across 
`datasketches`.
   
   * **Validate REQ confidence bound ranks (breaking)**: 
`ReqSketch::rank_lower_bound` and `ReqSketch::rank_upper_bound` now validate 
normalized `rank` inputs before checking empty or exact-mode state (returning 
`Err` with `ErrorKind::InvalidArgument` for `NaN` or values outside 
`0.0..=1.0`) and return `Result<f64, Error>`, matching `quantile`, `quantiles`, 
`cdf`, and `pmf`.
   * **Memory usage estimation for KLL and REQ**: Add `estimated_size(&self) -> 
usize` to `KllSketch` and `ReqSketch` (backed by `Compactor` buffer capacity) 
using shallow heap capacity accounting consistent with the rest of the crate.
   * **Standard trait completeness and decode safety**: Derive `Clone` on 
`TDigest`, `ThetaSketchBuilder`, `TupleSketchBuilder`, and `TupleUnionBuilder`; 
add `Eq` to `CountMinSketch`, `KllSketch`, `NumStdDev`, and `Error`; add `Hash` 
to `NumStdDev`, `ResizeFactor`, and `SearchCriteria`; derive `Clone` and 
`PartialEq` on `Error`; derive `Debug` and `Clone` on `SketchBytes` and 
`SketchSlice` (and `Default` on `SketchBytes`); implement `Debug` on 
`ReqSketchIterator` without requiring `T: Debug`; and use saturating offset 
arithmetic (`saturating_add`) in `SketchSlice::advance`.
   * **`#[must_use]` annotations**: Annotate pure value, enum, error, builder, 
view, iterator, and codec types alongside pure getters, queries, non-mutating 
serializers, and non-mutating conversions (`compact`, `to_sketch`, `freeze`, 
`unfreeze`) across public modules, while excluding 
`Result`/`Iterator`/already-`#[must_use]` return types and `&mut self` mutators 
such as `BloomFilter::contains_and_insert`.
   * **Changelog**: Document the breaking change, new features, and API/trait 
improvements under `## Unreleased`.
   
   ## Commits
   
   | Commit    | Subject                                                        
                 |
   | --------- | 
------------------------------------------------------------------------------- 
|
   | `774baac` | `fix(req)!: validate rank bounds in confidence bound queries`  
                 |
   | `7aaf4f7` | `feat(kll,req): add estimated_size to KllSketch and ReqSketch` 
                 |
   | `02eb655` | `feat: implement Clone for TDigest and Theta/Tuple builders`   
                 |
   | `8295662` | `feat: complete Eq, Hash, Debug, Default, and 
SketchSlice::advance safety`      |
   | `350aaa1` | `refactor: add #[must_use] to builders, Error, and pure 
query/encoding methods` |
   
   ## Validation
   
   * `cargo x check`: passed (`--no-default-features`, each individual feature, 
and `--all-features` with `-Dwarnings`).
   * `cargo x test`: 751 passed, 0 failed, 0 ignored (unit, integration, serde, 
benchmarks, and 135 doctests).
   * `cargo x lint`: passed (`clippy -D warnings`, `rustfmt --check`, `rustdoc 
--cfg docsrs -D warnings`, `taplo`, `typos`, and `hawkeye`).
   * `cargo +1.86.0 check -p datasketches --all-features`: passed.
   


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