From 583721b40bc0ab06978c45d41569d71bef3681f4 Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Sun, 18 Nov 2018 17:20:22 +0000 Subject: [PATCH 1/8] Introduction docs --- src/lib.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index b2543b71..eb6bed82 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,29 @@ +//! The [`ndarray-stats`] crate exposes statistical routines for `ArrayBase`, +//! the *n*-dimensional array data structure provided by [`ndarray`]. +//! +//! Currently available routines include: +//! - [`order statistics`] (minimum, maximum, quantiles, etc.); +//! - [`partitioning`]; +//! - [`correlation analysis`] (covariance, pearson correlation); +//! - [`histogram computation`]. +//! +//! Please feel free to contribute new functionality! A roadmap can be found [`here`]. +//! +//! Our work is inspired by other existing statistical packages such as +//! [`NumPy`] (Python) and [`StatsBase.jl`] (Julia) - any contribution bringing us closer to +//! feature parity is more than welcome! +//! +//! [`ndarray-stats`]: https://github.com/jturner314/ndarray-stats/ +//! [`ndarray`]: https://github.com/rust-ndarray/ndarray +//! [`order statistics`]: trait.QuantileExt.html +//! [`partitioning`]: trait.Sort1dExt.html +//! [`correlation analysis`]: trait.CorrelationExt.html +//! [`histogram computation`]: histogram/index.html +//! [`here`]: https://github.com/jturner314/ndarray-stats/issues/1 +//! [`NumPy`]: https://docs.scipy.org/doc/numpy-1.14.1/reference/routines.statistics.html +//! [`StatsBase.jl`]: https://juliastats.github.io/StatsBase.jl/latest/ + + #[macro_use(azip, s)] #[cfg_attr(test, macro_use(array))] extern crate ndarray; From 20d8eed59393724937e056ce2b729c747cd5f9bd Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Sun, 18 Nov 2018 17:20:31 +0000 Subject: [PATCH 2/8] Uniform formatting --- src/correlation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/correlation.rs b/src/correlation.rs index 2b8ebd74..9a8fc119 100644 --- a/src/correlation.rs +++ b/src/correlation.rs @@ -2,7 +2,7 @@ use ndarray::prelude::*; use ndarray::Data; use num_traits::{Float, FromPrimitive}; -/// Extension trait for ArrayBase providing functions +/// Extension trait for `ArrayBase` providing functions /// to compute different correlation measures. pub trait CorrelationExt where From bd4935752e0f4b8532cc225724b542e58712144a Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Sun, 18 Nov 2018 17:22:05 +0000 Subject: [PATCH 3/8] Uniform naming convetions --- src/histogram/strategies.rs | 2 +- src/lib.rs | 2 +- src/quantile.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/histogram/strategies.rs b/src/histogram/strategies.rs index d25eb2c3..b50b60ff 100644 --- a/src/histogram/strategies.rs +++ b/src/histogram/strategies.rs @@ -21,7 +21,7 @@ use ndarray::prelude::*; use ndarray::Data; use num_traits::{FromPrimitive, NumOps, Zero}; -use super::super::{QuantileExt, QuantileExt1d}; +use super::super::{QuantileExt, Quantile1dExt}; use super::super::interpolate::Nearest; use super::{Edges, Bins}; diff --git a/src/lib.rs b/src/lib.rs index eb6bed82..4a974d2d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,7 +39,7 @@ extern crate ndarray_rand; extern crate quickcheck; pub use maybe_nan::{MaybeNan, MaybeNanExt}; -pub use quantile::{interpolate, QuantileExt, QuantileExt1d}; +pub use quantile::{interpolate, QuantileExt, Quantile1dExt}; pub use sort::Sort1dExt; pub use correlation::CorrelationExt; pub use histogram::HistogramExt; diff --git a/src/quantile.rs b/src/quantile.rs index 3e179539..0dc2ec5c 100644 --- a/src/quantile.rs +++ b/src/quantile.rs @@ -411,8 +411,8 @@ where } } -/// Quantile methods for 1-dimensional arrays. -pub trait QuantileExt1d +/// Quantile methods for 1-D arrays. +pub trait Quantile1dExt where S: Data, { @@ -450,7 +450,7 @@ pub trait QuantileExt1d I: Interpolate; } -impl QuantileExt1d for ArrayBase +impl Quantile1dExt for ArrayBase where S: Data, { From 0bba9076c425b341be9d3e87b6950550d409acd0 Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Sun, 18 Nov 2018 17:23:28 +0000 Subject: [PATCH 4/8] Not needed anymore --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ff5dc083..9ec7608b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,4 +16,3 @@ ndarray-rand = "0.8" [patch.crates-io] ndarray = { git = "https://github.com/rust-ndarray/ndarray.git", branch = "master" } -noisy_float = { git = "https://github.com/SergiusIW/noisy_float-rs.git", rev = "c33a94803987475bbd205c9ff5a697af533f9a17" } From 30048d9334d99194bd517a40d6619d16946b872c Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Sun, 18 Nov 2018 17:23:57 +0000 Subject: [PATCH 5/8] Updated author list --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9ec7608b..92a29d32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ndarray-stats" version = "0.1.0" -authors = ["Jim Turner "] +authors = ["Jim Turner ", "LukeMathWalker "] [dependencies] ndarray = "0.12" From 0583c3ab3488d2dbfd0731ba1f6f58ddc76d2513 Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Sun, 18 Nov 2018 17:28:50 +0000 Subject: [PATCH 6/8] Updated cargo.toml informations --- Cargo.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 92a29d32..e4b8da76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,16 @@ name = "ndarray-stats" version = "0.1.0" authors = ["Jim Turner ", "LukeMathWalker "] +license = "MIT/Apache-2.0" + +repository = "https://github.com/jturner314/ndarray-stats" +documentation = "https://docs.rs/ndarray-stats/" + +description = "Statistical routines for ArrayBase, the n-dimensional array data structure provided by ndarray." + +keywords = ["array", "data-structure", "multidimensional", "statistics", "matrix", "ndarray"] +categories = ["data-structures", "science"] + [dependencies] ndarray = "0.12" noisy_float = "0.1" From e5f44cb9bf57dbe7c0c9b44114990f9622ee7e58 Mon Sep 17 00:00:00 2001 From: Jim Turner Date: Sun, 18 Nov 2018 22:57:33 +0000 Subject: [PATCH 7/8] Update Cargo.toml Co-Authored-By: LukeMathWalker --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 53529959..4d91c198 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ndarray-stats" version = "0.1.0" -authors = ["Jim Turner ", "LukeMathWalker "] +authors = ["Jim Turner ", "LukeMathWalker "] license = "MIT/Apache-2.0" From aa1e338bc068e4493ce6771f48184f9bcce26019 Mon Sep 17 00:00:00 2001 From: Jim Turner Date: Sun, 18 Nov 2018 22:57:49 +0000 Subject: [PATCH 8/8] Update Cargo.toml Co-Authored-By: LukeMathWalker --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4d91c198..4655b908 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ documentation = "https://docs.rs/ndarray-stats/" description = "Statistical routines for ArrayBase, the n-dimensional array data structure provided by ndarray." -keywords = ["array", "data-structure", "multidimensional", "statistics", "matrix", "ndarray"] +keywords = ["array", "multidimensional", "statistics", "matrix", "ndarray"] categories = ["data-structures", "science"] [dependencies]