From bd4580ffe1f342eb3aaa1dad73ea61e9543c783c Mon Sep 17 00:00:00 2001 From: bluss Date: Tue, 20 Aug 2024 18:34:07 +0200 Subject: [PATCH 1/6] Upgrade ndarray to 0.16 (and approx 0.5, ndarray-rand 0.16) --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 892533e..6fb36e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ keywords = ["array", "multidimensional", "statistics", "matrix", "ndarray"] categories = ["data-structures", "science"] [dependencies] -ndarray = "0.15.0" +ndarray = "0.16.0" noisy_float = "0.2.0" num-integer = "0.1" num-traits = "0.2" @@ -25,11 +25,11 @@ itertools = { version = "0.10.0", default-features = false } indexmap = "1.6.2" [dev-dependencies] -ndarray = { version = "0.15.0", features = ["approx"] } +ndarray = { version = "0.16.1", features = ["approx"] } criterion = "0.3" quickcheck = { version = "0.9.2", default-features = false } -ndarray-rand = "0.14.0" -approx = "0.4" +ndarray-rand = "0.15.0" +approx = "0.5" quickcheck_macros = "1.0.0" num-bigint = "0.4.0" From 0aa10ecc3ef00fd6c454a28ff53bc833c3a4aa85 Mon Sep 17 00:00:00 2001 From: bluss Date: Tue, 20 Aug 2024 18:34:48 +0200 Subject: [PATCH 2/6] Update for deprecated into_shape --- tests/summary_statistics.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/summary_statistics.rs b/tests/summary_statistics.rs index 754d28e..5269e33 100644 --- a/tests/summary_statistics.rs +++ b/tests/summary_statistics.rs @@ -164,7 +164,7 @@ fn test_with_array_of_floats() { epsilon = 1e-12 ); - let data = a.into_shape((2, 5, 5)).unwrap(); + let data = a.into_shape_with_order((2, 5, 5)).unwrap(); let weights = array![0.1, 0.5, 0.25, 0.15, 0.2]; assert_abs_diff_eq!( data.weighted_mean_axis(Axis(1), &weights).unwrap(), @@ -254,7 +254,9 @@ fn mean_axis_eq_if_uniform_weights() { let depth = a.len() / 12; a.truncate(depth * 3 * 4); let weights = Array1::from_elem(depth, 1.0 / depth as f64); - let a = Array1::from(a).into_shape((depth, 3, 4)).unwrap(); + let a = Array1::from(a) + .into_shape_with_order((depth, 3, 4)) + .unwrap(); let ma = a.mean_axis(Axis(0)).unwrap(); let wm = a.weighted_mean_axis(Axis(0), &weights).unwrap(); let ws = a.weighted_sum_axis(Axis(0), &weights).unwrap(); @@ -288,7 +290,9 @@ fn weighted_var_algo_eq_simple_algo() { } let depth = a.len() / 12; a.truncate(depth * 3 * 4); - let a = Array1::from(a).into_shape((depth, 3, 4)).unwrap(); + let a = Array1::from(a) + .into_shape_with_order((depth, 3, 4)) + .unwrap(); let mut success = true; for axis in 0..3 { let axis = Axis(axis); From c6dcab09be83dfe3034b4c35a72c053f20f2a1b5 Mon Sep 17 00:00:00 2001 From: bluss Date: Tue, 20 Aug 2024 18:35:56 +0200 Subject: [PATCH 3/6] Update MSRV to Rust 1.64, matching ndarray 0.16 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c651a39..d2ab494 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - stable - beta - nightly - - 1.49.0 # MSRV + - 1.64.0 # MSRV steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 From 29c0e870989ed61b3f3ec12fd3d3359e6f4bc9d6 Mon Sep 17 00:00:00 2001 From: bluss Date: Tue, 20 Aug 2024 18:44:28 +0200 Subject: [PATCH 4/6] ci: Update checkout and rust toolchain action --- .github/workflows/ci.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2ab494..eddb794 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,10 @@ jobs: - nightly - 1.64.0 # MSRV steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - name: Build run: cargo build --verbose - name: Run tests @@ -48,13 +46,11 @@ jobs: - rust: stable target: i686-unknown-linux-gnu steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} - override: true - name: Install cross run: cargo install cross -f - name: Build @@ -86,12 +82,10 @@ jobs: rust: - nightly steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} - override: true - name: Install tarpaulin run: cargo install cargo-tarpaulin -f - name: Generate code coverage From 2ba11a3c9db62516d1e600c14e452d475a159a5d Mon Sep 17 00:00:00 2001 From: bluss Date: Tue, 20 Aug 2024 18:44:36 +0200 Subject: [PATCH 5/6] ci: Change cross builders The mips platforms appears to have disappeared. --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eddb794..2b79105 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,10 +38,7 @@ jobs: include: # 64-bit, big-endian - rust: stable - target: mips64-unknown-linux-gnuabi64 - # 32-bit, big-endian - - rust: stable - target: mips-unknown-linux-gnu + target: s390x-unknown-linux-gnu # 32-bit, little-endian - rust: stable target: i686-unknown-linux-gnu From 9919c615c646138ad0d80f517a7ca57e9a35d094 Mon Sep 17 00:00:00 2001 From: bluss Date: Tue, 20 Aug 2024 18:51:22 +0200 Subject: [PATCH 6/6] ci: Pin dependency versions for MSRV --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b79105..5200dcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,10 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} + - name: Pin versions for MSRV + if: "${{ matrix.rust == '1.64.0' }}" + run: | + cargo update -p regex --precise 1.8.4 - name: Build run: cargo build --verbose - name: Run tests