From 9961b7be53a3cbf741dd6ffa4e0276bfb59ae686 Mon Sep 17 00:00:00 2001 From: "Lorenzo (Mec-iS)" Date: Sat, 24 Oct 2026 05:33:50 +0100 Subject: [PATCH] docs: surface the 0.7.0 datasets/std_rand breaking change in README, crate docs and AGENTS --- AGENTS.md | 2 +- README.md | 20 ++++++++++++++++++-- src/lib.rs | 5 +++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d8e4a4d5..59dca180 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -47,7 +47,7 @@ Key features defined in `Cargo.toml`: - `ndarray-bindings` — optional `ndarray` integration. - `serde` — serialization support (also pulls in `typetag`). -- `datasets` — built-in sample datasets; implies `std_rand` and `serde`. +- `datasets` — built-in sample datasets; implies `serde` only. Since 0.7.0 it does not imply `std_rand` (breaking change, #416). Enable `std_rand` together with `datasets` to seed the generators from OS entropy. - `std_rand` — enables standard RNG facilities in `rand`. - `js` — for `wasm32-unknown-unknown` in-browser usage. diff --git a/README.md b/README.md index b219b2f9..4baad5d1 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Add to Cargo.toml: ```toml [dependencies] -smartcore = "^0.6" +smartcore = "^0.7" ``` For the latest changes from the `main` branch: @@ -55,6 +55,22 @@ Optional features (examples): Check Cargo.toml for available features and compatibility notes. +## Breaking changes in 0.7.0 + +> [!WARNING] +> The `datasets` feature no longer enables `std_rand` (#416). +> +> - The generators `make_blobs`, `make_circles` and `make_moons` no longer take their seed from the OS RNG. +> - Without `std_rand` they use a fixed seed and return the same output on every call. +> - With `std_rand` they take their seed from OS entropy, as before. +> +> To keep the 0.6 behaviour, enable both features: +> +> ```toml +> [dependencies] +> smartcore = { version = "^0.7", features = ["datasets", "std_rand"] } +> ``` + ## Quick start Here is a minimal example fitting a KNN classifier from native Rust vectors using DenseMatrix: @@ -103,7 +119,7 @@ Recent refactors emphasize reusable components in trees/forests and expanded mul ## Data access and readers - CSV readers: Read matrices from CSV with configurable delimiter and header rows, with helpful error messages and testing utilities (including non-IO reader abstractions). -- Dataset generators: make_blobs, make_circles, make_moons for quick experiments. +- Dataset generators: make_blobs, make_circles, make_moons for quick experiments. Since 0.7.0 they use a fixed seed unless you also enable `std_rand` (see the breaking changes note above). - Built-in datasets (feature-gated): digits, diabetes, breast cancer, boston, with serialization utilities to persist or refresh .xy bundles. diff --git a/src/lib.rs b/src/lib.rs index 99af7502..b1608bdd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,6 +39,11 @@ //! ``` //! Check `smartcore`'s `Cargo.toml` for available features. //! +//! **Breaking change in 0.7**: the `datasets` feature no longer enables `std_rand`. The +//! generators `make_blobs`, `make_circles` and `make_moons` then use a fixed seed and +//! return the same output on each call. Enable `std_rand` together with `datasets` to +//! seed the generators from OS entropy, as in 0.6. +//! //! ## Using Jupyter //! For quick introduction, Jupyter Notebooks are available [here](https://github.com/smartcorelib/smartcore-jupyter/tree/main/notebooks). //! You can set up a local environment to run Rust notebooks using [EVCXR](https://github.com/google/evcxr)