History of air500
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/air500/__init__.py b/entries/air500/__init__.py
index 2893c69..fd164b9 100644
--- a/entries/air500/__init__.py
+++ b/entries/air500/__init__.py
@@ -25,7 +25,7 @@ The nodes have the property `name`, the IATA code of the airport (e.g. "FRA", "J
tags = ['Transportation', 'Airport', 'Unweighted', 'Metadata']
url = 'https://web.archive.org/web/20160203050435/http://www.dynamic-connectome.org/?page_id=25'
citation = [('J. Marcelino, M. Kaiser, "Critical paths in a metapopulation model of H1N1: Efficiently delaying influenza spreading through flight cancellation." PLoS Currents 4, e4f8c9a2e1fca8 (2012)', 'https://doi.org/10.1371/4f8c9a2e1fca8')]
-icon_hash = None
+date_added = '2026-10-25'
upstream_license = None
upstream_prefix = 'https://www.dynamic-connectome.org/pubs/suppl'
files = [(('air500.zip:air500matrix.csv', 'air500.zip:air500labels.csv'), None, None)]
[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/air500/__init__.py b/entries/air500/__init__.py
index d207be4..2893c69 100644
--- a/entries/air500/__init__.py
+++ b/entries/air500/__init__.py
@@ -38,7 +38,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: air500 b3e7972
diff --git a/entries/air500/__init__.py b/entries/air500/__init__.py
new file mode 100644
index 0000000..d207be4
--- /dev/null
+++ b/entries/air500/__init__.py
@@ -0,0 +1,52 @@
+#! /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 = "Flight connections among the 500 largest airports (2007-2008)"
+description = """Directed network of scheduled flight connections among the 500 airports of the world with the largest total passenger volume, from J. Marcelino and M. Kaiser, who used it in a metapopulation model of the spreading of influenza A (H1N1) over the airline network. The connections were extracted from the scheduled flight data of OAG Aviation Solutions for one year (flights operating from July 1, 2007 to June 30, 2008; 1,341,615 records, estimated by OAG to cover 99% of commercial flights), after removing short-distance links corresponding to rail, boat, bus or limousine connections. Nodes are airports, identified by their IATA codes, and an edge connects two airports if at least one scheduled flight connected them in the period. The source adjacency matrix is not symmetric (about 9% of the connections are listed in only one direction); following the usual convention, the entry $(i, j)$ is taken as an edge from airport $i$ to airport $j$ (the convention is not stated explicitly with the data). Only the network among the top 500 airports is distributed, since the complete OAG data set, with all airports and traffic volumes, is proprietary.
+
+The nodes have the property `name`, the IATA code of the airport (e.g. "FRA", "JFK")."""
+tags = ['Transportation', 'Airport', 'Unweighted', 'Metadata']
+url = 'https://web.archive.org/web/20160203050435/http://www.dynamic-connectome.org/?page_id=25'
+citation = [('J. Marcelino, M. Kaiser, "Critical paths in a metapopulation model of H1N1: Efficiently delaying influenza spreading through flight cancellation." PLoS Currents 4, e4f8c9a2e1fca8 (2012)', 'https://doi.org/10.1371/4f8c9a2e1fca8')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'https://www.dynamic-connectome.org/pubs/suppl'
+files = [(('air500.zip:air500matrix.csv', 'air500.zip:air500labels.csv'), 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
+ with open_upstream_file(name, fnames[0], "r") as f:
+ A = numpy.loadtxt(f, delimiter=",", dtype="int")
+ with open_upstream_file(name, fnames[1], "r") as f:
+ # the codes are given one letter per column, e.g. "F,R,A"
+ labels = [l.strip().replace(",", "") for l in f if l.strip()]
+ g = adjacency_graph(A, directed=True, labels=labels)
+ yield alt, g