Skip to content

Commit 7acdaf6

Browse files
committed
Fix persistent feature consistency
1 parent 919c08a commit 7acdaf6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ blas = ["ndarray/blas", "egobox-gp/blas", "egobox-moe/blas", "egobox-ego/blas"]
3333
egobox-doe = { version = "0.15.0", path = "./doe" }
3434
egobox-gp = { version = "0.15.0", path = "./gp" }
3535
egobox-moe = { version = "0.15.0", path = "./moe", features = ["persistent"] }
36-
egobox-ego = { version = "0.15.0", path = "./ego" }
36+
egobox-ego = { version = "0.15.0", path = "./ego", features = ["persistent"] }
3737

3838
linfa = { version = "0.7", default-features = false }
3939

ego/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ categories = ["algorithms", "mathematics", "science"]
1212
[features]
1313
default = []
1414

15+
persistent = ["egobox-moe/persistent"]
1516
blas = ["ndarray-linalg", "linfa/ndarray-linalg", "linfa-pls/blas"]
1617

1718
[dependencies]

ego/src/mixint.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ use ndarray::{s, Array, Array2, ArrayBase, ArrayView2, Axis, Data, DataMut, Ix2,
1515
use ndarray_rand::rand::SeedableRng;
1616
use ndarray_stats::QuantileExt;
1717
use rand_xoshiro::Xoshiro256Plus;
18+
use std::marker::PhantomData;
1819

1920
use serde::{Deserialize, Serialize};
2021

22+
#[cfg(feature = "persistent")]
2123
use egobox_moe::MoeError;
24+
#[cfg(feature = "persistent")]
2225
use std::fs;
26+
#[cfg(feature = "persistent")]
2327
use std::io::Write;
24-
use std::marker::PhantomData;
2528

2629
/// Expand xlimits to add continuous dimensions for enumeration x features.
2730
///
@@ -549,6 +552,7 @@ impl GpSurrogate for MixintMoe {
549552
}
550553

551554
/// Save Moe model in given file.
555+
#[cfg(feature = "persistent")]
552556
fn save(&self, path: &str) -> egobox_moe::Result<()> {
553557
let mut file = fs::File::create(path).unwrap();
554558
let bytes = match serde_json::to_string(self) {

0 commit comments

Comments
 (0)