Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezyLemon authored and YeungOnion committed Aug 15, 2024
1 parent 258a3f9 commit 4f362c6
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 30 deletions.
1 change: 0 additions & 1 deletion src/distribution/beta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ impl Continuous<f64, f64> for Beta {
mod tests {
use super::*;
use super::super::internal::*;
use crate::statistics::*;
use crate::testing_boiler;

testing_boiler!(a: f64, b: f64; Beta);
Expand Down
4 changes: 2 additions & 2 deletions src/distribution/dirac.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::distribution::{Continuous, ContinuousCDF};
use crate::distribution::ContinuousCDF;
use crate::statistics::*;
use crate::{Result, StatsError};
use rand::Rng;
Expand Down Expand Up @@ -194,7 +194,7 @@ impl Mode<Option<f64>> for Dirac {
#[cfg(test)]
mod tests {
use crate::statistics::*;
use crate::distribution::{ContinuousCDF, Continuous, Dirac};
use crate::distribution::{ContinuousCDF, Dirac};

fn try_create(v: f64) -> Dirac {
let d = Dirac::new(v);
Expand Down
6 changes: 0 additions & 6 deletions src/distribution/dirichlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ use crate::statistics::*;
use crate::{prec, Result, StatsError};
use nalgebra::DMatrix;
use nalgebra::DVector;
use nalgebra::{
base::allocator::Allocator, base::dimension::DimName, DefaultAllocator, Dim, DimMin, U1,
};
use rand::Rng;
use std::f64;

Expand Down Expand Up @@ -310,9 +307,6 @@ fn is_valid_alpha(a: &[f64]) -> bool {
#[cfg(test)]
mod tests {
use super::*;
use nalgebra::{DVector};
use crate::function::gamma;
use crate::statistics::*;
use crate::distribution::{Continuous, Dirichlet};

#[test]
Expand Down
5 changes: 2 additions & 3 deletions src/distribution/empirical.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::distribution::{Continuous, ContinuousCDF, Uniform};
use crate::distribution::{ContinuousCDF, Uniform};
use crate::statistics::*;
use crate::{Result, StatsError};
use ::num_traits::float::Float;
use crate::Result;
use core::cmp::Ordering;
use rand::Rng;
use std::collections::BTreeMap;
Expand Down
2 changes: 1 addition & 1 deletion src/distribution/internal.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use num_traits::{Bounded, Float, Num};
use num_traits::Num;

/// Returns true if there are no elements in `x` in `arr`
/// such that `x <= 0.0` or `x` is `f64::NAN` and `sum(arr) > 0.0`.
Expand Down
6 changes: 2 additions & 4 deletions src/distribution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//! and provides
//! concrete implementations for a variety of distributions.
use super::statistics::{Max, Min};
use ::num_traits::{Bounded, Float, Num};
use num_traits::{NumAssign, NumAssignOps, NumAssignRef};
use ::num_traits::{Float, Num};
use num_traits::NumAssignOps;

pub use self::bernoulli::Bernoulli;
pub use self::beta::Beta;
Expand Down Expand Up @@ -71,8 +71,6 @@ mod weibull;
mod ziggurat;
mod ziggurat_tables;

use crate::Result;

/// The `ContinuousCDF` trait is used to specify an interface for univariate
/// distributions for which cdf float arguments are sensible.
pub trait ContinuousCDF<K: Float, T: Float>: Min<K> + Max<K> {
Expand Down
5 changes: 1 addition & 4 deletions src/distribution/multivariate_normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use crate::distribution::Continuous;
use crate::distribution::Normal;
use crate::statistics::{Max, MeanN, Min, Mode, VarianceN};
use crate::{Result, StatsError};
use nalgebra::{
base::allocator::Allocator, Cholesky, Const, DMatrix, DVector, DefaultAllocator, Dim, DimMin,
Dyn, OMatrix, OVector,
};
use nalgebra::{Cholesky, Const, DMatrix, DVector, Dim, DimMin, Dyn, OMatrix, OVector};
use rand::Rng;
use std::f64;
use std::f64::consts::{E, PI};
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#![crate_name = "statrs"]
#![allow(clippy::excessive_precision)]
#![allow(clippy::many_single_char_names)]
#![allow(unused_imports)]
#![forbid(unsafe_code)]

#[macro_use]
Expand Down
4 changes: 0 additions & 4 deletions src/statistics/iter_statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ where
#[cfg(test)]
mod tests {
use std::f64::consts;
use rand::rngs::StdRng;
use rand::SeedableRng;
use rand::distributions::Distribution;
use crate::distribution::Normal;
use crate::statistics::Statistics;
use crate::generate::{InfinitePeriodic, InfiniteSinusoidal};

Expand Down
1 change: 0 additions & 1 deletion src/statistics/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Provides traits for statistical computation
pub use self::iter_statistics::*;
pub use self::order_statistics::*;
pub use self::slice_statistics::*;
pub use self::statistics::*;
Expand Down
3 changes: 0 additions & 3 deletions src/statistics/traits.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
use ::nalgebra::{
base::allocator::Allocator, base::dimension::DimName, DefaultAllocator, Dim, DimMin, U1,
};
use ::num_traits::float::Float;

const STEPS: usize = 1_000;
Expand Down

0 comments on commit 4f362c6

Please sign in to comment.