logo Netzschleuder network catalog, repository, and centrifuge

History of russian_trade

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/russian_trade/__init__.py b/entries/russian_trade/__init__.py
index 0b57343..261feb7 100644
--- a/entries/russian_trade/__init__.py
+++ b/entries/russian_trade/__init__.py
@@ -64,6 +64,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/russian_trade/__init__.py b/entries/russian_trade/__init__.py
index e952950..0b57343 100644
--- a/entries/russian_trade/__init__.py
+++ b/entries/russian_trade/__init__.py
@@ -28,7 +28,7 @@ The network has the following properties:
 tags = ['Economic', 'Trade', 'Unweighted', 'Spatial']
 url = 'https://aaronclauset.github.io/data/russiantrade.zip'
 citation = [('F. R. Pitts, "The medieval river trade network of Russia revisited." Social Networks 1(3), 285-292 (1978)', 'https://doi.org/10.1016/0378-8733(78)90025-4')]
-icon_hash = '56a85c8e26855e083a2f789c'
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://aaronclauset.github.io/data'
 files = [('russiantrade.zip:russiantrade/russiantrade_edges.txt', None, None)]
[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/russian_trade/__init__.py b/entries/russian_trade/__init__.py
index 99bfed8..e952950 100644
--- a/entries/russian_trade/__init__.py
+++ b/entries/russian_trade/__init__.py
@@ -24,7 +24,7 @@ description = """The network of river trade routes among 39 towns of medieval Ru
 
 The network has the following properties:
 
-- Nodes: `name`, the name of the town. The data file only gives node numbers; the names were assigned from Table 1 of Pitts (1978), assuming the nodes are numbered in the order of that table (the shortest-path distances computed from the network agree closely with the ones listed there). Three unnamed places are labeled "A", "B" and "C" as in the original table."""
+- (Node) `name`: the name of the town. The data file only gives node numbers; the names were assigned from Table 1 of Pitts (1978), assuming the nodes are numbered in the order of that table (the shortest-path distances computed from the network agree closely with the ones listed there). Three unnamed places are labeled "A", "B" and "C" as in the original table."""
 tags = ['Economic', 'Trade', 'Unweighted', 'Spatial']
 url = 'https://aaronclauset.github.io/data/russiantrade.zip'
 citation = [('F. R. Pitts, "The medieval river trade network of Russia revisited." Social Networks 1(3), 285-292 (1978)', 'https://doi.org/10.1016/0378-8733(78)90025-4')]
[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/russian_trade/__init__.py b/entries/russian_trade/__init__.py
index 610f127..99bfed8 100644
--- a/entries/russian_trade/__init__.py
+++ b/entries/russian_trade/__init__.py
@@ -50,7 +50,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] Use American spelling in the descriptions by Tiago de Paula Peixoto 802d564
British spellings in the titles and descriptions of 69 entries (e.g.
labelled, organisation, millimetres, centres, anonymised, neighbours,
analysed, modelled, colour, licence) are replaced by the American ones.
Proper names keep their spelling (Otago Harbour, the Centre for Water
Systems, the Centre jeunesse de Montréal, the Dutch Ministry of Defence),
as do quoted upstream terms, citations, and property names.
diff --git a/entries/russian_trade/__init__.py b/entries/russian_trade/__init__.py
index 8f012d2..610f127 100644
--- a/entries/russian_trade/__init__.py
+++ b/entries/russian_trade/__init__.py
@@ -20,7 +20,7 @@
 from .. import *
 
 title = "Medieval Russian river trade network (1978)"
-description = """The network of river trade routes among 39 towns of medieval Russia (12th-13th centuries), as reconstructed by the geographer F. R. Pitts to study the growth of Moscow. Towns are connected if they were adjacent along the network of navigable rivers (and portages), which were travelled by boat in summer and by sled over the ice in winter, and which supported trade (e.g. of slaves, amber, honey and furs) and other social exchanges. The data were distributed by A. Clauset, together with the article by Pitts (1978).
+description = """The network of river trade routes among 39 towns of medieval Russia (12th-13th centuries), as reconstructed by the geographer F. R. Pitts to study the growth of Moscow. Towns are connected if they were adjacent along the network of navigable rivers (and portages), which were traveled by boat in summer and by sled over the ice in winter, and which supported trade (e.g. of slaves, amber, honey and furs) and other social exchanges. The data were distributed by A. Clauset, together with the article by Pitts (1978).
 
 The network has the following properties:
 
[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/russian_trade/__init__.py b/entries/russian_trade/__init__.py
index 1d12228..8f012d2 100644
--- a/entries/russian_trade/__init__.py
+++ b/entries/russian_trade/__init__.py
@@ -62,3 +62,9 @@ def parse(alts=None):
         g.add_edge_list(edges)
         g.vp.name = g.new_vp("string", vals=names)
         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: russian_trade by Tiago de Paula Peixoto 8f0b1ce
diff --git a/entries/russian_trade/__init__.py b/entries/russian_trade/__init__.py
new file mode 100644
index 0000000..1d12228
--- /dev/null
+++ b/entries/russian_trade/__init__.py
@@ -0,0 +1,64 @@
+#! /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 = "Medieval Russian river trade network (1978)"
+description = """The network of river trade routes among 39 towns of medieval Russia (12th-13th centuries), as reconstructed by the geographer F. R. Pitts to study the growth of Moscow. Towns are connected if they were adjacent along the network of navigable rivers (and portages), which were travelled by boat in summer and by sled over the ice in winter, and which supported trade (e.g. of slaves, amber, honey and furs) and other social exchanges. The data were distributed by A. Clauset, together with the article by Pitts (1978).
+
+The network has the following properties:
+
+- Nodes: `name`, the name of the town. The data file only gives node numbers; the names were assigned from Table 1 of Pitts (1978), assuming the nodes are numbered in the order of that table (the shortest-path distances computed from the network agree closely with the ones listed there). Three unnamed places are labeled "A", "B" and "C" as in the original table."""
+tags = ['Economic', 'Trade', 'Unweighted', 'Spatial']
+url = 'https://aaronclauset.github.io/data/russiantrade.zip'
+citation = [('F. R. Pitts, "The medieval river trade network of Russia revisited." Social Networks 1(3), 285-292 (1978)', 'https://doi.org/10.1016/0378-8733(78)90025-4')]
+icon_hash = '56a85c8e26855e083a2f789c'
+upstream_license = None
+upstream_prefix = 'https://aaronclauset.github.io/data'
+files = [('russiantrade.zip:russiantrade/russiantrade_edges.txt', None, None)]
+
+# Place names in the order of Table 1 of Pitts (1978)
+names = ["Novgorod", "Vitebsk", "Smolensk", "Kiev", "Chernikov",
+         "Novgorod Severskiy", "Kursk", "Bryansk", "Karachev", "Kozelsk",
+         "Dorogobusch", "Vyazma", "A", "Tver", "Vishniy Volochek", "Ksyatyn",
+         "Uglich", "Yaroslavl'", "Rostov", "B", "C", "Suzdal", "Vladimir",
+         "Nizhniy Novgorod", "Bolgar (Kazan)", "Isad'-Ryazan", "Pronsk",
+         "Dubok", "Elets", "Mtsensk", "Tula", "Dedoslavl'", "Pereslavl'",
+         "Kolomna", "Moscow", "Mozhaysk", "Dmitrov", "Volok Lamskiy", "Murom"]
+
+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, "r") as f:
+            edges = numpy.loadtxt(f, dtype="int") - 1
+        g = Graph(directed=False)
+        g.add_vertex(len(names))
+        g.add_edge_list(edges)
+        g.vp.name = g.new_vp("string", vals=names)
+        yield alt, g