Skip to content

Detect a varying number of infections #87

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Detect a varying number of infections #87

wants to merge 7 commits into from

Conversation

swo
Copy link
Contributor

@swo swo commented Apr 21, 2025

Add front & backend support for requiring multiple positive, forwarded tests to constitute a "detection"

@swo
Copy link
Contributor Author

swo commented Apr 21, 2025

@k88hudson-cfa I could use some Rust help here. I needed to add a dependency statrs to get a function, but that seems to have also added capability for random number generation, which leads to some difficulties with wasm.

I followed these instructions to the best of my understanding, but I still get this problem. (I'm also unsure where that second version of getrandom is coming from...)

Halp plz!

❯ npm run wasm

> [email protected] wasm
> wasm-pack build ./wasm_dynode --target web

[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/ulp7/proj/dynode-web/wasm_dynode/Cargo.toml
workspace: /home/ulp7/proj/dynode-web/Cargo.toml
warning: /home/ulp7/proj/dynode-web/wasm_dynode/Cargo.toml: unused manifest key: target.wasm32-unknown-unknown.rustflags
   Compiling proc-macro2 v1.0.95
   Compiling getrandom v0.2.15
error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support
   --> /home/ulp7/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.2.15/src/lib.rs:342:9
    |
342 | /         compile_error!("the wasm*-unknown-unknown targets are not supported by \
343 | |                         default, you may need to enable the \"js\" feature. \
344 | |                         For more information see: \
345 | |                         https://docs.rs/getrandom/#webassembly-support");
    | |________________________________________________________________________^

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `imp`
   --> /home/ulp7/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.2.15/src/lib.rs:398:9
    |
398 |         imp::getrandom_inner(dest)?;
    |         ^^^ use of unresolved module or unlinked crate `imp`
    |
    = help: if you wanted to use a crate named `imp`, use `cargo add imp` to add it to your `Cargo.toml`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `getrandom` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
  full command: cd "./wasm_dynode" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"

@swo swo linked an issue Apr 21, 2025 that may be closed by this pull request
@swo swo requested a review from k88hudson April 25, 2025 18:49
@swo
Copy link
Contributor Author

swo commented Apr 25, 2025

@k88hudson I'm a little stumped here. It looks like the results aren't updating as I would expect when the number to detect is different from 1. I have some unit tests on my probability of detection function, so I think that's working, but something is going wrong elsewhere. Can you help me debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detection: allow for a variable number of people detected
2 participants