logo Netzschleuder network catalog, repository, and centrifuge

History of chilean_power_grid

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/chilean_power_grid/__init__.py b/entries/chilean_power_grid/__init__.py
index 7fe5d9e..73b89ac 100644
--- a/entries/chilean_power_grid/__init__.py
+++ b/entries/chilean_power_grid/__init__.py
@@ -129,6 +129,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/chilean_power_grid/__init__.py b/entries/chilean_power_grid/__init__.py
index d9f9478..7fe5d9e 100644
--- a/entries/chilean_power_grid/__init__.py
+++ b/entries/chilean_power_grid/__init__.py
@@ -46,7 +46,7 @@ tags = ['Technological', 'Power grid', 'Weighted', 'Spatial', 'Metadata', 'Times
 url = 'https://doi.org/10.6084/m9.figshare.c.4053374.v1'
 citation = [('H. Kim, D. Olave-Rojas, E. Álvarez-Miranda, S.-W. Son, "In-depth data on the network structure and hourly activity of the Central Chilean power grid." Scientific Data 5, 180209 (2018)', 'https://doi.org/10.1038/sdata.2018.209'),
             ('H. Kim, D. Olave-Rojas, E. Álvarez-Miranda, S.-W. Son, "An in-depth network structural data and hourly activity on the Central Chilean power grid." figshare, collection (2018)', 'https://doi.org/10.6084/m9.figshare.c.4053374.v1')]
-icon_hash = '5bd33413197c3f8a0272c87a'
+date_added = '2026-10-25'
 upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
                     "https://creativecommons.org/licenses/by/4.0/")
 upstream_prefix = 'https://ndownloader.figshare.com/files'
