Open glwagner opened 4 years ago
One possible test for the fraction of active edges is to make a comparison with the analytical solution: mean fraction of active edges = lambda(t)/( lambda(t) + mu ).
@lubo93 and for this test we run the ContactSimulator
with no temporal modulation, correct? This should be easy.
To generate simple networks for tests we can use the following code courtesy of Dr. Boettcher (@lubo93 ):
import networkx as nx
# seed random number generators in *both* numpy.random and random
nodes = 500
attachment = 2
contact_network = nx.barabasi_albert_graph(nodes, attachment)
This generates a graph using the Barbasi-Albert model.
I'm going to put together some tests using
pytest
.It's fairly simple: we'll just have a folder called
/test
, and files namedtest_*
that implement tests according to thepytest
style.I'll put in basic unit tests that ensure that critical functions runs, and some "regression" style tests that ensure output is reproducible.
However, we will also need tests that ensure behavior is correct. These are more difficult to come up with. We can discuss ideas on this issue. A few ideas: