bumped kernel_density
to 0.0.3
This commit is contained in:
parent
a5932f998a
commit
20797d4886
|
@ -11,13 +11,10 @@ rec {
|
|||
|
||||
buildPhase = ''
|
||||
cargo build --lib --release --target=wasm32-unknown-unknown
|
||||
|
||||
mkdir -p $out/pkg
|
||||
|
||||
wasm-bindgen --target nodejs --out-dir $out/pkg target/wasm32-unknown-unknown/release/quri_squiggle_mc.wasm
|
||||
'';
|
||||
installPhase = "echo 'skipping installPhase'";
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ../packages/mc/Cargo.lock;
|
||||
outputHashes = {
|
||||
|
@ -29,7 +26,7 @@ rec {
|
|||
name = "squiggle-mc-lint";
|
||||
src = ../packages/mc;
|
||||
buildInputs = with pkgs; [ rustfmt ];
|
||||
buildPhase = "rustfmt --check src";
|
||||
buildPhase = "rustfmt --check src/**";
|
||||
installPhase = "mkdir -p $out";
|
||||
};
|
||||
|
||||
|
|
23
packages/mc/Cargo.lock
generated
23
packages/mc/Cargo.lock
generated
|
@ -286,11 +286,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "kernel_density"
|
||||
version = "0.0.2"
|
||||
source = "git+https://github.com/daithiocrualaoich/kernel_density#98c5fb6f9989d9bb6db19adc134cdbd32512d41e"
|
||||
version = "0.0.3"
|
||||
source = "git+https://github.com/quinn-dougherty/kernel_density#c044758c96ae0c4666523a38449f3dbd0d4695cd"
|
||||
dependencies = [
|
||||
"rand 0.3.23",
|
||||
"special-fun",
|
||||
"rand 0.4.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -441,16 +440,6 @@ dependencies = [
|
|||
"wee_alloc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.3.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand 0.4.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.4.6"
|
||||
|
@ -589,12 +578,6 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "special-fun"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5cde43d93062bf8040a0d30f83a8b40b2756af55ba048e007ee7c81e02276b81"
|
||||
|
||||
[[package]]
|
||||
name = "statistics"
|
||||
version = "0.4.1"
|
||||
|
|
|
@ -52,7 +52,7 @@ rand = "0.8.5"
|
|||
getrandom = { version = "0.2.7", features = ["js"] }
|
||||
# rand_distr = "0.4.3"
|
||||
statistics = "0.4.1"
|
||||
kernel_density = { git = "https://github.com/daithiocrualaoich/kernel_density" }
|
||||
kernel_density = { git = "https://github.com/quinn-dougherty/kernel_density", version = "0.0.3" }
|
||||
cached = { version = "0.38.0", features = ["wasm"] }
|
||||
# instant = { git = "https://github.com/sebcrozet/instant", features = ["wasm-bindgen"] }
|
||||
# The `console_error_panic_hook` crate provides better debugging of panics by
|
||||
|
|
|
@ -20,12 +20,12 @@ pub fn sample_n(samples: Box<[f32]>, num_samples: i32) -> Vec<f32> {
|
|||
monte_carlo::sample_n(samples_vec, num_samples)
|
||||
}
|
||||
|
||||
// #[wasm_bindgen]
|
||||
// pub fn samples_to_continuous_pdf(samples: Box<[f64]>, bandwidth: f64) -> JsValue {
|
||||
// #[cfg(debug_assertions)]
|
||||
// console_error_panic_hook::set_once();
|
||||
//
|
||||
// let samples_vec = Vec::from(samples);
|
||||
// let pdf = monte_carlo::samples_to_continuous_pdf(samples_vec, bandwidth);
|
||||
// serde_wasm_bindgen::to_value(&pdf).unwrap()
|
||||
//}
|
||||
#[wasm_bindgen]
|
||||
pub fn samples_to_continuous_pdf(samples: Box<[f64]>, bandwidth: f64) -> JsValue {
|
||||
#[cfg(debug_assertions)]
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
let samples_vec = Vec::from(samples);
|
||||
let pdf = monte_carlo::samples_to_continuous_pdf(samples_vec, bandwidth);
|
||||
serde_wasm_bindgen::to_value(&pdf).unwrap()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user