Skip to content
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

Features ndarrayl and nalgebral are not to be used by users #229

Merged
merged 1 commit into from
Jun 16, 2022
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
6 changes: 3 additions & 3 deletions argmin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ default = ["slog-logger", "serde1"]
wasm-bindgen = ["instant/wasm-bindgen", "getrandom/js"]
slog-logger = ["slog", "slog-term", "slog-async"]
serde1 = ["serde", "serde_json", "rand/serde1", "bincode", "slog-json"]
ndarrayl = ["argmin-math/ndarray_latest-serde"]
nalgebral = ["argmin-math/nalgebra_latest-serde"]
_ndarrayl = ["argmin-math/ndarray_latest-serde"]
_nalgebral = ["argmin-math/nalgebra_latest-serde"]

[badges]
maintenance = { status = "actively-developed" }
Expand Down Expand Up @@ -99,7 +99,7 @@ required-features = ["argmin-math/ndarray_latest-serde", "slog-logger"]

[[example]]
name = "gaussnewton_nalgebra"
required-features = ["nalgebral", "argmin-math/nalgebra_latest-serde", "slog-logger"]
required-features = ["_nalgebral", "argmin-math/nalgebra_latest-serde", "slog-logger"]

[[example]]
name = "goldensectionsearch"
Expand Down
6 changes: 3 additions & 3 deletions argmin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@
//!
//! ## Running the tests and building the examples
//!
//! The tests and examples require a set of features to be enabled:
//! For running all tests and examples, it is recommended to enable all features:
//!
//! ```bash
//! cargo test --features "argmin/ctrlc,argmin-math/ndarray_latest-serde,argmin-math/nalgebra_latest-serde,argmin/ndarrayl"
//! cargo test --all-features
//! ```
//!
//! # Defining a problem
Expand Down Expand Up @@ -644,5 +644,5 @@ pub mod core;
pub mod solver;

#[cfg(test)]
#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
mod tests;
10 changes: 5 additions & 5 deletions argmin/src/solver/gaussnewton/gaussnewton_linesearch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ mod tests {

use super::*;
use crate::core::ArgminError;
#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
use crate::core::{IterState, State};
use crate::solver::linesearch::{condition::ArmijoCondition, BacktrackingLineSearch};
use crate::{assert_error, test_trait_impl};
#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
use approx::assert_relative_eq;

test_trait_impl!(
Expand Down Expand Up @@ -283,7 +283,7 @@ mod tests {
);
}

#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
#[test]
fn test_line_search_sub_problem() {
use ndarray::{Array, Array1, Array2};
Expand Down Expand Up @@ -331,7 +331,7 @@ mod tests {
assert_relative_eq!(res[1], 2.0 * 0.5 + 4.0 * 2.0, epsilon = f64::EPSILON);
}

#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
#[test]
fn test_next_iter_param_not_initialized() {
use ndarray::{Array, Array1, Array2};
Expand Down Expand Up @@ -374,7 +374,7 @@ mod tests {
);
}

#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
#[test]
fn test_next_iter_regression() {
use ndarray::{Array, Array1, Array2};
Expand Down
8 changes: 4 additions & 4 deletions argmin/src/solver/gaussnewton/gaussnewton_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ where
mod tests {
use super::*;
use crate::core::ArgminError;
#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
use crate::core::Executor;
use crate::test_trait_impl;
#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
use approx::assert_relative_eq;

test_trait_impl!(gauss_newton_method, GaussNewton<f64>);
Expand Down Expand Up @@ -233,7 +233,7 @@ mod tests {
);
}

#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
#[test]
fn test_next_iter_param_not_initialized() {
use ndarray::{Array, Array1, Array2};
Expand Down Expand Up @@ -270,7 +270,7 @@ mod tests {
);
}

#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
#[test]
fn test_solver() {
use crate::core::State;
Expand Down
8 changes: 4 additions & 4 deletions argmin/src/solver/newton/newton_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ where
mod tests {
use super::*;
use crate::core::ArgminError;
#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
use crate::core::Executor;
use crate::test_trait_impl;
#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
use approx::assert_relative_eq;

test_trait_impl!(newton_method, Newton<f64>);
Expand Down Expand Up @@ -154,7 +154,7 @@ mod tests {
}
}

#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
#[test]
fn test_next_iter_param_not_initialized() {
use crate::core::State;
Expand Down Expand Up @@ -192,7 +192,7 @@ mod tests {
);
}

#[cfg(feature = "ndarrayl")]
#[cfg(feature = "_ndarrayl")]
#[test]
fn test_solver() {
use crate::core::State;
Expand Down