History of at_migrations
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] Fix parse bugs and improve descriptions and metadata 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/at_migrations/__init__.py b/entries/at_migrations/__init__.py
index 8435fe7..8d20ad9 100644
--- a/entries/at_migrations/__init__.py
+++ b/entries/at_migrations/__init__.py
@@ -20,8 +20,8 @@ from .. import *
import csv
import io
-title = "Austrian internal migrations (2002-2022)"
-description = """A network of migrations between municipalities in Austria, from 2002 to 2022. A weighted directed link from source to target indicates a migration flow from these two municipalities. Edges are annotated with migration volume (number of people), nationality, sex, and year."""
+title = "Austrian internal migrations (2002-2021)"
+description = """A network of migrations between municipalities in Austria, from 2002 to 2021. Nodes are municipalities (with their boundaries as of 2022), and a directed edge from municipality $i$ to municipality $j$ represents the migrations (changes of residence) from $i$ to $j$ in a given year by people of a given nationality (Austrian or foreign) and sex, so that a pair of municipalities can be connected by several parallel edges; migrations within the same municipality appear as self-loops. Edges are annotated with the number of migrations (`count`), nationality, sex, and year."""
tags = ['Social', 'Economic', 'Travel', 'Weighted', 'Political', 'Timestamps', 'Metadata']
url = 'https://data.statistik.gv.at/web/meta.jsp?dataset=OGDEXT_BINNENWAND_1'
citation = [('"Internal migration within Austria acc.to communes since 2002 (status of 2022)", Statistik Austria', 'https://data.statistik.gv.at')]
[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/at_migrations/__init__.py b/entries/at_migrations/__init__.py
index 0a8ccee..8435fe7 100644
--- a/entries/at_migrations/__init__.py
+++ b/entries/at_migrations/__init__.py
@@ -26,7 +26,8 @@ tags = ['Social', 'Economic', 'Travel', 'Weighted', 'Political', 'Timestamps', '
url = 'https://data.statistik.gv.at/web/meta.jsp?dataset=OGDEXT_BINNENWAND_1'
citation = [('"Internal migration within Austria acc.to communes since 2002 (status of 2022)", Statistik Austria', 'https://data.statistik.gv.at')]
icon_hash = None
-ustream_license = "Creative Commons Attribution 4.0 International (CC BY 4.0)"
+upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
+ "https://creativecommons.org/licenses/by/4.0/")
upstream_prefix = 'https://data.statistik.gv.at/data'
files = [(('OGDEXT_BINNENWAND_1.zip:BiWa_Aggregatfile_2002-2021.csv',
'OGDEXT_BINNENWAND_1_C-GRGEMAKT-0.csv',
[entries] Fix the spelling of the "Political" and "Food web" tags 35244f5
at_migrations used "Politlcal", and messal_shale "Food Web". Fixes #12
diff --git a/entries/at_migrations/__init__.py b/entries/at_migrations/__init__.py
index cd501a0..0a8ccee 100644
--- a/entries/at_migrations/__init__.py
+++ b/entries/at_migrations/__init__.py
@@ -22,7 +22,7 @@ import io
title = "Austrian internal migrations (2002-2022)"
description = """A network of migrations between municipalities in Austria, from 2002 to 2022. A weighted directed link from source to target indicates a migration flow from these two municipalities. Edges are annotated with migration volume (number of people), nationality, sex, and year."""
-tags = ['Social', 'Economic', 'Travel', 'Weighted', 'Politlcal', 'Timestamps', 'Metadata']
+tags = ['Social', 'Economic', 'Travel', 'Weighted', 'Political', 'Timestamps', 'Metadata']
url = 'https://data.statistik.gv.at/web/meta.jsp?dataset=OGDEXT_BINNENWAND_1'
citation = [('"Internal migration within Austria acc.to communes since 2002 (status of 2022)", Statistik Austria', 'https://data.statistik.gv.at')]
icon_hash = None
Update copyright information 73a4f0d
diff --git a/entries/at_migrations/__init__.py b/entries/at_migrations/__init__.py
index 0d4d163..cd501a0 100644
--- a/entries/at_migrations/__init__.py
+++ b/entries/at_migrations/__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 3d288ea
diff --git a/entries/at_migrations/__init__.py b/entries/at_migrations/__init__.py
index db431db..0d4d163 100644
--- a/entries/at_migrations/__init__.py
+++ b/entries/at_migrations/__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
Add entry 'at_migrations' 67fe0df
diff --git a/entries/at_migrations/__init__.py b/entries/at_migrations/__init__.py
new file mode 100644
index 0000000..db431db
--- /dev/null
+++ b/entries/at_migrations/__init__.py
@@ -0,0 +1,95 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# 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
+# 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 *
+import csv
+import io
+
+title = "Austrian internal migrations (2002-2022)"
+description = """A network of migrations between municipalities in Austria, from 2002 to 2022. A weighted directed link from source to target indicates a migration flow from these two municipalities. Edges are annotated with migration volume (number of people), nationality, sex, and year."""
+tags = ['Social', 'Economic', 'Travel', 'Weighted', 'Politlcal', 'Timestamps', 'Metadata']
+url = 'https://data.statistik.gv.at/web/meta.jsp?dataset=OGDEXT_BINNENWAND_1'
+citation = [('"Internal migration within Austria acc.to communes since 2002 (status of 2022)", Statistik Austria', 'https://data.statistik.gv.at')]
+icon_hash = None
+ustream_license = "Creative Commons Attribution 4.0 International (CC BY 4.0)"
+upstream_prefix = 'https://data.statistik.gv.at/data'
+files = [(('OGDEXT_BINNENWAND_1.zip:BiWa_Aggregatfile_2002-2021.csv',
+ 'OGDEXT_BINNENWAND_1_C-GRGEMAKT-0.csv',
+ 'OGDEXT_BINNENWAND_1_C-WGRGEMAKT-0.csv',
+ 'OGDEXT_BINNENWAND_1_C-STAATEN_DICHOTOM-0.csv',
+ 'OGDEXT_BINNENWAND_1_C-C11-0.csv',
+ 'OGDEXT_BINNENWAND_1_C-A10-0.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 ExitStack() as stack:
+ rfs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+ fs = [io.StringIO(f.read()) for f in rfs]
+ g = Graph()
+ g.ep.count = count = g.new_ep("int")
+ g.ep.year = year = g.new_ep("int")
+ g.ep.sex = sex = g.new_ep("string")
+ g.ep.nationality = nationality = g.new_ep("string")
+ g.vp.name = name = g.new_vp("string")
+ g.vp.code = code = g.new_vp("string")
+
+ def get_lines(f, header=True):
+ f.seek(0)
+ reader = csv.reader(f, delimiter=";", quotechar='"')
+ if header:
+ next(reader)
+ for row in reader:
+ yield row
+
+ snames = { r[0]:r[1] for r in get_lines(fs[1], True) }
+ scodes = { r[0]:r[2] for r in get_lines(fs[1], True) }
+ tnames = { r[0]:r[1] for r in get_lines(fs[2], True) }
+ tcodes = { r[0]:r[2] for r in get_lines(fs[2], True) }
+
+ ncodes = { r[0]:r[3] for r in get_lines(fs[3], True) }
+ gcodes = { r[0]:r[3] for r in get_lines(fs[4], True) }
+ ycodes = { r[0]:r[1] for r in get_lines(fs[5], True) }
+
+ def reorder(rows):
+ for row in rows:
+ yield [row[1], row[2], int(ycodes[row[0]])] + row[3:]
+
+ names = g.add_edge_list(reorder(get_lines(fs[0], False)),
+ hashed=True,
+ eprops=[year, nationality, sex, count])
+
+ for v in g.vertices():
+ name[v] = snames[names[v]]
+ code[v] = scodes[names[v]]
+
+ for e in g.edges():
+ sex[e] = gcodes[sex[e]]
+ nationality[e] = ncodes[nationality[e]]
+
+ yield alt, g