Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to ndarray 0.16 #98

Merged
merged 6 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ jobs:
- stable
- beta
- nightly
- 1.49.0 # MSRV
- 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: 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
Expand All @@ -40,21 +42,16 @@ 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
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
Expand Down Expand Up @@ -86,12 +83,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
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand Down
10 changes: 7 additions & 3 deletions tests/summary_statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
Loading