AsherJingkongChen / floating-distance

Measure distance between floating-point vectors in Rust
https://docs.rs/floating-distance
MIT License
1 stars 0 forks source link

Update from version 0.2.0 to 0.3.0. #8

Closed AsherJingkongChen closed 11 months ago

AsherJingkongChen commented 11 months ago

Background This update addresses the issue related to API changes in the library. Specifically, the change involves the Vector::distance method, which has been replaced with the Metric::measure method to calculate the distance between vectors. The updated API now follows the signature:

- Vector::distance(&self, other: &Self, metric: Metric) -> T;
+ Metric::measure(&self, v0: &[T], v1: &[T]) -> T;

Changes

Reasons The API change was made to improve clarity and consistency within the library. By introducing the Metric::measure method, it provides a more descriptive and intuitive way to calculate distances between vectors. Additionally, refactoring the simd module enhances maintainability, making it easier to maintain and extend the codebase.

codecov[bot] commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (963da3f) 100.00% compared to head (f43c550) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #8 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 3 2 -1 Lines 63 66 +3 ========================================= + Hits 63 66 +3 ``` | [Files](https://app.codecov.io/gh/AsherJingkongChen/floating-distance/pull/8?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChenYiran) | Coverage Δ | | |---|---|---| | [src/lib.rs](https://app.codecov.io/gh/AsherJingkongChen/floating-distance/pull/8?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChenYiran#diff-c3JjL2xpYi5ycw==) | `100.00% <ø> (ø)` | | | [src/metric/measure.rs](https://app.codecov.io/gh/AsherJingkongChen/floating-distance/pull/8?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChenYiran#diff-c3JjL21ldHJpYy9tZWFzdXJlLnJz) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.