From b21a33bb3944b528d6b9580ad30a76036bf9ccce Mon Sep 17 00:00:00 2001 From: Min Kim Date: Mon, 20 May 2024 11:09:32 -0700 Subject: [PATCH] Switch to Rust 2021 Edition --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 48 ++++++++++++++++++++-------------------- Cargo.toml | 19 +++++++++------- README.md | 2 +- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2fc876..9a4ba07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - rust: [stable, 1.54] + rust: [stable, 1.56] steps: - name: Install Rust diff --git a/CHANGELOG.md b/CHANGELOG.md index e16be70..16a33a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Changed * Updated intel-mkl-src to 0.7. -* Requires Rust 1.54 or later. +* Requires Rust 1.56 or later. ## [0.6.2] - 2022-05-04 @@ -22,26 +22,26 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Changed -- Requires ndarray 0.15.2 or later. +* Requires ndarray 0.15.2 or later. ## [0.6.0] - 2021-05-10 ### Changed -- Requires ndarray 0.15. -- `DecompisionError::InvalidInput` provides the underlying reason. -- `DecomposionError::LinalgError` no longer exposes the `ndarray_linalg` error +* Requires ndarray 0.15. +* `DecompisionError::InvalidInput` provides the underlying reason. +* `DecomposionError::LinalgError` no longer exposes the `ndarray_linalg` error type; instead, it provides the underlying reason as `String`. -- Requires Rust 1.51 or later. +* Requires Rust 1.51 or later. ## [0.5.1] - 2021-05-06 ### Added -- `PcaBuilder` and `RandomizedPcaBuilder` to create instances of `Pca` and +* `PcaBuilder` and `RandomizedPcaBuilder` to create instances of `Pca` and `RandomizedPca`, respectively. -- `FastIcaBuilder` to create instances of `FastIca`. -- `Pca` and `RandomizedPca` are optionally set to skip mean-centering input, +* `FastIcaBuilder` to create instances of `FastIca`. +* `Pca` and `RandomizedPca` are optionally set to skip mean-centering input, using `PcaBuilder::centering` and `RandomizedPcaBuilder::centering`. By default they always mean-center input. (by @sstadick) @@ -49,31 +49,31 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Changed -- Updated ndarray to 0.14. (by @sstadick) -- The backend features are compatible with those of ndarray-linalg-0.13. -- Requires Rust 1.46 or later. +* Updated ndarray to 0.14. (by @sstadick) +* The backend features are compatible with those of ndarray-linalg-0.13. +* Requires Rust 1.46 or later. ## [0.4.1] - 2020-07-17 ### Added -- `Pca::components()` and `RandomizedPca::components()`. -- `Pca::mean()` and `RandomizedPca::mean()`. -- `Pca::inverse_transform()` and `RandomizedPca::inverse_transform()`. +* `Pca::components()` and `RandomizedPca::components()`. +* `Pca::mean()` and `RandomizedPca::mean()`. +* `Pca::inverse_transform()` and `RandomizedPca::inverse_transform()`. ## [0.4.0] - 2020-06-18 ### Added -- Serialization/deserialization using serde. -- `FastIca::with_seed` and `RandomizedPca::with_seed` to easily create a model +* Serialization/deserialization using serde. +* `FastIca::with_seed` and `RandomizedPca::with_seed` to easily create a model with a reproducible behavior. -- `FastIca::with_rng` and `RandomizedPca::with_rng` to replace `new` in earlier +* `FastIca::with_rng` and `RandomizedPca::with_rng` to replace `new` in earlier versions. ### Changed -- `FastIca::new` and `RandomizedPca::new` no longer requires a random number +* `FastIca::new` and `RandomizedPca::new` no longer requires a random number generator; they uses a PCG random number genrator by default. Use `with_rng` instead for a different random number generator. @@ -81,30 +81,30 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Added -- `FastIca`, an independent component analysis (ICA) algorithm. +* `FastIca`, an independent component analysis (ICA) algorithm. ## [0.2.0] - 2020-05-24 ### Added -- `RandomizedPca`, a randomized, truncated PCA. +* `RandomizedPca`, a randomized, truncated PCA. ### Fixed -- `Pca::explained_variance_ratio` returns the ratios for the principal +* `Pca::explained_variance_ratio` returns the ratios for the principal components only. ## [0.1.1] - 2020-05-21 ### Added -- cargo features to select the LAPACK backend: intel-mkl, netlib, or openblas. +* cargo features to select the LAPACK backend: intel-mkl, netlib, or openblas. ## [0.1.0] - 2020-05-20 ### Added -- Principal component analysis (PCA). +* Principal component analysis (PCA). [Unreleased]: https://github.com/petabi/petal-decomposition/compare/0.6.2...main [0.6.2]: https://github.com/petabi/petal-decomposition/compare/0.6.1...0.6.2 diff --git a/Cargo.toml b/Cargo.toml index 8d7eba2..cc00ae0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0" keywords = ["matrix", "decomposition", "pca", "ica", "dimensionality"] categories = ["mathematics", "science", "algorithms"] authors = ["Min Kim "] -edition = "2018" +edition = "2021" exclude = ["./github"] [badges] @@ -25,14 +25,17 @@ no-default-features = true default = [] intel-mkl = ["intel-mkl-static"] -netlib = ["netlib-static"] -openblas = ["openblas-static"] +netlib = ["netlib-static"] +openblas = ["openblas-static"] -intel-mkl-static = ["intel-mkl-src/mkl-static-lp64-seq", "intel-mkl-src/download"] +intel-mkl-static = [ + "intel-mkl-src/mkl-static-lp64-seq", + "intel-mkl-src/download", +] intel-mkl-system = ["intel-mkl-src/mkl-dynamic-lp64-seq"] -netlib-static = ["netlib-src/static"] -netlib-system = ["netlib-src/system"] +netlib-static = ["netlib-src/static"] +netlib-system = ["netlib-src/system"] openblas-static = ["openblas-src/static"] openblas-system = ["openblas-src/system"] @@ -42,7 +45,7 @@ serialization = [ "lair/serialization", "ndarray/serde", "rand/serde1", - "rand_pcg/serde1" + "rand_pcg/serde1", ] [dependencies] @@ -53,7 +56,7 @@ lair = "0.6" lapack = "0.19" ndarray = "0.15.2" num-complex = "0.4" -num-traits = "0.2.15" # 0.2.15 conflicts with lair-0.5 +num-traits = "0.2.15" # 0.2.15 conflicts with lair-0.5 rand = "0.8" rand_distr = "0.4" rand_pcg = "0.3" diff --git a/README.md b/README.md index 6811837..8cd9131 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ petal-decomposition provides matrix decomposition algorithms including PCA ## Requirements -* Rust ≥ 1.54 +* Rust ≥ 1.56 * BLAS/LAPACK backend (OpenBLAS, Netlib, or Intel MKL) ## Features