Skip to content

Commit

Permalink
fix: gate parallelize option behind feature flag (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k authored Oct 16, 2024
1 parent 7209327 commit ed00e48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/augurs-js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ serde-wasm-bindgen = "0.6.0"
tracing.workspace = true
tracing-wasm = { version = "0.2.1", optional = true }
tsify-next = { version = "0.5.3", default-features = false, features = ["js"] }
wasm-bindgen = "0.2.87"
wasm-bindgen = "=0.2.93"
wasm-bindgen-rayon = { version = "1.2.1", optional = true }

[package.metadata.wasm-pack.profile.release]
Expand Down
3 changes: 3 additions & 0 deletions crates/augurs-js/src/dtw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub struct DtwOptions {
#[tsify(optional)]
pub upper_bound: Option<f64>,

#[cfg(feature = "parallel")]
/// Parallelize the DTW distance matrix calculation.
#[tsify(optional)]
pub parallelize: Option<bool>,
}
Expand Down Expand Up @@ -134,6 +136,7 @@ impl Dtw {
if let Some(upper_bound) = opts.upper_bound {
dtw = dtw.with_upper_bound(upper_bound);
}
#[cfg(feature = "parallel")]
if let Some(parallelize) = opts.parallelize {
dtw = dtw.parallelize(parallelize);
}
Expand Down

0 comments on commit ed00e48

Please sign in to comment.