Skip to content

Commit

Permalink
expand tests, update top level source file
Browse files Browse the repository at this point in the history
  • Loading branch information
jangevaare committed Apr 23, 2020
1 parent 66dcd1a commit bb08ea0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Pathogen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module Pathogen
OnlineStats

import StatsBase.mean,
StatsBase.mode,
Base.summary,
ProgressMeter.next!

Expand Down Expand Up @@ -66,6 +67,7 @@ module Pathogen
include("visualization/population.jl")
include("visualization/transmission_network.jl")
include("visualization/transmission_network_distribution.jl")
include("visualization/degree_distribution.jl")
include("visualization/trace.jl")

export
Expand Down Expand Up @@ -174,13 +176,14 @@ module Pathogen
ZeroMeanDiagNormalCanon,
ZeroMeanFullNormal,
ZeroMeanFullNormalCanon,
# Pathogen.jl types
# Pathogen.jl types/functions
EpidemicModel,
SEIR, SEI, SIR, SI,
DiseaseState,
State_S, State_E, State_I, State_R,
RiskFunctions, RiskParameters, RiskPriors,
Population,
AbstractTransmissionNetwork,
TransmissionNetwork,
TransmissionNetworkDistribution, TNDistribution,
TransmissionNetworkPrior, TNPrior,
Expand All @@ -191,5 +194,5 @@ module Pathogen
Events, EventObservations, EventExtents,
observe,
MCMC, start!, iterate!,
summary
summary, mean, mode
end
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ pop = Population(risks,
@test all([mcmc.markov_chains[i].iterations for i = 1:3] .== 100)
tnd = TNDistribution(mcmc, burnin=2)
@test sum(tnd) sum(obs.infection .!== NaN)
@test sum(mode(tnd)) sum(obs.infection .!== NaN)
@test all(Pathogen._outdegree(tnd) .>= 0.0)
mcmc = MCMC(obs, ee, pop, rf, rpriors, tnprior=tnd)
start!(mcmc, attempts=100)
iterate!(mcmc, 100, 1.0, condition_on_network=false)
Expand Down Expand Up @@ -159,6 +161,8 @@ end
@test all([mcmc.markov_chains[i].iterations for i = 1:3] .== 100)
tnd = TNDistribution(mcmc, burnin=2)
@test sum(tnd) sum(obs.infection .!== NaN)
@test sum(mode(tnd)) sum(obs.infection .!== NaN)
@test all(Pathogen._outdegree(tnd) .>= 0.0)
mcmc = MCMC(obs, ee, pop, rf, rpriors, tnprior=tnd)
start!(mcmc, attempts=50)
iterate!(mcmc, 100, 1.0, condition_on_network=false)
Expand Down Expand Up @@ -233,6 +237,8 @@ end
@test all([mcmc.markov_chains[i].iterations for i = 1:3] .== 100)
tnd = TNDistribution(mcmc, burnin=2)
@test sum(tnd) sum(obs.infection .!== NaN)
@test sum(mode(tnd)) sum(obs.infection .!== NaN)
@test all(Pathogen._outdegree(tnd) .>= 0.0)
mcmc = MCMC(obs, ee, pop, rf, rpriors, tnprior=tnd)
start!(mcmc, attempts=50)
iterate!(mcmc, 100, 1.0, condition_on_network=false)
Expand Down Expand Up @@ -297,6 +303,8 @@ end
@test all([mcmc.markov_chains[i].iterations for i = 1:3] .== 100)
tnd = TNDistribution(mcmc, burnin=2)
@test sum(tnd) sum(obs.infection .!== NaN)
@test sum(mode(tnd)) sum(obs.infection .!== NaN)
@test all(Pathogen._outdegree(tnd) .>= 0.0)
mcmc = MCMC(obs, ee, pop, rf, rpriors, tnprior=tnd)
start!(mcmc, attempts=50)
iterate!(mcmc, 100, 1.0, condition_on_network=false)
Expand Down

2 comments on commit bb08ea0

@jangevaare
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register
Release notes:

  • summary() now only outputs selected credible interval
  • mode() to generate transmission network mode from a TNDistribution
  • plot() recipe for degree distribution histogram for TransmissionNetworks and TNDistributions
  • Generalize some transmission network functionality using new AbstractTransmissionNetwork

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/13501

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.11 -m "<description of version>" bb08ea03c98afbf6f3a409cc714764e19cab5baf
git push origin v0.4.11

Please sign in to comment.