Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soliciting tests #35

Open
glwagner opened this issue May 27, 2020 · 3 comments · May be fixed by #36
Open

Soliciting tests #35

glwagner opened this issue May 27, 2020 · 3 comments · May be fixed by #36

Comments

@glwagner
Copy link
Collaborator

I'm going to put together some tests using pytest.

It's fairly simple: we'll just have a folder called /test, and files named test_* that implement tests according to the pytest 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:

  • known solutions to the master equation model for simple networks
  • statistical tests that make sure the samplers work as intended
@lubo93
Copy link
Collaborator

lubo93 commented May 29, 2020

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 ).

@glwagner
Copy link
Collaborator Author

@lubo93 and for this test we run the ContactSimulator with no temporal modulation, correct? This should be easy.

@glwagner glwagner linked a pull request May 29, 2020 that will close this issue
@glwagner
Copy link
Collaborator Author

glwagner commented May 29, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants