Skip to content

Commit

Permalink
docs: describe how to run tests including NIST
Browse files Browse the repository at this point in the history
  • Loading branch information
YeungOnion committed Jun 25, 2024
1 parent 222539a commit a57db2f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ statrs = "*" # replace * by the latest version of the crate.

For examples, view [the docs](https://docs.rs/statrs/*/statrs/).

### Running tests

If you'd like to run all suggested tests, you'll need to download some data from
NIST, we have a script for this and formatting the data in the `tests/` folder.

```sh
cargo test
./tests/gather_nist_data.sh && cargo test -- --include-ignored nist_
```

If you'd like to modify where the data is downloaded, you can use the environment variable,
`STATRS_NIST_DATA_DIR` for running the script and the tests.

## Contributing

Thanks for your help to improve the project!
Expand Down
17 changes: 17 additions & 0 deletions tests/nist_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
//! This test relies on data that is reusable but not distributable by statrs as
//! such, the data will need to be downloaded from the relevant NIST StRD dataset
//! the parsing for testing assumes data to be of form,
//! ```text
//! sample mean : <possibly signed float for mean>
//! sample std_dev : <possibly signed float for standard deviation>
//! sample correlation: <possibly signed float for correlation coefficient>
//! [zero or more blank lines]
//! data0
//! data1
//! data2
//! ...
//! ```
//! This test can be run on it's own from the shell from this folder as
//! ```sh
//! ./gather_nist_data.sh && cargo test -- --ignored nist_
//! ```
use anyhow::Result;
use approx::assert_relative_eq;
use statrs::statistics::Statistics;
Expand Down

0 comments on commit a57db2f

Please sign in to comment.