You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
no-std Step 8 — Set ndarray dependency to default-features = false #421
Part of #413 — feat: no-std feature flag for embedded/edge targets
Task
The ndarray dependency (0.17, optional, ndarray-bindings feature) currently inherits its default features, which include std. ndarray 0.17 natively supports no_std + alloc.
Change Required
In Cargo.toml, update the ndarray dep entry:
# Beforendarray = { version = "0.17", optional = true }
# Afterndarray = { version = "0.17", optional = true, default-features = false, features = ["std"] }
Then, in the no_std path (i.e. when std feature is disabled), the ndarray-bindings feature should not pull ndarray/std:
[features]
ndarray-bindings = ["dep:ndarray"] # drop ndarray/std from this linestd = ["ndarray/std", ...] # let std feature re-enable it
Acceptance
cargo check --no-default-features --features ndarray-bindings compiles without pulling std from ndarray
cargo build --features "default,ndarray-bindings" (with std) compiles and all ndarray-backed tests pass
No std-only ndarray API (e.g. ndarray::Array::from_file) is used anywhere in smartcore's ndarray-bindings code path
Estimated effort
~30 min. One Cargo.toml line change + verification that no std-only ndarray surface is used.
Dependencies
Independent — can be done in parallel with Steps 1, 3, 4, 7.
Activity