logo Netzschleuder network catalog, repository, and centrifuge

History of sp_office

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] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index 8e41353..0e4d26e 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -31,7 +31,7 @@ The network has the following properties:
 tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Metadata']
 url = 'https://sociopatterns.org/datasets/contacts-in-a-workplace/'
 citation = [('M. Génois et al., "Data on face-to-face contacts in an office building suggest a low-cost vaccination strategy based on community linkers." Network Science 3(3), 326-347 (2015)', 'https://doi.org/10.1017/nws.2015.10')]
-icon_hash = '594b41074ed8f1bb6022ae45'
+date_added = '2020-08-11'
 upstream_license = ("Creative Commons CC0 1.0 Universal (Public Domain Dedication)",
                     "https://creativecommons.org/publicdomain/zero/1.0/")
 upstream_prefix = 'https://sociopatterns.org/assets/data'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index e5640ea..8e41353 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -25,9 +25,9 @@ description = r"""Temporal network of face-to-face proximity contacts among 92 e
 
 The network has the following properties:
 
-- `id`: the anonymous identifier of the employee.
-- `department`: the department of the employee (`DISQ`, `DMCT`, `DSE`, `SFLE` or `SRH`).
-- `time`: the end of the 20-second interval $[t - 20\,\text{s}, t]$ during which the contact was active, in seconds since 0:00 on 24 June 2013."""
+- (Node) `id`: the anonymous identifier of the employee.
+- (Node) `department`: the department of the employee (`DISQ`, `DMCT`, `DSE`, `SFLE` or `SRH`).
+- (Edge) `time`: the end of the 20-second interval $[t - 20\,\text{s}, t]$ during which the contact was active, in seconds since 0:00 on 24 June 2013."""
 tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Metadata']
 url = 'https://sociopatterns.org/datasets/contacts-in-a-workplace/'
 citation = [('M. Génois et al., "Data on face-to-face contacts in an office building suggest a low-cost vaccination strategy based on community linkers." Network Science 3(3), 326-347 (2015)', 'https://doi.org/10.1017/nws.2015.10')]
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index fdadacc..e5640ea 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -45,7 +45,6 @@ def fetch_upstream(force=False):
 @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:
[entries] Fix parse bugs and improve descriptions and metadata by Tiago de Paula Peixoto 6bb6851
- parse fixes from the review of the descriptions, e.g. us_patents
  (directed), celegans_2019 (synapse direction), ecoli_transcription and
  yeast_transcription (regulator to target), bitcoin (direction, phantom
  node), ego_social (Google+ features and circles), scotus_majority,
  arxiv_authors and social_location (as in SNAP), caida_as, dnc, dom,
  mist, reuters and bibsonomy (names on the right nodes), uci_zoo
- every description now states explicitly what the nodes and edges
  represent; corrected titles, years, tags, citations and licences
- the "Hypergraph" tag is removed; very large entries are marked
  `huge = True` (see --skip-huge)
- ICON ids of partial duplicates added (hiv_transmission, congress_bills,
  openflights, dutch_school)
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index 86a82a5..fdadacc 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -21,22 +21,21 @@ from .. import *
 import csv
 
 title = "Workplace contacts (2013)"
-description = """A temporal network of contacts between individuals, measured in an office building in France, from June 24 to July 3, 2013.[^icon]
+description = r"""Temporal network of face-to-face proximity contacts among 92 employees in an office building of the French Institute for Public Health Surveillance (InVS) in Saint-Maurice, France, from 24 June to 3 July 2013, measured by the SocioPatterns collaboration with wearable sensors. Nodes are employees, and each edge is a contact between two employees active during a 20-second interval of the data collection, so that a pair of employees is connected by one edge per interval in which they were in contact.
 
-The data set comprises two files. The first one contains a tab-separated list representing the active contacts during 20-second intervals of the data collection. Each line has the form “t i j”, where i and j are the anonymous IDs of the persons in contact, and the interval during which this contact was active is [t – 20s, t] (t is expressed in seconds since the time origin taken as 0:00 on June 24, 2013).
+The network has the following properties:
 
-The second file contains a list of the form “i Di” where i is the anonymous ID of an individual and Di the name of his/her department in the workplace.
-
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project.
-"""
+- `id`: the anonymous identifier of the employee.
+- `department`: the department of the employee (`DISQ`, `DMCT`, `DSE`, `SFLE` or `SRH`).
+- `time`: the end of the 20-second interval $[t - 20\,\text{s}, t]$ during which the contact was active, in seconds since 0:00 on 24 June 2013."""
 tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Metadata']
-url = 'http://www.sociopatterns.org/datasets/contacts-in-a-workplace/'
+url = 'https://sociopatterns.org/datasets/contacts-in-a-workplace/'
 citation = [('M. Génois et al., "Data on face-to-face contacts in an office building suggest a low-cost vaccination strategy based on community linkers." Network Science 3(3), 326-347 (2015)', 'https://doi.org/10.1017/nws.2015.10')]
 icon_hash = '594b41074ed8f1bb6022ae45'
-ustream_license = ("Creative Commons Attribution-NonCommercial-ShareAlike",
-                   "http://creativecommons.org/licenses/by-nc-sa/3.0/")
-upstream_prefix = 'http://www.sociopatterns.org/wp-content/uploads/2016/06'
-files = [(('tij_InVS.dat_.zip:tij_InVS.dat', 'metadata_InVS13.txt'), None, None)]
+upstream_license = ("Creative Commons CC0 1.0 Universal (Public Domain Dedication)",
+                    "https://creativecommons.org/publicdomain/zero/1.0/")
+upstream_prefix = 'https://sociopatterns.org/assets/data'
+files = [(('workplace_InVS_tij.dat.zip:tij_InVS.dat', 'workplace_InVS_metadata.txt'), None, None)]
 
 def fetch_upstream(force=False):
     return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
@@ -74,6 +73,7 @@ def parse(alts=None):
                 v = int(row[0])
                 if v not in vs:
                     vs[v] = g.add_vertex()
+                    g.vp.id[vs[v]] = v
                 v = vs[v]
                 g.vp.department[v] = row[1]
 
Update copyright information by Tiago de Paula Peixoto 73a4f0d
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index a6bb24f..86a82a5 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# 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
Update copyright information by Tiago de Paula Peixoto 3d288ea
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index ab91785..a6bb24f 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 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
Update copyright information by Tiago de Paula Peixoto 8d005ae
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index 1f2651b..ab91785 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 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
Update copyright info by Tiago de Paula Peixoto db2efcc
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index 651df4d..1f2651b 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 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
Update citations to use DOIs by Tiago de Paula Peixoto e878874
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index 3c717d9..651df4d 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -31,7 +31,7 @@ The second file contains a list of the form “i Di” where i is the anonymous
 """
 tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Metadata']
 url = 'http://www.sociopatterns.org/datasets/contacts-in-a-workplace/'
