I cannot seem to figure out how to properly enable a feature flag in order to use methods / traits which are injected into ndarray
when that feature is enabled.
I keep getting this error:
assert!(expected.abs_diff_eq(&clip.slice(s![..;350, ..])));
| ^^^^^^^^^^^ method not found in `ndarray::ArrayBase<OwnedRepr<{float}>, Dim<[usize; 2]>>`
I tried to model my Cargo.toml after the ndarray
crate with respect to tests and approx.
[dependencies]
...
approx = { version = "0.4", optional = true , default-features = false }
[dev-dependencies]
approx="0.4"
[features]
test = ["approx"]
I've added a cfg
declaration above the test that uses this as well.
#[cfg(feature="approx")]
#[test]
I have tried passing --features approx
to cargo
but that doesn't help either.
The ndarray code that adds these approx based methods is in ndarray/lib.rs
and the snippet below:
#[cfg(feature = "approx")]
mod array_approx;