diff --git a/Cargo.toml b/Cargo.toml index ee420ab1..4655b908 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,17 @@ [package] name = "ndarray-stats" version = "0.1.0" -authors = ["Jim Turner "] +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", "multidimensional", "statistics", "matrix", "ndarray"] +categories = ["data-structures", "science"] [dependencies] ndarray = "0.12" 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 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 b2543b71..4a974d2d 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; @@ -13,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, {