Temporal networks in Python. Provides fast tools to analyze temporal contact networks and simulate dynamic processes on them using Gillespie's SSA.
OTHER License
TemporAl COntact Modeling and Analysis. Provides fast tools to analyze temporal contact networks, produce surrogate networks using qualitative models and simulate Gillespie processes on them. Currently only working on OSX and Linux distributions. No Windows support yet!
In order to download the SocioPatterns 'Hypertext 2009'-dataset and visualize it interactively, do the following.
>>> import tacoma as tc
>>> from tacoma.interactive import visualize
>>> temporal_network = tc.download_and_convert_sociopatterns_hypertext_2009()
100% [..............................................................................] 67463 / 67463
>>> visualize(temporal_network, frame_dt = 20)
tacoma
is a joint C++/Python-package for the modeling and analysis of undirected and
unweighted temporal networks, with a focus on (but not limited to) human face-to-face contact networks.
tc.edge_lists
and tc.edge_changes
),on
-intervals for each edge called tc.edge_trajectories
is.taco
as a standardized way to share temporal network data.json
-file, a simple file format readable from aBoost
If you get compiling errors, make sure that pybind11 is installed.
$ git clone https://github.com/benmaier/tacoma
$ pip install ./tacoma
Note that a C++11-compiler has to be installed on the system before installing tacoma
. On OS X
it might happen that even though pip installed pybind11
it's not available during installation.
If that happens please open a detailed issue here. You might want to try
$ brew install pybind11
as a work-around.
The following packages are not installed during installation with pip
since they're only required
for drawing and drawing is not essential. If you want to use tacoma.drawing
, please install
matplotlib
networkx
python-louvain (community)
The documentation is currently available at http://tacoma.benmaier.org . It is full of typos and non-exhaustive but I think the important points are in there.
Check out the sandbox directory.
Here is an example for the temporal network format tc.edge_changes
.
import tacoma as tc
from tacoma.interactive import visualize
# define temporal network as a list of edge changes
temporal_network = tc.edge_changes()
temporal_network.N = 10
temporal_network.edges_initial = [ (0,1), (2,3), (1,7), (3,5), (1,9), (7,2) ]
temporal_network.t0 = 0.0
temporal_network.t = [ 0.8, 2.4 ]
temporal_network.tmax = 3.1
temporal_network.edges_in = [
[ (0, 5), (3, 6) ],
[ (3, 7), (4, 9), (7, 8) ],
]
temporal_network.edges_out = [
[ (0, 1) ],
[ (2, 3), (3, 6) ],
]
visualize(temporal_network, frame_dt = 0.05)
The whole software is published under the MIT software license. The documentation and all figures are copyrighted by Benjamin F. Maier. Ask for permission if you want to distribute parts.