-citation = [('M. Génois et al., "Data on face-to-face contacts in an office building suggest a low-cost vaccination strategy based on community linkers." Network Science 3(3), 326-347 (2015)', 'https://www.cambridge.org/core/journals/network-science/article/data-on-facetoface-contacts-in-an-office-building-suggest-a-lowcost-vaccination-strategy-based-on-community-linkers/18AB49AB4F2AEA33CE7501F06ADBC8E8')]
+citation = [('M. Génois et al., "Data on face-to-face contacts in an office building suggest a low-cost vaccination strategy based on community linkers." Network Science 3(3), 326-347 (2015)', 'https://doi.org/10.1017/nws.2015.10')]
 icon_hash = '594b41074ed8f1bb6022ae45'
 ustream_license = ("Creative Commons Attribution-NonCommercial-ShareAlike",
                    "http://creativecommons.org/licenses/by-nc-sa/3.0/")
Change license from GPLv3 to AGPLv3 by Tiago de Paula Peixoto d754be5
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index e6122f7..3c717d9 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -3,18 +3,18 @@
 #
 # Copyright (C) 2020 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 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 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 General Public License for more details.
+# 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 General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# 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 *
 
Add explicit attribution to descriptions obtained from ICON by Tiago de Paula Peixoto 1645314
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
index 8e9a5a1..e6122f7 100644
--- a/entries/sp_office/__init__.py
+++ b/entries/sp_office/__init__.py
@@ -21,11 +21,13 @@ from .. import *
 import csv
 
 title = "Workplace contacts (2013)"
