From a828db6e08cec61f75615f1377eb4a933d7c24d7 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Fri, 2 Aug 2024 13:56:18 +0200 Subject: [PATCH 1/3] Update readme for 0.16 --- README.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 3fb692b68..a95ca3205 100644 --- a/README.rst +++ b/README.rst @@ -107,7 +107,7 @@ How to use with cargo :: [dependencies] - ndarray = "0.15.0" + ndarray = "0.16.0" How to enable BLAS integration ------------------------------ @@ -127,8 +127,8 @@ An example configuration using system openblas is shown below. Note that only end-user projects (not libraries) should select provider:: [dependencies] - ndarray = { version = "0.15.0", features = ["blas"] } - blas-src = { version = "0.8", features = ["openblas"] } + ndarray = { version = "0.16.0", features = ["blas"] } + blas-src = { version = "0.10", features = ["openblas"] } openblas-src = { version = "0.10", features = ["cblas", "system"] } Using system-installed dependencies can save a long time building dependencies. @@ -149,6 +149,7 @@ there is no tight coupling to the ``blas-src`` version, so version selection is =========== ============ ================ ============== ``ndarray`` ``blas-src`` ``openblas-src`` ``netlib-src`` =========== ============ ================ ============== +0.16 0.10 0.10 0.8 0.15 0.8 0.10 0.8 0.15 0.7 0.9 0.8 0.14 0.6.1 0.9.0 From 874f6b40b25bac9d2867a6b7fc093770b38fcf98 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Fri, 2 Aug 2024 14:17:29 +0200 Subject: [PATCH 2/3] Organize tests in workspace (cont.) Further normalization, using crates/ and naming directories exactly as their respective crates. Also exclude blas-tests from default members, because it depends on selecting a blas backend. --- Cargo.toml | 11 ++++++++--- {extra-tests/blas => crates/blas-tests}/Cargo.toml | 0 {extra-tests/blas => crates/blas-tests}/src/lib.rs | 0 {extra-tests/blas => crates/blas-tests}/tests/oper.rs | 0 .../numeric => crates/numeric-tests}/Cargo.toml | 0 .../numeric => crates/numeric-tests}/src/lib.rs | 0 .../numeric-tests}/tests/accuracy.rs | 0 .../serialization-tests}/Cargo.toml | 0 .../serialization-tests}/src/lib.rs | 0 .../serialization-tests}/tests/serialize.rs | 0 extra-tests/README.md | 5 ----- 11 files changed, 8 insertions(+), 8 deletions(-) rename {extra-tests/blas => crates/blas-tests}/Cargo.toml (100%) rename {extra-tests/blas => crates/blas-tests}/src/lib.rs (100%) rename {extra-tests/blas => crates/blas-tests}/tests/oper.rs (100%) rename {extra-tests/numeric => crates/numeric-tests}/Cargo.toml (100%) rename {extra-tests/numeric => crates/numeric-tests}/src/lib.rs (100%) rename {extra-tests/numeric => crates/numeric-tests}/tests/accuracy.rs (100%) rename {extra-tests/serialization => crates/serialization-tests}/Cargo.toml (100%) rename {extra-tests/serialization => crates/serialization-tests}/src/lib.rs (100%) rename {extra-tests/serialization => crates/serialization-tests}/tests/serialize.rs (100%) delete mode 100644 extra-tests/README.md diff --git a/Cargo.toml b/Cargo.toml index c0c8f8772..f1a7d4287 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,9 +80,14 @@ portable-atomic-util = { version = "0.2.0", features = [ "alloc" ] } [workspace] members = [ "ndarray-rand", - "extra-tests/serialization", - "extra-tests/blas", - "extra-tests/numeric", + "crates/*", +] +default-members = [ + ".", + "ndarray-rand", + "crates/numeric-tests", + "crates/serialization-tests", + # exclude blas-tests that depends on BLAS install ] [workspace.dependencies] diff --git a/extra-tests/blas/Cargo.toml b/crates/blas-tests/Cargo.toml similarity index 100% rename from extra-tests/blas/Cargo.toml rename to crates/blas-tests/Cargo.toml diff --git a/extra-tests/blas/src/lib.rs b/crates/blas-tests/src/lib.rs similarity index 100% rename from extra-tests/blas/src/lib.rs rename to crates/blas-tests/src/lib.rs diff --git a/extra-tests/blas/tests/oper.rs b/crates/blas-tests/tests/oper.rs similarity index 100% rename from extra-tests/blas/tests/oper.rs rename to crates/blas-tests/tests/oper.rs diff --git a/extra-tests/numeric/Cargo.toml b/crates/numeric-tests/Cargo.toml similarity index 100% rename from extra-tests/numeric/Cargo.toml rename to crates/numeric-tests/Cargo.toml diff --git a/extra-tests/numeric/src/lib.rs b/crates/numeric-tests/src/lib.rs similarity index 100% rename from extra-tests/numeric/src/lib.rs rename to crates/numeric-tests/src/lib.rs diff --git a/extra-tests/numeric/tests/accuracy.rs b/crates/numeric-tests/tests/accuracy.rs similarity index 100% rename from extra-tests/numeric/tests/accuracy.rs rename to crates/numeric-tests/tests/accuracy.rs diff --git a/extra-tests/serialization/Cargo.toml b/crates/serialization-tests/Cargo.toml similarity index 100% rename from extra-tests/serialization/Cargo.toml rename to crates/serialization-tests/Cargo.toml diff --git a/extra-tests/serialization/src/lib.rs b/crates/serialization-tests/src/lib.rs similarity index 100% rename from extra-tests/serialization/src/lib.rs rename to crates/serialization-tests/src/lib.rs diff --git a/extra-tests/serialization/tests/serialize.rs b/crates/serialization-tests/tests/serialize.rs similarity index 100% rename from extra-tests/serialization/tests/serialize.rs rename to crates/serialization-tests/tests/serialize.rs diff --git a/extra-tests/README.md b/extra-tests/README.md deleted file mode 100644 index 5b5b78b58..000000000 --- a/extra-tests/README.md +++ /dev/null @@ -1,5 +0,0 @@ - -# Extra Tests - -These are test crates whose settings, features and dependencies should be -separate from the main crate. From 7f93048448d94e4996171d717896cf71c7b94870 Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Fri, 2 Aug 2024 14:29:44 +0200 Subject: [PATCH 3/3] Simplify all-tests.sh Use workspace features better in all-tests.sh --- crates/serialization-tests/Cargo.toml | 6 +---- crates/serialization-tests/tests/serialize.rs | 2 -- scripts/all-tests.sh | 27 +++++++++++-------- scripts/cross-tests.sh | 9 +++---- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/crates/serialization-tests/Cargo.toml b/crates/serialization-tests/Cargo.toml index 76bf66bf0..8e7056b88 100644 --- a/crates/serialization-tests/Cargo.toml +++ b/crates/serialization-tests/Cargo.toml @@ -12,7 +12,7 @@ test = false ndarray = { workspace = true, features = ["serde"] } serde = { version = "1.0.100", default-features = false } -ron = { version = "0.8.1", optional = true } +ron = { version = "0.8.1" } [dev-dependencies] serde_json = { version = "1.0.40" } @@ -20,7 +20,3 @@ serde_json = { version = "1.0.40" } rmp = { version = "=0.8.10" } # Old version to work with Rust 1.64+ rmp-serde = { version = "0.14" } - -[features] -default = ["ron"] - diff --git a/crates/serialization-tests/tests/serialize.rs b/crates/serialization-tests/tests/serialize.rs index 95e93e4fb..6e6fb4d64 100644 --- a/crates/serialization-tests/tests/serialize.rs +++ b/crates/serialization-tests/tests/serialize.rs @@ -6,7 +6,6 @@ extern crate serde_json; extern crate rmp_serde; -#[cfg(feature = "ron")] extern crate ron; use ndarray::{arr0, arr1, arr2, s, ArcArray, ArcArray2, ArrayD, IxDyn}; @@ -179,7 +178,6 @@ fn serial_many_dim_serde_msgpack() } #[test] -#[cfg(feature = "ron")] fn serial_many_dim_ron() { use ron::de::from_str as ron_deserialize; diff --git a/scripts/all-tests.sh b/scripts/all-tests.sh index ca40c2103..6f1fdf73a 100755 --- a/scripts/all-tests.sh +++ b/scripts/all-tests.sh @@ -6,19 +6,24 @@ set -e FEATURES=$1 CHANNEL=$2 -cargo build --verbose --no-default-features -# Testing both dev and release profiles helps find bugs, especially in low level code -cargo test --verbose --no-default-features -cargo test --release --verbose --no-default-features -cargo build --verbose --features "$FEATURES" -cargo test --verbose --features "$FEATURES" -cargo test -p ndarray-rand --no-default-features --verbose -cargo test -p ndarray-rand --features ndarray-rand/quickcheck --verbose - -cargo test -p serialization-tests -v +QC_FEAT=--features=ndarray-rand/quickcheck + +# build check with no features +cargo build -v --no-default-features + +# ndarray with no features +cargo test -p ndarray -v --no-default-features +# all with features +cargo test -v --features "$FEATURES" $QC_FEAT +# all with features and release (ignore test crates which is already optimized) +cargo test -v -p ndarray -p ndarray-rand --release --features "$FEATURES" $QC_FEAT --lib --tests + +# BLAS tests cargo test -p blas-tests -v --features blas-tests/openblas-system -cargo test -p numeric-tests -v cargo test -p numeric-tests -v --features numeric-tests/test_blas +# Examples cargo test --examples + +# Benchmarks ([ "$CHANNEL" != "nightly" ] || cargo bench --no-run --verbose --features "$FEATURES") diff --git a/scripts/cross-tests.sh b/scripts/cross-tests.sh index f28623b46..683a901d8 100755 --- a/scripts/cross-tests.sh +++ b/scripts/cross-tests.sh @@ -7,8 +7,7 @@ FEATURES=$1 CHANNEL=$2 TARGET=$3 -cross build -v --features="$FEATURES" --target=$TARGET -cross test -v --no-fail-fast --features="$FEATURES" --target=$TARGET -cross test -v --no-fail-fast --target=$TARGET -p ndarray-rand --features ndarray-rand/quickcheck -cross test -v --no-fail-fast --target=$TARGET -p serialization-tests --verbose -cross test -v --no-fail-fast --target=$TARGET -p numeric-tests --release +QC_FEAT=--features=ndarray-rand/quickcheck + +cross build -v --features="$FEATURES" $QC_FEAT --target=$TARGET +cross test -v --no-fail-fast --features="$FEATURES" $QC_FEAT --target=$TARGET