opendp / opendp

The core library of differential privacy algorithms powering the OpenDP Project.
https://opendp.org
MIT License
284 stars 46 forks source link

Should `cargo test --all-features` work? Should we use it? #1525

Closed mccalluc closed 2 weeks ago

mccalluc commented 3 weeks ago

Right now we reference different subsets of features in CI and in developer docs:

      - name: Test
        run: cargo test --verbose --features untrusted,ffi,polars
    cargo build --features untrusted,bindings
...
Substitute ``cargo build`` with ``cargo test`` to test

Should we be able to use --all-features instead? Currently failing locally:

error[E0599]: no function or associated item named `sample_discrete_laplace_Z2k` found for type `f64` in the current scope
   --> src/traits/samplers/discretize/mod.rs:292:27
    |
292 |             .map(|_| f64::sample_discrete_laplace_Z2k(shift, scale, -1074))
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `f64`

error[E0599]: no function or associated item named `sample_discrete_gaussian_Z2k` found for type `f64` in the current scope
   --> src/traits/samplers/discretize/mod.rs:306:27
    |
306 |             .map(|_| f64::sample_discrete_gaussian_Z2k(shift, scale, -1074))
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `f64`

It looks like we could also define a default, if there's a reason not to use all.

mccalluc commented 3 weeks ago

Yes, try using --all-features

mccalluc commented 2 weeks ago

and when we fix it, find all references to --features and update them all, and explain any exceptions. (tasks.json, docs, notebooks, Makefile, etc.)