[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/chilean_power_grid/__init__.py b/entries/chilean_power_grid/__init__.py
index 7018ab3..d9f9478 100644
--- a/entries/chilean_power_grid/__init__.py
+++ b/entries/chilean_power_grid/__init__.py
@@ -32,8 +32,16 @@ The activity of a node is its net power generation (MWh, per hour) during one ye
 
 The networks have the following properties:
 
-- Nodes: `name`, the name of the facility; `owner`, the company that owns it; `role`, the kind of node (`Plant`, `Substation`, `Tap node`, or `Switch` and `Tap-ed`, which are both junctions); `latitude` and `longitude`, the geographical position; `ref` (`with_tap` and `without_tap` only), an undocumented flag of the source files (`original`, `converted` or `corrected`; mostly `converted` for junctions and tap nodes); `activity`, the hourly series of original activity (MWh) (`with_tap` and `reduced` only); `activity_kirchhoff`, the hourly series of Kirchhoff-adjusted activity (MWh) (`with_tap` and `without_tap` only).
-- Edges: `distance`, the length of the transmission line (km); `voltage`, the voltage of the line (kV); `lines`, a column of the source files not described in the documentation, presumably the number of circuits."""
+- (Node) `name`: the name of the facility.
+- (Node) `owner`: the company that owns it.
+- (Node) `role`: the kind of node (`Plant`, `Substation`, `Tap node`, or `Switch` and `Tap-ed`, which are both junctions).
+- (Node) `latitude` and `longitude`: the geographical position.
+- (Node) `ref` (`with_tap` and `without_tap` only): an undocumented flag of the source files (`original`, `converted` or `corrected`; mostly `converted` for junctions and tap nodes).
+- (Node) `activity`: the hourly series of original activity (MWh) (`with_tap` and `reduced` only).
+- (Node) `activity_kirchhoff`: the hourly series of Kirchhoff-adjusted activity (MWh) (`with_tap` and `without_tap` only).
+- (Edge) `distance`: the length of the transmission line (km).
+- (Edge) `voltage`: the voltage of the line (kV).
+- (Edge) `lines`: a column of the source files not described in the documentation, presumably the number of circuits."""
 tags = ['Technological', 'Power grid', 'Weighted', 'Spatial', 'Metadata', 'Timestamps']
 url = 'https://doi.org/10.6084/m9.figshare.c.4053374.v1'
 citation = [('H. Kim, D. Olave-Rojas, E. Álvarez-Miranda, S.-W. Son, "In-depth data on the network structure and hourly activity of the Central Chilean power grid." Scientific Data 5, 180209 (2018)', 'https://doi.org/10.1038/sdata.2018.209'),
[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/chilean_power_grid/__init__.py b/entries/chilean_power_grid/__init__.py
index 0afe14d..7018ab3 100644
--- a/entries/chilean_power_grid/__init__.py
+++ b/entries/chilean_power_grid/__init__.py
@@ -84,7 +84,6 @@ def read_activity(f, nodes):
 @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/chilean_power_grid/__init__.py b/entries/chilean_power_grid/__init__.py
index 87c3ce8..0afe14d 100644
--- a/entries/chilean_power_grid/__init__.py
+++ b/entries/chilean_power_grid/__init__.py
@@ -20,13 +20,13 @@
 from .. import *
 
 title = "Central Chilean power grid (2016)"
-description = """Networks of the Central Chilean power grid (the Sistema Interconectado Central, SIC), with the hourly power generation and consumption of its nodes, compiled by H. Kim, D. Olave-Rojas, E. Álvarez-Miranda and S.-W. Son. The data were assembled from three sources published by the grid operator (CDEC-SIC, now the Coordinador Eléctrico Nacional): the geographical coordinates of the facilities, the single line diagram of the grid, and the operation records. The sources were harmonized and cleaned (with manual corrections of mismatched or missing coordinates and duplicate names), keeping only the facilities present in all sources, and adding edges between the neighbours of removed facilities to keep the grid connected.
+description = """Networks of the Central Chilean power grid (the Sistema Interconectado Central, SIC), with the hourly power generation and consumption of its nodes, compiled by H. Kim, D. Olave-Rojas, E. Álvarez-Miranda and S.-W. Son. The data were assembled from three sources published by the grid operator (CDEC-SIC, now the Coordinador Eléctrico Nacional): the geographical coordinates of the facilities, the single line diagram of the grid, and the operation records. The sources were harmonized and cleaned (with manual corrections of mismatched or missing coordinates and duplicate names), keeping only the facilities present in all sources, and adding edges between the neighbors of removed facilities to keep the grid connected.
 
 A node is a power plant, a substation, a junction (a branching point of transmission lines), or a tap node (where a facility connects to the middle of a transmission line through a short extension line), and an edge is a transmission line. Three versions of the network are provided:
 
 - `with_tap`: the most detailed version, keeping the tap connections, with 124 plants, 94 substations, 85 junctions and 44 tap nodes.
 - `without_tap`: the tap nodes are removed (except where they are branching points, in which case they are kept as junctions), with 124 plants, 94 substations and 100 junctions.
-- `reduced`: only the 124 plants and 94 substations, with the junctions removed via star-mesh transformations, which connect all the neighbours of each removed node, preserving the electrical relations between the remaining nodes.
+- `reduced`: only the 124 plants and 94 substations, with the junctions removed via star-mesh transformations, which connect all the neighbors of each removed node, preserving the electrical relations between the remaining nodes.
 
 The activity of a node is its net power generation (MWh, per hour) during one year, from 16 September 2015 to 15 September 2016 (8,784 hours), which is non-negative for plants and non-positive for substations. Facilities without activity records (e.g. due to maintenance) have zero activity, as do junctions and tap nodes. In the original data, the total generation (47,005 GWh) exceeds the total consumption (43,829 GWh) by the reserve capacity. In the Kirchhoff-adjusted version, the generation of the plants is scaled so that the net activity of all nodes is zero.
 
[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/chilean_power_grid/__init__.py b/entries/chilean_power_grid/__init__.py
index 67dc373..87c3ce8 100644
--- a/entries/chilean_power_grid/__init__.py
+++ b/entries/chilean_power_grid/__init__.py
@@ -119,3 +119,9 @@ def parse(alts=None):
                           int(r["Lines"])) for r in edges],
                         eprops=[g.ep.distance, g.ep.voltage, g.ep.lines])
         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: chilean_power_grid by Tiago de Paula Peixoto 80754a7
diff --git a/entries/chilean_power_grid/__init__.py b/entries/chilean_power_grid/__init__.py
new file mode 100644
index 0000000..67dc373
--- /dev/null
+++ b/entries/chilean_power_grid/__init__.py
@@ -0,0 +1,121 @@
+#! /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 = "Central Chilean power grid (2016)"
+description = """Networks of the Central Chilean power grid (the Sistema Interconectado Central, SIC), with the hourly power generation and consumption of its nodes, compiled by H. Kim, D. Olave-Rojas, E. Álvarez-Miranda and S.-W. Son. The data were assembled from three sources published by the grid operator (CDEC-SIC, now the Coordinador Eléctrico Nacional): the geographical coordinates of the facilities, the single line diagram of the grid, and the operation records. The sources were harmonized and cleaned (with manual corrections of mismatched or missing coordinates and duplicate names), keeping only the facilities present in all sources, and adding edges between the neighbours of removed facilities to keep the grid connected.
+
+A node is a power plant, a substation, a junction (a branching point of transmission lines), or a tap node (where a facility connects to the middle of a transmission line through a short extension line), and an edge is a transmission line. Three versions of the network are provided:
+
+- `with_tap`: the most detailed version, keeping the tap connections, with 124 plants, 94 substations, 85 junctions and 44 tap nodes.
+- `without_tap`: the tap nodes are removed (except where they are branching points, in which case they are kept as junctions), with 124 plants, 94 substations and 100 junctions.
+- `reduced`: only the 124 plants and 94 substations, with the junctions removed via star-mesh transformations, which connect all the neighbours of each removed node, preserving the electrical relations between the remaining nodes.
+
+The activity of a node is its net power generation (MWh, per hour) during one year, from 16 September 2015 to 15 September 2016 (8,784 hours), which is non-negative for plants and non-positive for substations. Facilities without activity records (e.g. due to maintenance) have zero activity, as do junctions and tap nodes. In the original data, the total generation (47,005 GWh) exceeds the total consumption (43,829 GWh) by the reserve capacity. In the Kirchhoff-adjusted version, the generation of the plants is scaled so that the net activity of all nodes is zero.
+
+The networks have the following properties:
+
+- Nodes: `name`, the name of the facility; `owner`, the company that owns it; `role`, the kind of node (`Plant`, `Substation`, `Tap node`, or `Switch` and `Tap-ed`, which are both junctions); `latitude` and `longitude`, the geographical position; `ref` (`with_tap` and `without_tap` only), an undocumented flag of the source files (`original`, `converted` or `corrected`; mostly `converted` for junctions and tap nodes); `activity`, the hourly series of original activity (MWh) (`with_tap` and `reduced` only); `activity_kirchhoff`, the hourly series of Kirchhoff-adjusted activity (MWh) (`with_tap` and `without_tap` only).
+- Edges: `distance`, the length of the transmission line (km); `voltage`, the voltage of the line (kV); `lines`, a column of the source files not described in the documentation, presumably the number of circuits."""
+tags = ['Technological', 'Power grid', 'Weighted', 'Spatial', 'Metadata', 'Timestamps']
+url = 'https://doi.org/10.6084/m9.figshare.c.4053374.v1'
+citation = [('H. Kim, D. Olave-Rojas, E. Álvarez-Miranda, S.-W. Son, "In-depth data on the network structure and hourly activity of the Central Chilean power grid." Scientific Data 5, 180209 (2018)', 'https://doi.org/10.1038/sdata.2018.209'),
+            ('H. Kim, D. Olave-Rojas, E. Álvarez-Miranda, S.-W. Son, "An in-depth network structural data and hourly activity on the Central Chilean power grid." figshare, collection (2018)', 'https://doi.org/10.6084/m9.figshare.c.4053374.v1')]
+icon_hash = '5bd33413197c3f8a0272c87a'
+upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
+                    "https://creativecommons.org/licenses/by/4.0/")
+upstream_prefix = 'https://ndownloader.figshare.com/files'
+# Files (by figshare file id): nodes, edges, original activity, and
+# Kirchhoff-adjusted activity (None if not available)
+files = [(('10920518', '10920515', '10920512', '10920509'), 'with_tap', None),
+         (('10920506', '10920503', None, '10920497'), 'without_tap', None),
+         (('10920494', '10920491', '10920488', None), 'reduced', None)]
+
+def fetch_upstream(force=False):
+    fs = [(tuple(f for f in fnames if f is not None), alt, fmt)
+          for fnames, alt, fmt in files]
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, fs,
+                                force)
+
+def read_activity(f, nodes):
+    """Read an activity file, with one column per node, and four header rows
+    (role, index, label and owner). The columns are not in the order of the
+    node files, and are matched to the plants and substations by role, label
+    and owner; the other columns (junctions and taps) are all zero."""
+    rows = csv.reader(f)
+    roles = next(rows)[1:]
+    next(rows)
+    labels = next(rows)[1:]
+    owners = next(rows)[1:]
+    idx = {(r["Role"], r["Label"], r["Owner"]): i for i, r in enumerate(nodes)
+           if r["Role"] in ["Plant", "Substation"]}
+    cols = [j for j, r in enumerate(roles) if r in ["Plant", "Substation"]]
+    vs = [idx[(roles[j], labels[j], owners[j])] for j in cols]
+    if len(set(vs)) != len(idx):
+        raise ValueError("activity columns do not match the nodes")
+    A = numpy.array([[float(x) for x in row[1:]] for row in rows if row])
+    if A.shape[0] != 8784:
+        raise ValueError("unexpected number of time steps")
+    other = [j for j in range(len(roles)) if j not in set(cols)]
+    if numpy.any(A[:, other] != 0):
+        raise ValueError("nonzero activity for junctions or taps")
+    X = numpy.zeros((len(nodes), A.shape[0]))
+    X[vs, :] = A[:, cols].T
+    return X
+
+@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
+        fnode, fedge, fact, fkirch = fnames
+        with open_upstream_file(name, fnode, "r") as f:
+            nodes = list(csv.DictReader(f))
+        with open_upstream_file(name, fedge, "r") as f:
+            edges = list(csv.DictReader(f))
+        idx = {r["Id"]: i for i, r in enumerate(nodes)}
+        g = Graph(directed=False)
+        g.add_vertex(len(nodes))
+        g.vp.name = g.new_vp("string", vals=[r["Label"] for r in nodes])
+        g.vp.owner = g.new_vp("string", vals=[r["Owner"] for r in nodes])
+        g.vp.role = g.new_vp("string", vals=[r["Role"] for r in nodes])
+        g.vp.latitude = g.new_vp("double", vals=[float(r["Latitude"]) for r in nodes])
+        g.vp.longitude = g.new_vp("double", vals=[float(r["Longitude"]) for r in nodes])
+        if "ref" in nodes[0]:
+            g.vp.ref = g.new_vp("string", vals=[r["ref"] for r in nodes])
+        for fn, pname in [(fact, "activity"), (fkirch, "activity_kirchhoff")]:
+            if fn is None:
+                continue
+            with open_upstream_file(name, fn, "r") as f:
+                X = read_activity(f, nodes)
+            g.vp[pname] = g.new_vp("vector<double>")
+            g.vp[pname].set_2d_array(X.T)
+        g.ep.distance = g.new_ep("double")
+        g.ep.voltage = g.new_ep("double")
+        g.ep.lines = g.new_ep("int")
+        g.add_edge_list([(idx[r["Source"]], idx[r["Target"]],
+                          float(r["Distance"]), float(r["Voltage"]),
+                          int(r["Lines"])) for r in edges],
+                        eprops=[g.ep.distance, g.ep.voltage, g.ep.lines])
+        yield alt, g