statrs-dev / statrs

Statistical computation library for Rust
https://docs.rs/statrs/latest/statrs/
MIT License
599 stars 84 forks source link

Make nalgebra optional #270

Closed FreezyLemon closed 2 months ago

FreezyLemon commented 2 months ago

Closes #196.

With this, users can remove the nalgebra dependency by changing:

[dependencies]
statrs = "0.17"

to

[dependencies]
statrs = { version = "0.17", default-features = false }

This will exclude all distributions depending on nalgebra from compilation (and the public API):

$ cargo public-api --no-default-features | grep -c nalgebra
0

There has been some talk in the linked issue about adding a feature for multivariate distributions, but I think for now it's simple enough to hide all nalgebra-dependent types behind this flag. If it becomes necessary, this can still be changed.

The new feature is enabled by default to avoid breakage when upgrading the package, but it probably wouldn't be a big deal to disable it by default either.

MSRV-related note: The dep: prefix requires 1.60.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.62%. Comparing base (aa276c8) to head (bc7d2b6). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #270 +/- ## ======================================= Coverage 90.62% 90.62% ======================================= Files 50 50 Lines 11583 11585 +2 ======================================= + Hits 10497 10499 +2 Misses 1086 1086 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

YeungOnion commented 2 months ago

Thanks for this, looks good!