logo Netzschleuder network catalog, repository, and centrifuge

History of sp_sfhh_conference

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] New entry: sp_sfhh_conference by Tiago de Paula Peixoto a291201
diff --git a/entries/sp_sfhh_conference/__init__.py b/entries/sp_sfhh_conference/__init__.py
new file mode 100644
index 0000000..2446b0e
--- /dev/null
+++ b/entries/sp_sfhh_conference/__init__.py
@@ -0,0 +1,64 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+from .. import *
+
+title = "SFHH conference contacts (2009)"
+description = """A temporal network of face-to-face contacts between participants of the 2009 annual conference of the Société Française d'Hygiène Hospitalière (SFHH, French society for hospital hygiene) in Nice, France, recorded by the SocioPatterns collaboration. Of the about 1,200 attendees, 405 volunteers wore radio-frequency identification (RFID) badges on their chests, which exchange low-power radio packets that are only received when two people are close to each other (about 1 to 1.5 meters) and facing each other, since the body shields the signal. Time is coarse-grained into intervals of 20 seconds, and two participants are considered in contact during an interval if their badges detected each other during it. The data were collected over the two days of the conference, from 9 am to 9 pm on the first day and from 8:30 am to 4:30 pm on the second (the dataset page gives the dates as June 4 and 5, 2009, while Stehlé et al. give June 3 and 4). The data were first studied by Cattuto et al. (2010) and Stehlé et al. (2011), and were publicly released by Génois and Barrat (2018); 403 of the 405 participants appear in the released contacts. The identities of the participants are anonymized and no metadata are released.
+
+Nodes are participants, and each edge corresponds to a contact between two participants during one 20-second interval, so that two participants are connected by as many edges as the number of intervals in which they were in contact. The network has the following properties:
+
+- `id`: the anonymous identifier of the participant in the source data.
+- `time`: the end of the 20-second interval in which the contact was active, in seconds (the contact was active during [`time` - 20, `time`]). The origin of the times is not stated in the source; the values (32,520 to 146,820) are consistent with seconds since midnight of the first day."""
+tags = ['Social', 'Offline', 'Temporal', 'Timestamps', 'Multigraph', 'Unweighted']
+url = 'https://sociopatterns.org/datasets/sfhh-conference-data-set/'
+citation = [('M. Génois, A. Barrat, "Can co-location be used as a proxy for face-to-face contacts?" EPJ Data Science 7, 11 (2018)', 'https://doi.org/10.1140/epjds/s13688-018-0140-1'),
+            ('J. Stehlé, N. Voirin, A. Barrat, C. Cattuto, V. Colizza, L. Isella, C. Régis, J.-F. Pinton, N. Khanafer, W. Van den Broeck, P. Vanhems, "Simulation of an SEIR infectious disease model on the dynamic contact network of conference attendees." BMC Medicine 9, 87 (2011)', 'https://doi.org/10.1186/1741-7015-9-87'),
+            ('C. Cattuto, W. Van den Broeck, A. Barrat, V. Colizza, J.-F. Pinton, A. Vespignani, "Dynamics of Person-to-Person Interactions from Distributed RFID Sensor Networks." PLoS ONE 5(7), e11596 (2010)', 'https://doi.org/10.1371/journal.pone.0011596')]
+icon_hash = None
+upstream_license = ("CC0 1.0", "https://creativecommons.org/publicdomain/zero/1.0/")
+upstream_prefix = 'https://sociopatterns.org/assets/data'
+files = [('SFHH_tij.dat.gz', None, None)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        if isinstance(fnames, str):
+            fnames = [fnames]
+        with ExitStack() as stack:
+            fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+
+            # Lines: "t i j"
+            c = read_ints(fs[0]).reshape(-1, 3)
+            g = Graph(directed=False)
+            g.ep.time = g.new_ep("int")
+            g.vp.id = g.add_edge_list(c[:, [1, 2, 0]], hashed=True,
+                                      hash_type="int", eprops=[g.ep.time])
+            g = Graph(g, vorder=g.vp.id)
+        yield alt, g