logo Netzschleuder network catalog, repository, and centrifuge

History of urban_streets

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/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 13013c2..aaf34cd 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__init__.py
@@ -74,6 +74,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/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 66c9183..13013c2 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__init__.py
@@ -31,7 +31,7 @@ tags = ['Transportation', 'Roads', 'Unweighted', 'Metadata']
 url = 'https://www.complex-networks.net/datasets.html#chap8'
 citation = [('P. Crucitti, V. Latora, and S. Porta. "Centrality measures in spatial networks of urban streets". Phys. Rev. E 73 (2006), 036125', 'https://doi.org/10.1103/PhysRevE.73.036125'),
             ('V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles, Methods and Applications", Cambridge University Press (2017)', "https://doi.org/10.1017/9781316216002") ]
-icon_hash = None
+date_added = '2021-12-25'
 upstream_license = None
 upstream_prefix = 'https://www.complex-networks.net/datasets/'
 
[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/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 17a0207..66c9183 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__init__.py
@@ -25,8 +25,8 @@ The cities are Ahmedabad, Barcelona, Bologna, Brasilia, Cairo, Irvine (two sampl
 
 The networks have the following properties:
 
-- `pos`: the coordinates $(x, y)$ of the intersection in the map.
-- `length`: the length of the street segment, in meters."""
+- (Node) `pos`: the coordinates $(x, y)$ of the intersection in the map.
+- (Edge) `length`: the length of the street segment, in meters."""
 tags = ['Transportation', 'Roads', 'Unweighted', 'Metadata']
 url = 'https://www.complex-networks.net/datasets.html#chap8'
 citation = [('P. Crucitti, V. Latora, and S. Porta. "Centrality measures in spatial networks of urban streets". Phys. Rev. E 73 (2006), 036125', 'https://doi.org/10.1103/PhysRevE.73.036125'),
[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/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 6dd4537..17a0207 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__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] 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/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index f8f5583..6dd4537 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__init__.py
@@ -72,3 +72,9 @@ def parse(alts=None):
                 g.vp.pos[int(node_1)] = [X_1, Y_1]
                 g.vp.pos[int(node_2)] = [X_2, Y_2]
         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] Fix parse bugs and improve the metadata of existing entries by Tiago de Paula Peixoto 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/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 8e36ceb..f8f5583 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__init__.py
@@ -19,14 +19,20 @@
 from .. import *
 
 title = "Urban street networks (2017)"
-description = """20 urban street networks, corresponding to 1-square-mile maps of 20 cities around the world.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = """Street networks of 1-square-mile samples of 20 cities around the world, constructed by P. Crucitti, V. Latora and S. Porta from maps, and distributed as part of the material of the book "Complex Networks: Principles, Methods and Applications" by V. Latora, V. Nicosia and G. Russo. Nodes are street intersections (and dead ends), and an undirected edge is a street segment between two intersections (the "primal" representation of the street network).
+
+The cities are Ahmedabad, Barcelona, Bologna, Brasilia, Cairo, Irvine (two samples, `irvine1` and `irvine2`), London, Los Angeles, New Delhi, New York, Paris, Richmond, San Francisco, Savannah, Seoul, Venice, Vienna, Walnut Creek and Washington.
+
+The networks have the following properties:
+
+- `pos`: the coordinates $(x, y)$ of the intersection in the map.
+- `length`: the length of the street segment, in meters."""
 tags = ['Transportation', 'Roads', 'Unweighted', 'Metadata']
 url = 'https://www.complex-networks.net/datasets.html#chap8'
 citation = [('P. Crucitti, V. Latora, and S. Porta. "Centrality measures in spatial networks of urban streets". Phys. Rev. E 73 (2006), 036125', 'https://doi.org/10.1103/PhysRevE.73.036125'),
             ('V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles, Methods and Applications", Cambridge University Press (2017)', "https://doi.org/10.1017/9781316216002") ]
 icon_hash = None
-ustream_license = None
+upstream_license = None
 upstream_prefix = 'https://www.complex-networks.net/datasets/'
 
 cities = ['ahmedabad', 'barcelona', 'bologna', 'brasilia', 'cairo', 'irvine1',
Update copyright information by Tiago de Paula Peixoto 73a4f0d
diff --git a/entries/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 62265b9..8e36ceb 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__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 by Tiago de Paula Peixoto 3d288ea
diff --git a/entries/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 9fa3422..62265b9 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__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
Update copyright information by Tiago de Paula Peixoto 8d005ae
diff --git a/entries/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index 67a4e5f..9fa3422 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# 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
Fix description string quotes by Tiago de Paula Peixoto 3fc2e4d
diff --git a/entries/urban_streets/__init__.py b/entries/urban_streets/__init__.py
index e9575f3..67a4e5f 100644
--- a/entries/urban_streets/__init__.py
+++ b/entries/urban_streets/__init__.py
@@ -19,7 +19,7 @@
 from .. import *
 
 title = "Urban street networks (2017)"
-description = """""20 urban street networks, corresponding to 1-square-mile maps of 20 cities around the world.""[^icon]
+description = """20 urban street networks, corresponding to 1-square-mile maps of 20 cities around the world.[^icon]
 [^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Transportation', 'Roads', 'Unweighted', 'Metadata']
 url = 'https://www.complex-networks.net/datasets.html#chap8'
Add entry 'urban_streets' by Tiago de Paula Peixoto f0a6419
diff --git a/entries/urban_streets/__init__.py b/entries/urban_streets/__init__.py
new file mode 100644
index 0000000..e9575f3
--- /dev/null
+++ b/entries/urban_streets/__init__.py
@@ -0,0 +1,68 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2021 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 = "Urban street networks (2017)"
+description = """""20 urban street networks, corresponding to 1-square-mile maps of 20 cities around the world.""[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+tags = ['Transportation', 'Roads', 'Unweighted', 'Metadata']
+url = 'https://www.complex-networks.net/datasets.html#chap8'
+citation = [('P. Crucitti, V. Latora, and S. Porta. "Centrality measures in spatial networks of urban streets". Phys. Rev. E 73 (2006), 036125', 'https://doi.org/10.1103/PhysRevE.73.036125'),
+            ('V. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles, Methods and Applications", Cambridge University Press (2017)', "https://doi.org/10.1017/9781316216002") ]
+icon_hash = None
+ustream_license = None
+upstream_prefix = 'https://www.complex-networks.net/datasets/'
+
+cities = ['ahmedabad', 'barcelona', 'bologna', 'brasilia', 'cairo', 'irvine1',
+          'irvine2', 'london', 'los-angeles', 'new-delhi', 'new-york', 'paris',
+          'richmond', 'san-francisco', 'savannah', 'seoul', 'venice', 'vienna',
+          'walnut-creek', 'washington']
+
+files = [(f'cities.zip:cities/{city}_edge_info.txt', city, None) for city in cities]
+
+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
+        if isinstance(fnames, str):
+            fnames = [fnames]
+        with ExitStack() as stack:
+            fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+            g = Graph(directed=False)
+            g.vp.pos = g.new_vp("vector<double>")
+            g.ep.length = g.new_ep("double")
+            for line in fs[0]:
+                vals = [float(x) for x in line.split()]
+                edge_num, node_1, X_1, Y_1, node_2, X_2, Y_2, length = vals
+                if g.num_vertices() <= max(node_1, node_2):
+                    g.add_vertex(int(max(node_1, node_2)) - g.num_vertices() + 1)
+                e = g.add_edge(int(node_1), int(node_2))
+                g.ep.length[e] = length
+                g.vp.pos[int(node_1)] = [X_1, Y_1]
+                g.vp.pos[int(node_2)] = [X_2, Y_2]
+        yield alt, g