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:
# Before
ndarray = { version = "0.17", optional = true }
# After
ndarray = { 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 line
std = ["ndarray/std", ...] # let std feature re-enable it
Acceptance
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.
Part of #413 —
feat: no-std feature flag for embedded/edge targetsTask
The
ndarraydependency (0.17, optional,ndarray-bindingsfeature) currently inherits its default features, which includestd. ndarray 0.17 natively supportsno_std + alloc.Change Required
In
Cargo.toml, update thendarraydep entry:Then, in the
no_stdpath (i.e. whenstdfeature is disabled), thendarray-bindingsfeature should not pullndarray/std:Acceptance
cargo check --no-default-features --features ndarray-bindingscompiles without pullingstdfrom ndarraycargo build --features "default,ndarray-bindings"(withstd) compiles and all ndarray-backed tests passstd-only ndarray API (e.g.ndarray::Array::from_file) is used anywhere in smartcore'sndarray-bindingscode pathEstimated effort
~30 min. One
Cargo.tomlline change + verification that nostd-only ndarray surface is used.Dependencies
Independent — can be done in parallel with Steps 1, 3, 4, 7.