generated from epiverse-trace/packagetemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use snapshot tests for regression testing .sim_network_bp
- Loading branch information
1 parent
ca5b4fa
commit daacbd7
Showing
2 changed files
with
66 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# .sim_network_bp works as expected | ||
|
||
Code | ||
.sim_network_bp(contact_distribution = contact_distribution, contact_interval = contact_interval, | ||
prob_infect = 0.5, config = create_config()) | ||
Output | ||
id ancestor generation infected time | ||
1 1 NA 1 infected 0.00000000 | ||
2 2 1 2 contact 1.88240160 | ||
3 3 1 2 infected 1.80451250 | ||
4 4 3 3 infected 0.05896314 | ||
5 5 3 3 contact 1.15835525 | ||
6 6 3 3 contact 0.99001994 | ||
7 7 4 4 infected 2.14036129 | ||
8 8 7 5 contact 0.46988251 | ||
9 9 7 5 contact 0.69425308 | ||
10 10 7 5 contact 0.06819735 | ||
|
||
# .sim_network_bp works as expected with no contacts | ||
|
||
Code | ||
.sim_network_bp(contact_distribution = contact_distribution, contact_interval = contact_interval, | ||
prob_infect = 0.5, config = create_config()) | ||
Output | ||
id ancestor generation infected time | ||
1 1 NA 1 infected 0 | ||
|
||
# .sim_network_bp works as expected with unadjusted network | ||
|
||
Code | ||
.sim_network_bp(contact_distribution = contact_distribution, contact_interval = contact_interval, | ||
prob_infect = 0.5, config = create_config(network = "unadjusted")) | ||
Output | ||
id ancestor generation infected time | ||
1 1 NA 1 infected 0.00000000 | ||
2 2 1 2 contact 1.88240160 | ||
3 3 1 2 infected 1.80451250 | ||
4 4 3 3 infected 0.05896314 | ||
5 5 3 3 contact 1.15835525 | ||
6 6 3 3 contact 0.99001994 | ||
7 7 4 4 infected 2.14036129 | ||
8 8 7 5 contact 0.46988251 | ||
9 9 7 5 contact 0.69425308 | ||
10 10 7 5 contact 0.06819735 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters