Skip to content

Commit 8c9409a

Browse files
committed
Add patch for FromPrimitive support in noisy_float
1 parent ab47c1d commit 8c9409a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ rand = "0.5"
1111

1212
[dev-dependencies]
1313
quickcheck = "0.7"
14+
15+
[patch.crates-io]
16+
noisy_float = { git = "https://github.com/SergiusIW/noisy_float-rs.git", rev = "de01a40ceb1443110fe0b53f93c5164934e5c126" }

tests/quantile.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,14 @@ fn test_quantile_axis_skipnan_mut_midpoint_opt_i32() {
123123
assert!(q[1].is_none());
124124
}
125125

126-
// TODO: See https://github.com/SergiusIW/noisy_float-rs/pull/19
127-
// #[test]
128-
// fn test_quantile_axis_skipnan_mut_linear_f64() {
129-
// let mut a = arr2(&[[1., 2., ::std::f64::NAN, 3.], [::std::f64::NAN; 4]]);
130-
// let q = a.quantile_axis_skipnan_mut::<Linear>(Axis(1), 0.75);
131-
// assert_eq!(q.shape(), &[2]);
132-
// assert!((q[0] - 2.5).abs() < 1e-12);
133-
// assert!(q[1].is_nan());
134-
// }
126+
#[test]
127+
fn test_quantile_axis_skipnan_mut_linear_f64() {
128+
let mut a = arr2(&[[1., 2., ::std::f64::NAN, 3.], [::std::f64::NAN; 4]]);
129+
let q = a.quantile_axis_skipnan_mut::<Linear>(Axis(1), 0.75);
130+
assert_eq!(q.shape(), &[2]);
131+
assert!((q[0] - 2.5).abs() < 1e-12);
132+
assert!(q[1].is_nan());
133+
}
135134

136135
#[test]
137136
fn test_quantile_axis_skipnan_mut_linear_opt_i32() {

0 commit comments

Comments
 (0)