Skip to content

Commit e3f082b

Browse files
authored
Upgrade to ndarray 0.16 (#371)
* Bump ndarray version to 0.16 * Bump ndarray-linalg version to 0.17 * Bump ndarray-stats version to 0.6 * Bump ndarray-rand version to 0.15 * Unpin ndarray-csv * Bump approx version to 0.5 * Bump linfa-linalg version to 0.2 * Unpin sprs * Fix forgotten bumps * Fix deprecated into_shape() * Fix deprecated into_raw_vec() * Fix deprecated into_shape() * Test argmin from repo * Bump criterion version to "0.5.1" * Bump statrs version to "0.18" * Bump thiserror version to "2.0" * Use criterion version "0.5" instead of "0.5.1" * Bump pprof version to 0.14 * Remove manual serde bound * Bump ndarray in linfa-ensemble * Linting * Linting * Format * Bump MSRV to 1.87.0 (due to is_multiple_of lint) * Bump argmin version to 0.11 (argmin-math 0.5) * Bump criterion to version 0.7 * Format * Revert "Bump criterion to version 0.7"
1 parent 77457b2 commit e3f082b

File tree

40 files changed

+224
-182
lines changed

40 files changed

+224
-182
lines changed

.github/workflows/checking.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
toolchain:
13-
- 1.82.0
13+
- 1.87.0
1414
- stable
1515
- nightly
1616
os:

.github/workflows/testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
toolchain:
13-
- 1.82.0
13+
- 1.87.0
1414
- stable
1515
os:
1616
- ubuntu-latest
@@ -35,7 +35,7 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
toolchain:
38-
- 1.82.0
38+
- 1.87.0
3939
- stable
4040
os:
4141
- ubuntu-latest

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ serde = ["serde_crate", "ndarray/serde"]
3838
[dependencies]
3939
num-traits = "0.2"
4040
rand = { version = "0.8", features = ["small_rng"] }
41-
approx = "0.4"
41+
approx = "0.5"
4242

43-
ndarray = { version = "0.15", features = ["approx"] }
44-
ndarray-linalg = { version = "0.16", optional = true }
45-
sprs = { version = "=0.11.1", default-features = false }
43+
ndarray = { version = "0.16", features = ["approx"] }
44+
ndarray-linalg = { version = "0.17", optional = true }
45+
sprs = { version = "0.11", default-features = false }
4646

47-
thiserror = "1.0"
47+
thiserror = "2.0"
4848

49-
criterion = { version = "0.4.0", optional = true }
49+
criterion = { version = "0.5", optional = true }
5050

5151
[dependencies.serde_crate]
5252
package = "serde"
@@ -56,17 +56,17 @@ default-features = false
5656
features = ["std", "derive"]
5757

5858
[dev-dependencies]
59-
ndarray-rand = "0.14"
59+
ndarray-rand = "0.15"
6060
linfa-datasets = { path = "datasets", features = [
6161
"winequality",
6262
"iris",
6363
"diabetes",
6464
"generate",
6565
] }
66-
statrs = "0.16.0"
66+
statrs = "0.18"
6767

6868
[target.'cfg(not(windows))'.dependencies]
69-
pprof = { version = "0.11.0", features = [
69+
pprof = { version = "0.14", features = [
7070
"flamegraph",
7171
"criterion",
7272
], optional = true }

algorithms/linfa-bayes/Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ default-features = false
2121
features = ["std", "derive"]
2222

2323
[dependencies]
24-
ndarray = { version = "0.15" , features = ["approx"]}
25-
ndarray-stats = "0.5"
26-
thiserror = "1.0"
24+
ndarray = { version = "0.16", features = ["approx"] }
25+
ndarray-stats = "0.6"
26+
thiserror = "2.0"
2727

2828
linfa = { version = "0.7.1", path = "../.." }
2929

3030
[dev-dependencies]
31-
approx = "0.4"
32-
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = ["winequality"] }
31+
approx = "0.5"
32+
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [
33+
"winequality",
34+
] }

algorithms/linfa-bayes/src/base_nb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ where
7070
.mapv(|x| x.exp())
7171
.sum_axis(Axis(1))
7272
.mapv(|x| x.ln())
73-
.into_shape((n_samples, 1))
73+
.into_shape_with_order((n_samples, 1))
7474
.unwrap();
7575

7676
(log_prob_mat - log_prob_x, classes)

algorithms/linfa-bayes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub(crate) fn filter<F: Float, L: Label + Ord>(
8989
let index = y
9090
.into_iter()
9191
.enumerate()
92-
.filter(|&(_, y)| (*ycondition == *y))
92+
.filter(|&(_, y)| *ycondition == *y)
9393
.map(|(i, _)| i)
9494
.collect::<Vec<_>>();
9595

algorithms/linfa-clustering/Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,29 @@ default-features = false
3535
features = ["std", "derive"]
3636

3737
[dependencies]
38-
ndarray = { version = "0.15", features = ["rayon", "approx"] }
39-
linfa-linalg = { version = "0.1", default-features = false }
40-
ndarray-linalg = { version = "0.16", optional = true }
41-
ndarray-rand = "0.14"
42-
ndarray-stats = "0.5"
38+
ndarray = { version = "0.16", features = ["rayon", "approx"] }
39+
linfa-linalg = { version = "0.2", default-features = false }
40+
ndarray-linalg = { version = "0.17", optional = true }
41+
ndarray-rand = "0.15"
42+
ndarray-stats = "0.6"
4343
num-traits = "0.2"
4444
rand_xoshiro = "0.6"
4545
space = "0.12"
46-
thiserror = "1.0"
46+
thiserror = "2.0"
4747
#partitions = "0.2.4" This one will break in a future version of Rust and has no replacement
4848
linfa = { version = "0.7.1", path = "../.." }
4949
linfa-nn = { version = "0.7.2", path = "../linfa-nn" }
5050
noisy_float = "0.2.0"
5151

5252
[dev-dependencies]
53-
ndarray-npy = { version = "0.8", default-features = false }
53+
ndarray-npy = { version = "0.9", default-features = false }
5454
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [
5555
"generate",
5656
] }
57-
criterion = "0.4.0"
57+
criterion = "0.5"
5858
serde_json = "1"
59-
approx = "0.4"
60-
lax = "0.15.0"
59+
approx = "0.5"
60+
lax = "0.17.0"
6161
linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] }
6262

