Skip to content

Commit e1af9aa

Browse files
authored
Move forward simulation to examples/. Closes #83 (#85)
Move simplification tests to this example, thus making it an integration test. Update GitHub actions. Streamline Birth struct in forward_simulation.rs Replace GSL with rand. Closes #80.
1 parent c82a7f0 commit e1af9aa

File tree

9 files changed

+1020
-1110
lines changed

9 files changed

+1020
-1110
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ jobs:
2929
toolchain: ${{ matrix.rust }}
3030
override: true
3131
- run: cargo check
32-
- name: run tests
33-
run: cargo test
3432
- name: check examples
35-
working-directory: forrustts_examples
36-
run: cargo check
33+
run: cargo check --examples
34+
- name: run tests
35+
run: |
36+
cargo test
37+
cargo test --examples
3738
3839
build-osx:
3940
runs-on: macos-latest
@@ -56,11 +57,12 @@ jobs:
5657
toolchain: ${{ matrix.rust }}
5758
override: true
5859
- run: cargo check
59-
- name: run tests
60-
run: cargo test
6160
- name: check examples
62-
working-directory: forrustts_examples
63-
run: cargo check
61+
run: cargo check --examples
62+
- name: run tests
63+
run: |
64+
cargo test
65+
cargo test --examples
6466
6567
fmt:
6668
name: rust fmt
@@ -88,9 +90,4 @@ jobs:
8890
override: true
8991
- run: rustup component add clippy
9092
- run: |
91-
cargo clippy -- -D warnings
92-
- run: |
93-
cargo clippy --tests -- -D warnings
94-
- name: Run clippy on the examples
95-
working-directory: forrustts_examples
96-
run: cargo clippy -- -D warnings
93+
cargo clippy --all-targets -- -D warnings

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,12 @@ keywords = ["simulation", "tree_sequences", "tskit", "population_genetics"]
1414
[dependencies]
1515
bitflags = "1.2.1"
1616
thiserror = "1.0"
17-
GSL = "4.0.0"
1817
tskit = "=0.2.0"
18+
19+
[dev-dependencies]
20+
clap = "~2.27.0"
21+
rand = "0.8.3"
22+
rand_distr = "0.4.0"
23+
24+
[[example]]
25+
name = "forward_simulation"

README.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,26 @@ It is licensed under the GNU General Public License, version 3 or later ("GPL3+"
1313

1414
## Getting started
1515

16-
Install the GNU Scientific Library.
17-
For example:
18-
1916
```
20-
apt install libgsl-dev
17+
cargo build
18+
cargo test
2119
```
2220

23-
You may use `conda` or `brew` as you see fit.
24-
25-
[Install rust](https://www.rust-lang.org/learn/get-started)
26-
27-
Then:
21+
Example programs are in the subdirectory `examples/`:
2822

2923
```
30-
cargo build
31-
cargo test
24+
cargo build --examples
3225
```
3326

34-
Example programs are in the subdirectory `forrustts_examples`:
27+
The binaries will then be found in `target/debug/examples`.
28+
29+
To build optimized examples:
3530

3631
```
37-
cd forrustts_examples
38-
cargo build --release
32+
cargo build --release --examples
3933
```
4034

41-
The binaries will then be found in `target/release/`.
35+
The binaries will then be found in `target/release/examples`.
4236

4337
These programs use [clap](https://crates.io/crates/clap) for command-line options.
4438
Pass ``--help`` to any of them for usage information.

0 commit comments

Comments
 (0)