-description = """A temporal network of contacts between individuals, measured in an office building in France, from June 24 to July 3, 2013.
+description = """A temporal network of contacts between individuals, measured in an office building in France, from June 24 to July 3, 2013.[^icon]
 
-The data set comprises two files. The first one contains a tab-separated list representing the active contacts during 20-second intervals of the data collection. Each line has the form “t i j”, where i and j are the anonymous IDs of the persons in contact, and the interval during which this contact was active is [ t – 20s, t ] (t is expressed in seconds since the time origin taken as 0:00 on June 24, 2013).
+The data set comprises two files. The first one contains a tab-separated list representing the active contacts during 20-second intervals of the data collection. Each line has the form “t i j”, where i and j are the anonymous IDs of the persons in contact, and the interval during which this contact was active is [t – 20s, t] (t is expressed in seconds since the time origin taken as 0:00 on June 24, 2013).
 
 The second file contains a list of the form “i Di” where i is the anonymous ID of an individual and Di the name of his/her department in the workplace.
+
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project.
 """
 tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Metadata']
 url = 'http://www.sociopatterns.org/datasets/contacts-in-a-workplace/'
Initial commit by Tiago de Paula Peixoto cc85872
diff --git a/entries/sp_office/__init__.py b/entries/sp_office/__init__.py
new file mode 100644
index 0000000..8e9a5a1
--- /dev/null
+++ b/entries/sp_office/__init__.py
@@ -0,0 +1,80 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 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 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+import csv
+
+title = "Workplace contacts (2013)"
+description = """A temporal network of contacts between individuals, measured in an office building in France, from June 24 to July 3, 2013.
+
+The data set comprises two files. The first one contains a tab-separated list representing the active contacts during 20-second intervals of the data collection. Each line has the form “t i j”, where i and j are the anonymous IDs of the persons in contact, and the interval during which this contact was active is [ t – 20s, t ] (t is expressed in seconds since the time origin taken as 0:00 on June 24, 2013).
+
+The second file contains a list of the form “i Di” where i is the anonymous ID of an individual and Di the name of his/her department in the workplace.
+"""
+tags = ['Social', 'Offline', 'Weighted', 'Temporal', 'Metadata']
+url = 'http://www.sociopatterns.org/datasets/contacts-in-a-workplace/'
+citation = [('M. Génois et al., "Data on face-to-face contacts in an office building suggest a low-cost vaccination strategy based on community linkers." Network Science 3(3), 326-347 (2015)', 'https://www.cambridge.org/core/journals/network-science/article/data-on-facetoface-contacts-in-an-office-building-suggest-a-lowcost-vaccination-strategy-based-on-community-linkers/18AB49AB4F2AEA33CE7501F06ADBC8E8')]
+icon_hash = '594b41074ed8f1bb6022ae45'
+ustream_license = ("Creative Commons Attribution-NonCommercial-ShareAlike",
+                   "http://creativecommons.org/licenses/by-nc-sa/3.0/")
+upstream_prefix = 'http://www.sociopatterns.org/wp-content/uploads/2016/06'
+files = [(('tij_InVS.dat_.zip:tij_InVS.dat', 'metadata_InVS13.txt'), 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]
+
+            reader = csv.reader(fs[0], delimiter=" ")
+            def get_edges():
+                for rows in reader:
+                    t, u, v = [int(x) for x in rows[:3]]
+                    yield u, v, t
+            g = Graph(directed=False)
+            g.ep.time = g.new_ep("int")
+            g.vp.id = g.add_edge_list(get_edges(), hashed=True,
+                                      hash_type="int", eprops=[g.ep.time])
+
+            vs = {g.vp.id[v] : v for v in g.vertices()}
+
+            g.vp.department = g.new_vp("string")
+            reader = csv.reader(fs[1], delimiter="\t")
+            for row in reader:
+                v = int(row[0])
+                if v not in vs:
+                    vs[v] = g.add_vertex()
+                v = vs[v]
+                g.vp.department[v] = row[1]
+
+            g = Graph(g, vorder=g.vp.id)
+
+        yield alt, g