6363
[[bench]]

algorithms/linfa-clustering/src/gaussian_mixture/algorithm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ impl<F: Float> GaussianMixtureModel<F> {
396396
let n_clusters = matrix_chol.shape()[0];
397397
let log_diags = &matrix_chol
398398
.to_owned()
399-
.into_shape((n_clusters, n_features * n_features))
399+
.into_shape_with_order((n_clusters, n_features * n_features))
400400
.unwrap()
401401
.slice(s![.., ..; n_features+1])
402402
.to_owned()

algorithms/linfa-elasticnet/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ default-features = false
2929
features = ["std", "derive"]
3030

3131
[dependencies]
32-
ndarray = { version = "0.15", features = ["approx"] }
33-
linfa-linalg = { version = "0.1", default-features = false }
34-
ndarray-linalg = { version = "0.16", optional = true }
32+
ndarray = { version = "0.16", features = ["approx"] }
33+
linfa-linalg = { version = "0.2", default-features = false }
34+
ndarray-linalg = { version = "0.17", optional = true }
3535

3636
num-traits = "0.2"
37-
approx = "0.4"
38-
thiserror = "1.0"
37+
approx = "0.5"
38+
thiserror = "2.0"
3939

4040
linfa = { version = "0.7.1", path = "../.." }
4141

@@ -44,5 +44,5 @@ linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [
4444
"diabetes",
4545
"linnerud",
4646
] }
47-
ndarray-rand = "0.14"
47+
ndarray-rand = "0.15"
4848
rand_xoshiro = "0.6"

algorithms/linfa-ensemble/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ default-features = false
2727
features = ["std", "derive"]
2828

2929
[dependencies]
30-
ndarray = { version = "0.15", features = ["rayon", "approx"] }
31-
ndarray-rand = "0.14"
30+
ndarray = { version = "0.16", features = ["rayon", "approx"] }
31+
ndarray-rand = "0.15"
3232
rand = "0.8.5"
3333

3434
linfa = { version = "0.7.1", path = "../.." }

0 commit comments

Comments
 (0)