History of colombia_calls_mobility
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 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/colombia_calls_mobility/__init__.py b/entries/colombia_calls_mobility/__init__.py
index 068f088..1cc8ac1 100644
--- a/entries/colombia_calls_mobility/__init__.py
+++ b/entries/colombia_calls_mobility/__init__.py
@@ -35,7 +35,7 @@ The networks have the following properties:
tags = ['Social', 'Communication', 'Travel', 'Weighted', 'Metadata']
url = 'https://doi.org/10.1371/journal.pone.0145091'
citation = [('M. Coscia, R. Hausmann, "Evidence That Calls-Based and Mobility Networks Are Isomorphic." PLOS ONE 10(12), e0145091 (2015)', 'https://doi.org/10.1371/journal.pone.0145091')]
-icon_hash = '577ea50558d31bd664bac0da'
+date_added = '2026-10-25'
upstream_license = ('Creative Commons Attribution 4.0 International (CC BY 4.0)', 'https://creativecommons.org/licenses/by/4.0/')
upstream_prefix = None
files = [(('pone.0145091.s003.zip:social/city_city_nedges_social',
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/colombia_calls_mobility/__init__.py b/entries/colombia_calls_mobility/__init__.py
index 4f79a84..068f088 100644
--- a/entries/colombia_calls_mobility/__init__.py
+++ b/entries/colombia_calls_mobility/__init__.py
@@ -29,8 +29,9 @@ These are the complete aggregated networks distributed with the paper. In the pa
The networks have the following properties:
-- Nodes: `code`, the code of the municipality (DANE code prefixed with "M"); `name`, the name of the municipality.
-- Edges: `weight`, the number of calls (`calls`) or observed movements (`mobility`) from the source to the target municipality."""
+- (Node) `code`: the code of the municipality (DANE code prefixed with "M").
+- (Node) `name`: the name of the municipality.
+- (Edge) `weight`: the number of calls (`calls`) or observed movements (`mobility`) from the source to the target municipality."""
tags = ['Social', 'Communication', 'Travel', 'Weighted', 'Metadata']
url = 'https://doi.org/10.1371/journal.pone.0145091'
citation = [('M. Coscia, R. Hausmann, "Evidence That Calls-Based and Mobility Networks Are Isomorphic." PLOS ONE 10(12), e0145091 (2015)', 'https://doi.org/10.1371/journal.pone.0145091')]
[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/colombia_calls_mobility/__init__.py b/entries/colombia_calls_mobility/__init__.py
index fae0197..4f79a84 100644
--- a/entries/colombia_calls_mobility/__init__.py
+++ b/entries/colombia_calls_mobility/__init__.py
@@ -66,7 +66,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] New entry: colombia_calls_mobility 1364d2f
diff --git a/entries/colombia_calls_mobility/__init__.py b/entries/colombia_calls_mobility/__init__.py
new file mode 100644
index 0000000..fae0197
--- /dev/null
+++ b/entries/colombia_calls_mobility/__init__.py
@@ -0,0 +1,88 @@
+#! /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 = "Colombian municipality call and mobility networks (2014)"
+description = """Two networks among the 863 municipalities of Colombia, derived from the anonymized metadata of mobile phone calls of the operators of Colombia, from Coscia and Hausmann. For each call, the data record the (anonymized) caller and callee, the time of the call, and the phone tower to which the caller was connected. Only phones that made and received at least six calls during the observation period were kept, to remove foreign phones and special numbers (e.g. call centers). The towers were aggregated by municipality. The paper does not state the observation period precisely (its example call is from December 2013); ICON dates the data to 2014.
+
+- `calls`: each phone is assigned to the municipality of the tower it connected to most frequently, and each call is counted as a directed edge from the municipality of the caller to the municipality of the callee.
+- `mobility`: a directed edge from municipality A to municipality B is counted whenever a phone made two consecutive calls, the first in A and the second in B.
+
+These are the complete aggregated networks distributed with the paper. In the paper, the most significant edges were then selected, keeping the maximum spanning tree and the edges that are statistically significant according to the disparity filter of Serrano et al. (this filtering is not applied here).
+
+The networks have the following properties:
+
+- Nodes: `code`, the code of the municipality (DANE code prefixed with "M"); `name`, the name of the municipality.
+- Edges: `weight`, the number of calls (`calls`) or observed movements (`mobility`) from the source to the target municipality."""
+tags = ['Social', 'Communication', 'Travel', 'Weighted', 'Metadata']
+url = 'https://doi.org/10.1371/journal.pone.0145091'
+citation = [('M. Coscia, R. Hausmann, "Evidence That Calls-Based and Mobility Networks Are Isomorphic." PLOS ONE 10(12), e0145091 (2015)', 'https://doi.org/10.1371/journal.pone.0145091')]
+icon_hash = '577ea50558d31bd664bac0da'
+upstream_license = ('Creative Commons Attribution 4.0 International (CC BY 4.0)', 'https://creativecommons.org/licenses/by/4.0/')
+upstream_prefix = None
+files = [(('pone.0145091.s003.zip:social/city_city_nedges_social',
+ 'pone.0145091.s003.zip:code_municipio'), 'calls', None),
+ (('pone.0145091.s003.zip:mobility/city_city_nedges_mobility',
+ 'pone.0145091.s003.zip:code_municipio'), 'mobility', None)]
+# S3 File of the paper
+archive_url = 'https://journals.plos.org/plosone/article/file?type=supplementary&id=10.1371/journal.pone.0145091.s003'
+
+def fetch_upstream(force=False):
+ # The supplementary file URL carries a query string, so it is fetched
+ # here directly
+ name = __name__.split(".")[-1]
+ fname = "pone.0145091.s003.zip"
+ if not force:
+ try:
+ with open_upstream_file(name, fname, "rb"):
+ return
+ except (FileNotFoundError, IOError):
+ pass
+ with open_url(archive_url) as f:
+ data = f.read()
+ if not data.startswith(b"PK"):
+ raise RuntimeError(f"unexpected content for {fname}")
+ with open_upstream_file(name, fname, "wb") as output:
+ output.write(data)
+
+@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
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+ # Tab-separated: source, target, weight
+ edges = [l.rstrip("\n").split("\t") for l in fs[0] if l.strip()]
+ # Tab-separated: code, name
+ codes = [l.rstrip("\n").split("\t") for l in fs[1] if l.strip()]
+ g = Graph(directed=True)
+ g.add_vertex(len(codes))
+ g.vp.code = g.new_vp("string", vals=[c for c, n in codes])
+ g.vp.name = g.new_vp("string", vals=[n for c, n in codes])
+ idx = {c: i for i, (c, n) in enumerate(codes)}
+ g.ep.weight = g.new_ep("int64_t")
+ g.add_edge_list([(idx[s], idx[t], int(float(w))) for s, t, w in edges],
+ eprops=[g.ep.weight])
+ yield alt, g