logo Netzschleuder network catalog, repository, and centrifuge

History of new_spain_roads

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] Lay out the spatial networks with hfd_layout() instead of cfd_layout() by Tiago de Paula Peixoto cc3bcb0
Changed: none
diff --git a/entries/new_spain_roads/__init__.py b/entries/new_spain_roads/__init__.py
index 0e34bcf..ac22702 100644
--- a/entries/new_spain_roads/__init__.py
+++ b/entries/new_spain_roads/__init__.py
@@ -58,6 +58,6 @@ def parse(alts=None):
 
 
 def get_pos(g, sbm_fit):
-    # Spatial network: laid out with the default parameters of cfd_layout(),
+    # Spatial network: laid out with the default parameters of hfd_layout(),
     # without the partition of the SBM fit
-    return cfd_layout(g)
+    return hfd_layout(g)
[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/new_spain_roads/__init__.py b/entries/new_spain_roads/__init__.py
index 905f1b8..0e34bcf 100644
--- a/entries/new_spain_roads/__init__.py
+++ b/entries/new_spain_roads/__init__.py
@@ -30,7 +30,7 @@ The network has the following properties:
 tags = ['Transportation', 'Roads', 'Weighted', 'Spatial']
 url = 'https://aaronclauset.github.io/datacode.htm'
 citation = [('Anonymous, "Plano del arzobispado de México" (18th century), Instituto Nacional de Antropología e Historia, Mexico', 'https://lugares.inah.gob.mx/museos-inah/museo/museo-piezas/8450-8450-10-54050-plano-del-arzobispado-de-m%C3%A9xico.html?lugar_id=475')]
-icon_hash = '5b2b9996eb70bccf32add869'
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://aaronclauset.github.io/data'
 files = [('NewSpain_18c_travelmap.zip:NewSpain_18c_travelmap/NewSpain_18c_travelmap.gml',
[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/new_spain_roads/__init__.py b/entries/new_spain_roads/__init__.py
index 19d6e20..905f1b8 100644
--- a/entries/new_spain_roads/__init__.py
+++ b/entries/new_spain_roads/__init__.py
@@ -26,7 +26,7 @@ An undirected edge connects two places joined by a path on the map.
 
 The network has the following properties:
 
-- Edges: `weight`, the travel distance between the two places, as written on the map (the unit is not given in the data)."""
+- (Edge) `weight`: the travel distance between the two places, as written on the map (the unit is not given in the data)."""
 tags = ['Transportation', 'Roads', 'Weighted', 'Spatial']
 url = 'https://aaronclauset.github.io/datacode.htm'
 citation = [('Anonymous, "Plano del arzobispado de México" (18th century), Instituto Nacional de Antropología e Historia, Mexico', 'https://lugares.inah.gob.mx/museos-inah/museo/museo-piezas/8450-8450-10-54050-plano-del-arzobispado-de-m%C3%A9xico.html?lugar_id=475')]
[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/new_spain_roads/__init__.py b/entries/new_spain_roads/__init__.py
index b96e97e..19d6e20 100644
--- a/entries/new_spain_roads/__init__.py
+++ b/entries/new_spain_roads/__init__.py
@@ -44,7 +44,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] Lay out spatial networks with cfd_layout() without the SBM partition by Tiago de Paula Peixoto 9db8d77
Road, power grid, public transport, water and river networks and physical
meshes override get_pos() with the default parameters of cfd_layout(),
without grouping by the partition of the SBM fit.
diff --git a/entries/new_spain_roads/__init__.py b/entries/new_spain_roads/__init__.py
index dcca2fd..b96e97e 100644
--- a/entries/new_spain_roads/__init__.py
+++ b/entries/new_spain_roads/__init__.py
@@ -56,3 +56,9 @@ def parse(alts=None):
         del g.gp["comment"]
         del g.gp["label"]
         yield alt, g
+
+
+def get_pos(g, sbm_fit):
+    # Spatial network: laid out with the default parameters of cfd_layout(),
+    # without the partition of the SBM fit
+    return cfd_layout(g)
[entries] New entry: new_spain_roads by Tiago de Paula Peixoto 7d45902
diff --git a/entries/new_spain_roads/__init__.py b/entries/new_spain_roads/__init__.py
new file mode 100644
index 0000000..dcca2fd
--- /dev/null
+++ b/entries/new_spain_roads/__init__.py
@@ -0,0 +1,58 @@
+#! /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 = "Travel routes in 18th century New Spain"
+description = """The network of travel routes among the parishes, temples and towns of the archbishopric of Mexico in 18th century New Spain, transcribed from the anonymous painted map "Plano del arzobispado de México", held by the Instituto Nacional de Antropología e Historia (INAH) in Mexico. The map shows the places connected by paths annotated with the travel distances between them. The map was brought to attention by S. B. Weingart, and the network was transcribed by C. Uhl in June 2018, and distributed by A. Clauset. According to the transcriber, some of the distances were difficult to decipher, so some values may be inaccurate. The place names are not included.
+
+An undirected edge connects two places joined by a path on the map.
+
+The network has the following properties:
+
+- Edges: `weight`, the travel distance between the two places, as written on the map (the unit is not given in the data)."""
+tags = ['Transportation', 'Roads', 'Weighted', 'Spatial']
+url = 'https://aaronclauset.github.io/datacode.htm'
+citation = [('Anonymous, "Plano del arzobispado de México" (18th century), Instituto Nacional de Antropología e Historia, Mexico', 'https://lugares.inah.gob.mx/museos-inah/museo/museo-piezas/8450-8450-10-54050-plano-del-arzobispado-de-m%C3%A9xico.html?lugar_id=475')]
+icon_hash = '5b2b9996eb70bccf32add869'
+upstream_license = None
+upstream_prefix = 'https://aaronclauset.github.io/data'
+files = [('NewSpain_18c_travelmap.zip:NewSpain_18c_travelmap/NewSpain_18c_travelmap.gml',
+          None, 'gml')]
+
+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, "rb") as f:
+            g = parse_graph([f], fmt, directed=False)
+        g.ep.weight = g.ep.weight.copy("int")
+        # the description of the file is used above
+        del g.gp["comment"]
+        del g.gp["label"]
+        yield alt, g