History of powerplant_bayesian
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] Add the date when each entry was added, and remove icon_hash 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/powerplant_bayesian/__init__.py b/entries/powerplant_bayesian/__init__.py
index a6cd147..e6b5eed 100644
--- a/entries/powerplant_bayesian/__init__.py
+++ b/entries/powerplant_bayesian/__init__.py
@@ -32,7 +32,7 @@ The nodes have the following properties:
tags = ['Informational', 'Unweighted', 'Metadata']
url = 'https://web.archive.org/web/20070626181030/http://bndg.cs.aau.dk/html/bayesian_networks.html'
citation = [('T. D. Nielsen, F. V. Jensen, "On-line alert systems for production plants: A conflict based approach." International Journal of Approximate Reasoning 45(2), 255-270 (2007)', 'https://doi.org/10.1016/j.ijar.2006.06.010')]
-icon_hash = '57d856c967351c5e0ccda0c9'
+date_added = '2026-10-25'
upstream_license = None
# The book's site (bndg.cs.aau.dk) is no longer reachable; the file is
# obtained from the Internet Archive.
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/powerplant_bayesian/__init__.py b/entries/powerplant_bayesian/__init__.py
index ef67bcc..a6cd147 100644
--- a/entries/powerplant_bayesian/__init__.py
+++ b/entries/powerplant_bayesian/__init__.py
@@ -25,8 +25,8 @@ description = """Bayesian network modelling the correlations among the sensors o
The nodes have the following properties:
-- `name`: the name of the variable, as in the source (e.g. "V26"; the variables are not described further).
-- `states`: the list of states of the variable (intervals of the sensor value, e.g. "(2.42-4.66]").[^icon]
+- (Node) `name`: the name of the variable, as in the source (e.g. "V26"; the variables are not described further).
+- (Node) `states`: the list of states of the variable (intervals of the sensor value, e.g. "(2.42-4.66]").[^icon]
[^icon]: Description obtained in part from the [ICON](https://icon.colorado.edu) project."""
tags = ['Informational', 'Unweighted', 'Metadata']
[entries] Remove unneeded code from the entries 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/powerplant_bayesian/__init__.py b/entries/powerplant_bayesian/__init__.py
index 9e2855a..ef67bcc 100644
--- a/entries/powerplant_bayesian/__init__.py
+++ b/entries/powerplant_bayesian/__init__.py
@@ -47,7 +47,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fname, alt, fmt in files:
if alts is not None and alt not in alts:
[entries] Use American spelling in the descriptions 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/powerplant_bayesian/__init__.py b/entries/powerplant_bayesian/__init__.py
index 27361d2..9e2855a 100644
--- a/entries/powerplant_bayesian/__init__.py
+++ b/entries/powerplant_bayesian/__init__.py
@@ -21,7 +21,7 @@ from .. import *
import re
title = "Power plant sensor Bayesian network (2007)"
-description = """Bayesian network modelling the correlations among the sensors of a coal-fired power plant, from T. D. Nielsen and F. V. Jensen, distributed with the book "Bayesian Networks and Decision Graphs" (F. V. Jensen and T. D. Nielsen) at Aalborg University. The network was used to design an on-line alert system that detects abnormal plant behaviour as conflicts between sensor readings and the model. Nodes are variables (sensor measurements, discretized into three intervals), and a directed edge from $i$ to $j$ means that variable $i$ is a parent of variable $j$ in the directed acyclic graph of the Bayesian network, i.e., that the conditional probability distribution of $j$ is specified given the value of $i$. The network has 46 sparsely connected nodes (six of which have no connections); the conditional probability tables are not included.
+description = """Bayesian network modelling the correlations among the sensors of a coal-fired power plant, from T. D. Nielsen and F. V. Jensen, distributed with the book "Bayesian Networks and Decision Graphs" (F. V. Jensen and T. D. Nielsen) at Aalborg University. The network was used to design an on-line alert system that detects abnormal plant behavior as conflicts between sensor readings and the model. Nodes are variables (sensor measurements, discretized into three intervals), and a directed edge from $i$ to $j$ means that variable $i$ is a parent of variable $j$ in the directed acyclic graph of the Bayesian network, i.e., that the conditional probability distribution of $j$ is specified given the value of $i$. The network has 46 sparsely connected nodes (six of which have no connections); the conditional probability tables are not included.
The nodes have the following properties:
[entries] New entry: powerplant_bayesian dfbaadf
diff --git a/entries/powerplant_bayesian/__init__.py b/entries/powerplant_bayesian/__init__.py
new file mode 100644
index 0000000..27361d2
--- /dev/null
+++ b/entries/powerplant_bayesian/__init__.py
@@ -0,0 +1,74 @@
+#! /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 *
+import re
+
+title = "Power plant sensor Bayesian network (2007)"
+description = """Bayesian network modelling the correlations among the sensors of a coal-fired power plant, from T. D. Nielsen and F. V. Jensen, distributed with the book "Bayesian Networks and Decision Graphs" (F. V. Jensen and T. D. Nielsen) at Aalborg University. The network was used to design an on-line alert system that detects abnormal plant behaviour as conflicts between sensor readings and the model. Nodes are variables (sensor measurements, discretized into three intervals), and a directed edge from $i$ to $j$ means that variable $i$ is a parent of variable $j$ in the directed acyclic graph of the Bayesian network, i.e., that the conditional probability distribution of $j$ is specified given the value of $i$. The network has 46 sparsely connected nodes (six of which have no connections); the conditional probability tables are not included.
+
+The nodes have the following properties:
+
+- `name`: the name of the variable, as in the source (e.g. "V26"; the variables are not described further).
+- `states`: the list of states of the variable (intervals of the sensor value, e.g. "(2.42-4.66]").[^icon]
+
+[^icon]: Description obtained in part from the [ICON](https://icon.colorado.edu) project."""
+tags = ['Informational', 'Unweighted', 'Metadata']
+url = 'https://web.archive.org/web/20070626181030/http://bndg.cs.aau.dk/html/bayesian_networks.html'
+citation = [('T. D. Nielsen, F. V. Jensen, "On-line alert systems for production plants: A conflict based approach." International Journal of Approximate Reasoning 45(2), 255-270 (2007)', 'https://doi.org/10.1016/j.ijar.2006.06.010')]
+icon_hash = '57d856c967351c5e0ccda0c9'
+upstream_license = None
+# The book's site (bndg.cs.aau.dk) is no longer reachable; the file is
+# obtained from the Internet Archive.
+upstream_prefix = 'https://web.archive.org/web/20070626181753id_/http://bndg.cs.aau.dk/Bayesian_networks'
+files = [('powerplant.net', None, None)]
+
+def fetch_upstream(force=False):
+ return retry_download(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 fname, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fname, "r") as f:
+ text = f.read()
+ # Hugin network specification: "node X { ... states = (...); ... }"
+ # and "potential (X | parents) { ... }"
+ nodes = {}
+ for m in re.finditer(r"^node\s+(\w+)\s*\{(.*?)\}", text, re.S | re.M):
+ st = re.search(r"states\s*=\s*\((.*?)\);", m.group(2), re.S)
+ nodes[m.group(1)] = re.findall(r'"([^"]*)"', st.group(1)) if st else []
+ idx = {v: i for i, v in enumerate(nodes)}
+ edges = []
+ for m in re.finditer(r"^potential\s*\(\s*(\w+)\s*(?:\|([^)]*))?\)",
+ text, re.M):
+ for p in (m.group(2) or "").split():
+ edges.append((idx[p], idx[m.group(1)]))
+ g = Graph(directed=True)
+ g.add_vertex(len(nodes))
+ g.vp.name = g.new_vp("string", vals=list(nodes.keys()))
+ g.vp.states = g.new_vp("vector<string>", vals=list(nodes.values()))
+ g.add_edge_list(edges)
+ yield alt, g