From 71226e599f282f608127b72c146a9ecfa4355aa4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 11:22:12 +0000 Subject: [PATCH 1/2] Update ndarray requirement from ^0.15 to ^0.16 Updates the requirements on [ndarray](https://github.com/rust-ndarray/ndarray) to permit the latest version. - [Release notes](https://github.com/rust-ndarray/ndarray/releases) - [Changelog](https://github.com/rust-ndarray/ndarray/blob/master/RELEASES.md) - [Commits](https://github.com/rust-ndarray/ndarray/compare/ndarray-rand-0.15.0...0.16.1) --- updated-dependencies: - dependency-name: ndarray dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9330045..c3e4fd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ itertools = "^0.13" lazy_static = "^1.4" libm = "^0.2" macro_const = "^0.1" -ndarray = "^0.15" +ndarray = "^0.16" ndarray-stats = "^0.5" num-complex = "^0.4" # the same version as used by fftw num-traits = "^0.2" From b1fb4df0138a1510f29d0d062152bf1de019a1f2 Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Tue, 3 Sep 2024 11:18:44 -0400 Subject: [PATCH 2/2] Port code to ndarray 0.16 --- Cargo.toml | 4 ++-- src/features/median_absolute_deviation.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c3e4fd2..d9f462d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ lazy_static = "^1.4" libm = "^0.2" macro_const = "^0.1" ndarray = "^0.16" -ndarray-stats = "^0.5" +ndarray-stats = "^0.6" num-complex = "^0.4" # the same version as used by fftw num-traits = "^0.2" paste = "1" @@ -68,7 +68,7 @@ plotters-bitmap = "0.3.3" rand = "0.8" rand_distr = "0.4" rayon = "1.5" -realfft= "3.1" +realfft = "3.1" rustfft = "6.1" serde_json = "1.0" serde_test = "1.0" diff --git a/src/features/median_absolute_deviation.rs b/src/features/median_absolute_deviation.rs index d4b6e44..bc17000 100644 --- a/src/features/median_absolute_deviation.rs +++ b/src/features/median_absolute_deviation.rs @@ -62,7 +62,8 @@ where let sorted_deviation: SortedArray<_> = ts.m.sample .mapv(|m| T::abs(m - m_median)) - .into_raw_vec() + .as_slice_memory_order() + .expect("TimeSeries::m::sample::mapv(...) is supposed to be contiguous") .into(); Ok(vec![sorted_deviation.median()]) }