Skip to content

Final touches #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
[package]
name = "ndarray-stats"
version = "0.1.0"
authors = ["Jim Turner <[email protected]>"]
authors = ["Jim Turner <[email protected]>", "LukeMathWalker <[email protected]>"]

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"
Expand Down
2 changes: 1 addition & 1 deletion src/correlation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<A, S>
where
Expand Down
2 changes: 1 addition & 1 deletion src/histogram/strategies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
28 changes: 27 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/quantile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ where
}
}

/// Quantile methods for 1-dimensional arrays.
pub trait QuantileExt1d<A, S>
/// Quantile methods for 1-D arrays.
pub trait Quantile1dExt<A, S>
where
S: Data<Elem = A>,
{
Expand Down Expand Up @@ -450,7 +450,7 @@ pub trait QuantileExt1d<A, S>
I: Interpolate<A>;
}

impl<A, S> QuantileExt1d<A, S> for ArrayBase<S, Ix1>
impl<A, S> Quantile1dExt<A, S> for ArrayBase<S, Ix1>
where
S: Data<Elem = A>,
{
Expand Down