Skip to content

Commit

Permalink
Merge pull request #9 from zolkko/add_gh_actions
Browse files Browse the repository at this point in the history
Fix crate's version in README.md
  • Loading branch information
zolkko authored Jul 8, 2024
2 parents 08f5762 + 1096a5a commit a9d6e0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Add this to your Cargo.toml:

```toml
[dependencies]
kendalls = "0.2.1"
kendalls = "0.2.2"
```

and this to your crate root:
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ where
let z = s / var_s.sqrt();

// Limit range to fix computational errors
Ok((tau_b.max(-1.0).min(1.0), z))
Ok((tau_b.clamp(-1.0, 1.0), z))
}

#[inline]
Expand Down Expand Up @@ -320,7 +320,7 @@ mod tests {
];

let (tau_b, z) = tau_b_with_comparator(&x, &y, |a: &f64, b: &f64| {
a.partial_cmp(&b).unwrap_or(Ordering::Greater)
a.partial_cmp(b).unwrap_or(Ordering::Greater)
})
.unwrap();

Expand All @@ -330,7 +330,7 @@ mod tests {

#[test]
fn shifted_test() {
let comparator = |a: &f64, b: &f64| a.partial_cmp(&b).unwrap_or(Ordering::Greater);
let comparator = |a: &f64, b: &f64| a.partial_cmp(b).unwrap_or(Ordering::Greater);

let x = &[1.0, 1.0, 2.0, 2.0, 3.0, 3.0];
let y = &[1.0, 2.0, 2.0, 3.0, 3.0, 4.0];
Expand Down Expand Up @@ -371,7 +371,7 @@ mod tests {

assert_eq!(
tau_b_with_comparator(x, y, |a: &f64, b: &f64| a
.partial_cmp(&b)
.partial_cmp(b)
.unwrap_or(Ordering::Greater)),
Ok((expected_tau_b, expected_z))
);
Expand All @@ -387,7 +387,7 @@ mod tests {

assert_eq!(
tau_b_with_comparator(&x, &y, |a: &f64, b: &f64| a
.partial_cmp(&b)
.partial_cmp(b)
.unwrap_or(Ordering::Greater)),
Ok((0.0, 0.0))
);
Expand Down Expand Up @@ -436,7 +436,7 @@ mod tests {

let result = std::panic::catch_unwind(|| {
let (_tau, _significance) = tau_b_with_comparator(&x, &y, |a: &f64, b: &f64| {
a.partial_cmp(&b).unwrap_or(Ordering::Greater)
a.partial_cmp(b).unwrap_or(Ordering::Greater)
})
.unwrap();
});
Expand Down

0 comments on commit a9d6e0f

Please sign in to comment.