refactor: remove visualization and fanova feature flags
Always build visualization and fanova code unconditionally.
This commit is contained in:
@@ -38,8 +38,6 @@ tracing = ["dep:tracing"]
|
|||||||
sobol = ["dep:sobol_burley"]
|
sobol = ["dep:sobol_burley"]
|
||||||
cma-es = ["dep:nalgebra"]
|
cma-es = ["dep:nalgebra"]
|
||||||
gp = ["dep:nalgebra"]
|
gp = ["dep:nalgebra"]
|
||||||
visualization = []
|
|
||||||
fanova = []
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
|
||||||
@@ -72,7 +70,6 @@ required-features = ["derive"]
|
|||||||
[[example]]
|
[[example]]
|
||||||
name = "visualization_demo"
|
name = "visualization_demo"
|
||||||
path = "examples/visualization_demo.rs"
|
path = "examples/visualization_demo.rs"
|
||||||
required-features = ["visualization"]
|
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "journal_tests"
|
name = "journal_tests"
|
||||||
|
|||||||
@@ -222,7 +222,6 @@ macro_rules! trace_debug {
|
|||||||
|
|
||||||
mod distribution;
|
mod distribution;
|
||||||
mod error;
|
mod error;
|
||||||
#[cfg(feature = "fanova")]
|
|
||||||
mod fanova;
|
mod fanova;
|
||||||
mod importance;
|
mod importance;
|
||||||
mod kde;
|
mod kde;
|
||||||
@@ -237,11 +236,9 @@ pub mod storage;
|
|||||||
mod study;
|
mod study;
|
||||||
mod trial;
|
mod trial;
|
||||||
mod types;
|
mod types;
|
||||||
#[cfg(feature = "visualization")]
|
|
||||||
mod visualization;
|
mod visualization;
|
||||||
|
|
||||||
pub use error::{Error, Result, TrialPruned};
|
pub use error::{Error, Result, TrialPruned};
|
||||||
#[cfg(feature = "fanova")]
|
|
||||||
pub use fanova::{FanovaConfig, FanovaResult};
|
pub use fanova::{FanovaConfig, FanovaResult};
|
||||||
pub use multi_objective::{MultiObjectiveSampler, MultiObjectiveStudy, MultiObjectiveTrial};
|
pub use multi_objective::{MultiObjectiveSampler, MultiObjectiveStudy, MultiObjectiveTrial};
|
||||||
#[cfg(feature = "derive")]
|
#[cfg(feature = "derive")]
|
||||||
@@ -278,7 +275,6 @@ pub use study::Study;
|
|||||||
pub use study::StudySnapshot;
|
pub use study::StudySnapshot;
|
||||||
pub use trial::{AttrValue, Trial};
|
pub use trial::{AttrValue, Trial};
|
||||||
pub use types::{Direction, TrialState};
|
pub use types::{Direction, TrialState};
|
||||||
#[cfg(feature = "visualization")]
|
|
||||||
pub use visualization::generate_html_report;
|
pub use visualization::generate_html_report;
|
||||||
|
|
||||||
/// Convenient wildcard import for the most common types.
|
/// Convenient wildcard import for the most common types.
|
||||||
@@ -291,7 +287,6 @@ pub mod prelude {
|
|||||||
pub use optimizer_derive::Categorical as DeriveCategory;
|
pub use optimizer_derive::Categorical as DeriveCategory;
|
||||||
|
|
||||||
pub use crate::error::{Error, Result, TrialPruned};
|
pub use crate::error::{Error, Result, TrialPruned};
|
||||||
#[cfg(feature = "fanova")]
|
|
||||||
pub use crate::fanova::{FanovaConfig, FanovaResult};
|
pub use crate::fanova::{FanovaConfig, FanovaResult};
|
||||||
pub use crate::multi_objective::{MultiObjectiveStudy, MultiObjectiveTrial};
|
pub use crate::multi_objective::{MultiObjectiveStudy, MultiObjectiveTrial};
|
||||||
pub use crate::param::ParamValue;
|
pub use crate::param::ParamValue;
|
||||||
@@ -326,6 +321,5 @@ pub mod prelude {
|
|||||||
pub use crate::study::StudySnapshot;
|
pub use crate::study::StudySnapshot;
|
||||||
pub use crate::trial::{AttrValue, Trial};
|
pub use crate::trial::{AttrValue, Trial};
|
||||||
pub use crate::types::Direction;
|
pub use crate::types::Direction;
|
||||||
#[cfg(feature = "visualization")]
|
|
||||||
pub use crate::visualization::generate_html_report;
|
pub use crate::visualization::generate_html_report;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2081,7 +2081,6 @@ where
|
|||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// Returns [`crate::Error::NoCompletedTrials`] if fewer than 2 trials have completed.
|
/// Returns [`crate::Error::NoCompletedTrials`] if fewer than 2 trials have completed.
|
||||||
#[cfg(feature = "fanova")]
|
|
||||||
pub fn fanova(&self) -> crate::Result<crate::fanova::FanovaResult> {
|
pub fn fanova(&self) -> crate::Result<crate::fanova::FanovaResult> {
|
||||||
self.fanova_with_config(&crate::fanova::FanovaConfig::default())
|
self.fanova_with_config(&crate::fanova::FanovaConfig::default())
|
||||||
}
|
}
|
||||||
@@ -2094,7 +2093,6 @@ where
|
|||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// Returns [`crate::Error::NoCompletedTrials`] if fewer than 2 trials have completed.
|
/// Returns [`crate::Error::NoCompletedTrials`] if fewer than 2 trials have completed.
|
||||||
#[cfg(feature = "fanova")]
|
|
||||||
#[allow(clippy::cast_precision_loss)]
|
#[allow(clippy::cast_precision_loss)]
|
||||||
pub fn fanova_with_config(
|
pub fn fanova_with_config(
|
||||||
&self,
|
&self,
|
||||||
@@ -2357,7 +2355,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "visualization")]
|
|
||||||
impl Study<f64> {
|
impl Study<f64> {
|
||||||
/// Generates an HTML report with interactive Plotly.js charts.
|
/// Generates an HTML report with interactive Plotly.js charts.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
//! Integration tests for fANOVA parameter importance.
|
//! Integration tests for fANOVA parameter importance.
|
||||||
|
|
||||||
#![cfg(feature = "fanova")]
|
|
||||||
|
|
||||||
use optimizer::prelude::*;
|
use optimizer::prelude::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#![cfg(feature = "visualization")]
|
|
||||||
|
|
||||||
use optimizer::parameter::{FloatParam, IntParam, Parameter};
|
use optimizer::parameter::{FloatParam, IntParam, Parameter};
|
||||||
use optimizer::sampler::random::RandomSampler;
|
use optimizer::sampler::random::RandomSampler;
|
||||||
use optimizer::{Direction, Study, generate_html_report};
|
use optimizer::{Direction, Study, generate_html_report};
|
||||||
|
|||||||
Reference in New Issue
Block a user