History of copenhagen
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] Remove unneeded code from the entries 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/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index bdd107b..86e8305 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__init__.py
@@ -55,7 +55,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] Move unavailable upstream sources to verified alternatives 2137af6
The upstream sources of these entries are gone, moved, or refuse automated downloads; each now downloads the same data (byte-identical to the cached files, or for board_directors, identical apart from line endings) from: - add_health: the Wayback Machine (Moreno's site, as its sibling entries) - board_directors: T. Opsahl's site (opsahl.co.uk) - copenhagen, cow_signed_relations, fullerene_structures, german_power_grid: figshare's API (its downloader refuses the server) - drosophila_flybi: the same address, without a doubled slash - dutch_criticism: V. Batagelj's repository of Pajek data on GitHub - fly_larva: the copy of the supplementary files in Europe PMC - foursquare: the authors' Google Drive file - game_thrones, microsoft_concept, un_migrations: pinned Wayback Machine snapshots - internet_top_pop: the Topology Zoo repository on GitHub - scotus_majority: Harvard Dataverse and Wayback Machine snapshots
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index 5a4248c..bdd107b 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__init__.py
@@ -37,11 +37,15 @@ url = 'https://doi.org/10.6084/m9.figshare.7267433'
citation = [('P. Sapiezynski, et al., "Interaction data from the Copenhagen Networks Study." Scientific Data 6, 315 (2019)', 'https://doi.org/10.1038/s41597-019-0325-x')]
icon_hash = '5df960794bbf13da17de226a'
upstream_license = None
-upstream_prefix = 'https://ndownloader.figshare.com/articles/7267433/versions'
-files = [(('1:zip:sms.csv', '1:zip:genders.csv'), 'sms', None),
- (('1:zip:fb_friends.csv', '1:zip:genders.csv'), 'fb_friends', None),
- (('1:zip:calls.csv', '1:zip:genders.csv'), 'calls', None),
- (('1:zip:bt_symmetric.csv', '1:zip:genders.csv'), 'bt', None)]
+# figshare's ndownloader refuses some automated downloads, so the files
+# are downloaded one by one through figshare's API, by id: 14579975
+# (sms.csv), 13389320 (fb_friends.csv), 14579972 (calls.csv), 14000795
+# (bt_symmetric.csv) and 13389440 (genders.csv)
+upstream_prefix = 'https://api.figshare.com/v2/file/download'
+files = [(('14579975', '13389440'), 'sms', None),
+ (('13389320', '13389440'), 'fb_friends', None),
+ (('14579972', '13389440'), 'calls', None),
+ (('14000795', '13389440'), 'bt', None)]
def fetch_upstream(force=False):
return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
[entries] Fix parse bugs and improve the metadata of existing entries c996a0e
From a review of the dataset descriptions against the upstream sources and papers, and from user reports: - parse fixes (wrong edge direction or directedness, shifted or misnamed properties, merged node identities, duplicated or missing edges and nodes, wrong types), e.g. arxiv_citation (the HepTh dates were a copy of the HepPh ones; now from the KDD Cup 2003 data), eu_procurements, foursquare_global, hiv_transmission, genetic_multiplex, gnutella (adds the 05 snapshot), roadnet, macaque_neural, python_dependency - descriptions rewritten from the upstream sources, documenting every property - corrected titles, citations and DOIs, licences (ustream_license typo, the data's own terms), tags and ICON ids - url lists for entries with several sources or dataset pages - SocioPatterns entries moved to the site's new data location, with the daily networks of sp_infectious and sp_primary_school - the Michael Fire entries marked as orphans (served from the mirror) - redundant type forcings removed after the graph-tool coercion fixes
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index 4b212d3..5a4248c 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__init__.py
@@ -19,24 +19,24 @@
from .. import *
title = "Copenhagen Networks Study"
-description = """A network of social interactions among university students within the Copenhagen Networks Study, over a period of four weeks, sampled every 5 minutes. Interactions include physical proximity (undirected), phone calls (directed, weighted), text messages (directed), and information about Facebook friendships (undirected). Nodes include some metadata, including gender.[^icon]
+description = """Networks of interactions among about 700 university students at the Technical University of Denmark, from the Copenhagen Networks Study. Participants were given smartphones that recorded physical proximity to other participants (via Bluetooth), phone calls and text messages; their Facebook friendships were also collected. The data released by P. Sapiezynski and collaborators cover a period of four weeks, during which Bluetooth scans were performed every five minutes. There are four networks, all on participants of the study:
-The networks have the following properties:
-
-- Nodes (all networks): `id`, the user's identifier in the original data, shared across the four networks; `female`, the user's gender: 1 for female, 0 otherwise, and -1 where unknown.
- `sms`: an edge from the sender to the recipient of each text message, with its `timestamp`.
- `calls`: an edge from the caller to the recipient of each phone call, with its `timestamp` and `duration` in seconds (-1 for a missed call).
-- `bt`: an edge for each Bluetooth scan in which two participants' phones detected each other, with its `timestamp` and `rssi` (received signal strength). Scans that detected no participant, or only devices outside the study, are not included.
-- `fb_friends`: an edge for each Facebook friendship that existed throughout the observation period.
+- `bt`: an undirected edge for each Bluetooth scan in which two participants' phones detected each other, with its `timestamp` and `rssi`, the received signal strength indicator (in dBm, a proxy for physical proximity). Scans that detected no participant, or only devices outside the study, are not included.
+- `fb_friends`: an undirected edge for each Facebook friendship between participants that existed throughout the observation period.
-Timestamps are in seconds since the beginning of the study.
+Timestamps are in seconds since the beginning of the observation period.
+
+The networks have the following properties:
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+- Nodes: `id`, the participant's identifier in the original data, shared across the four networks; `female`, the participant's gender: 1 for female, 0 otherwise, and -1 where unknown.
+- Edges: `timestamp`, `duration` and `rssi`, as described above."""
tags = ['Social', 'Offline', 'Unweighted', 'Weighted', 'Timestamps', 'Multilayer', 'Metadata']
url = 'https://doi.org/10.6084/m9.figshare.7267433'
citation = [('P. Sapiezynski, et al., "Interaction data from the Copenhagen Networks Study." Scientific Data 6, 315 (2019)', 'https://doi.org/10.1038/s41597-019-0325-x')]
icon_hash = '5df960794bbf13da17de226a'
-ustream_license = None
+upstream_license = None
upstream_prefix = 'https://ndownloader.figshare.com/articles/7267433/versions'
files = [(('1:zip:sms.csv', '1:zip:genders.csv'), 'sms', None),
(('1:zip:fb_friends.csv', '1:zip:genders.csv'), 'fb_friends', None),
Update copyright information 73a4f0d
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index 02ef144..4b212d3 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__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
[entries] Fix female property of copenhagen dataset 1cdc617
The genders were read from the edge file instead of genders.csv, so every node had female=False. The property is now 1 (female), 0 (not female), or -1 for users without gender information, and the description documents all node and edge properties. Also add analysis_db.forget(), to refresh the stored analyses of an entry whose networks were regenerated. Fixes #18
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index e3eb9a5..02ef144 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__init__.py
@@ -20,6 +20,17 @@ from .. import *
title = "Copenhagen Networks Study"
description = """A network of social interactions among university students within the Copenhagen Networks Study, over a period of four weeks, sampled every 5 minutes. Interactions include physical proximity (undirected), phone calls (directed, weighted), text messages (directed), and information about Facebook friendships (undirected). Nodes include some metadata, including gender.[^icon]
+
+The networks have the following properties:
+
+- Nodes (all networks): `id`, the user's identifier in the original data, shared across the four networks; `female`, the user's gender: 1 for female, 0 otherwise, and -1 where unknown.
+- `sms`: an edge from the sender to the recipient of each text message, with its `timestamp`.
+- `calls`: an edge from the caller to the recipient of each phone call, with its `timestamp` and `duration` in seconds (-1 for a missed call).
+- `bt`: an edge for each Bluetooth scan in which two participants' phones detected each other, with its `timestamp` and `rssi` (received signal strength). Scans that detected no participant, or only devices outside the study, are not included.
+- `fb_friends`: an edge for each Facebook friendship that existed throughout the observation period.
+
+Timestamps are in seconds since the beginning of the study.
+
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Offline', 'Unweighted', 'Weighted', 'Timestamps', 'Multilayer', 'Metadata']
url = 'https://doi.org/10.6084/m9.figshare.7267433'
@@ -105,11 +116,16 @@ def parse(alts=None):
g.vp.id = g.add_edge_list(edges(), hashed=True, hash_type="int",
eprops=[g.ep.timestamp, g.ep.rssi])
- g.vp.female = g.new_vp("bool")
+ # 1: female, 0: not female, -1: no information (some users in
+ # the networks are missing from genders.csv)
+ g.vp.female = g.new_vp("int", val=-1)
vs = {g.vp.id[v]:v for v in g.vertices()}
- reader = csv.reader(fs[0])
+ fs[1].readline()
+ reader = csv.reader(fs[1])
for row in reader:
- g.vp.female[int(row[0])] = row[1]
+ v = vs.get(int(row[0]))
+ if v is not None:
+ g.vp.female[v] = int(row[1])
g = Graph(g, vorder=g.vp.id)
Update copyright information 3d288ea
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index 70865ad..e3eb9a5 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__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 8d005ae
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index e87a7ab..70865ad 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__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 db2efcc
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index 3331842..e87a7ab 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__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 e878874
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index 6a7591b..3331842 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__init__.py
@@ -23,7 +23,7 @@ description = """A network of social interactions among university students with
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Offline', 'Unweighted', 'Weighted', 'Timestamps', 'Multilayer', 'Metadata']
url = 'https://doi.org/10.6084/m9.figshare.7267433'
-citation = [('P. Sapiezynski, et al., "Interaction data from the Copenhagen Networks Study." Scientific Data 6, 315 (2019)', 'https://www.nature.com/articles/s41597-019-0325-x')]
+citation = [('P. Sapiezynski, et al., "Interaction data from the Copenhagen Networks Study." Scientific Data 6, 315 (2019)', 'https://doi.org/10.1038/s41597-019-0325-x')]
icon_hash = '5df960794bbf13da17de226a'
ustream_license = None
upstream_prefix = 'https://ndownloader.figshare.com/articles/7267433/versions'
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index b5b23b9..6a7591b 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__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 1645314
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
index 25e9004..b5b23b9 100644
--- a/entries/copenhagen/__init__.py
+++ b/entries/copenhagen/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Copenhagen Networks Study"
-description = "A network of social interactions among university students within the Copenhagen Networks Study, over a period of four weeks, sampled every 5 minutes. Interactions include physical proximity (undirected), phone calls (directed, weighted), text messages (directed), and information about Facebook friendships (undirected). Nodes include some metadata, including gender."
+description = """A network of social interactions among university students within the Copenhagen Networks Study, over a period of four weeks, sampled every 5 minutes. Interactions include physical proximity (undirected), phone calls (directed, weighted), text messages (directed), and information about Facebook friendships (undirected). Nodes include some metadata, including gender.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Offline', 'Unweighted', 'Weighted', 'Timestamps', 'Multilayer', 'Metadata']
url = 'https://doi.org/10.6084/m9.figshare.7267433'
citation = [('P. Sapiezynski, et al., "Interaction data from the Copenhagen Networks Study." Scientific Data 6, 315 (2019)', 'https://www.nature.com/articles/s41597-019-0325-x')]
Initial commit cc85872
diff --git a/entries/copenhagen/__init__.py b/entries/copenhagen/__init__.py
new file mode 100644
index 0000000..25e9004
--- /dev/null
+++ b/entries/copenhagen/__init__.py
@@ -0,0 +1,115 @@
+#! /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 *
+
+title = "Copenhagen Networks Study"
+description = "A network of social interactions among university students within the Copenhagen Networks Study, over a period of four weeks, sampled every 5 minutes. Interactions include physical proximity (undirected), phone calls (directed, weighted), text messages (directed), and information about Facebook friendships (undirected). Nodes include some metadata, including gender."
+tags = ['Social', 'Offline', 'Unweighted', 'Weighted', 'Timestamps', 'Multilayer', 'Metadata']
+url = 'https://doi.org/10.6084/m9.figshare.7267433'
+citation = [('P. Sapiezynski, et al., "Interaction data from the Copenhagen Networks Study." Scientific Data 6, 315 (2019)', 'https://www.nature.com/articles/s41597-019-0325-x')]
+icon_hash = '5df960794bbf13da17de226a'
+ustream_license = None
+upstream_prefix = 'https://ndownloader.figshare.com/articles/7267433/versions'
+files = [(('1:zip:sms.csv', '1:zip:genders.csv'), 'sms', None),
+ (('1:zip:fb_friends.csv', '1:zip:genders.csv'), 'fb_friends', None),
+ (('1:zip:calls.csv', '1:zip:genders.csv'), 'calls', None),
+ (('1:zip:bt_symmetric.csv', '1:zip:genders.csv'), 'bt', 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]
+
+ if alt == "sms":
+ fs[0].readline()
+ def edges():
+ reader = csv.reader(fs[0])
+ for row in reader:
+ vals = [int(x) for x in row]
+ yield vals[1:] + [vals[0]]
+
+ g = Graph()
+ g.ep.timestamp = g.new_ep("int")
+ g.vp.id = g.add_edge_list(edges(), hashed=True, hash_type="int",
+ eprops=[g.ep.timestamp])
+
+ if alt == "fb_friends":
+ fs[0].readline()
+ def edges():
+ reader = csv.reader(fs[0])
+ for row in reader:
+ vals = [int(x) for x in row]
+ yield vals
+
+ g = Graph(directed=False)
+ g.vp.id = g.add_edge_list(edges(), hashed=True, hash_type="int")
+
+ if alt == "calls":
+ fs[0].readline()
+ def edges():
+ reader = csv.reader(fs[0])
+ for row in reader:
+ vals = [int(x) for x in row]
+ yield vals[1:3] + [vals[0]] + vals[3:]
+
+ g = Graph()
+ g.ep.timestamp = g.new_ep("int")
+ g.ep.duration = g.new_ep("int")
+ g.vp.id = g.add_edge_list(edges(), hashed=True, hash_type="int",
+ eprops=[g.ep.timestamp, g.ep.duration])
+
+ if alt == "bt":
+ fs[0].readline()
+ def edges():
+ reader = csv.reader(fs[0])
+ for row in reader:
+ vals = [int(x) for x in row]
+ vals = vals[1:3] + [vals[0]] + vals[3:]
+ if vals[1] < 0:
+ continue
+ yield vals
+
+ g = Graph(directed=False)
+ g.ep.timestamp = g.new_ep("int")
+ g.ep.rssi = g.new_ep("int")
+ g.vp.id = g.add_edge_list(edges(), hashed=True, hash_type="int",
+ eprops=[g.ep.timestamp, g.ep.rssi])
+
+ g.vp.female = g.new_vp("bool")
+ vs = {g.vp.id[v]:v for v in g.vertices()}
+ reader = csv.reader(fs[0])
+ for row in reader:
+ g.vp.female[int(row[0])] = row[1]
+
+ g = Graph(g, vorder=g.vp.id)
+
+ yield alt, g