History of dutch_classrooms
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/dutch_classrooms/__init__.py b/entries/dutch_classrooms/__init__.py
index 4dbab70..30ddf9a 100644
--- a/entries/dutch_classrooms/__init__.py
+++ b/entries/dutch_classrooms/__init__.py
@@ -34,7 +34,7 @@ tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
url = 'https://www.stats.ox.ac.uk/~snijders/siena/BaerveldtData.html'
citation = [('B. Houtzager, C. Baerveldt, "Just like normal: A social network study of the relation between petty crime and the intimacy of adolescent friendships." Social Behavior and Personality 27(2), 177-192 (1999)', 'https://doi.org/10.2224/sbp.1999.27.2.177'),
('T. A. B. Snijders, C. Baerveldt, "A multilevel network study of the effects of delinquent behavior on friendship evolution." Journal of Mathematical Sociology 27(2-3), 123-151 (2003)', 'https://doi.org/10.1080/00222500305892')]
-icon_hash = '5944ad3a4ed8f1bb6022a49e'
+date_added = '2026-10-25'
upstream_license = None
upstream_prefix = 'https://www.stats.ox.ac.uk/~snijders/siena'
schools = [1, 3, 4, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23]
[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/dutch_classrooms/__init__.py b/entries/dutch_classrooms/__init__.py
index 6e6332f..4dbab70 100644
--- a/entries/dutch_classrooms/__init__.py
+++ b/entries/dutch_classrooms/__init__.py
@@ -26,7 +26,10 @@ A directed edge (i, j) indicates that pupil i reported receiving emotional suppo
The networks have the following properties:
-- Nodes: `gender` (1: girl, 2: boy); `delinquency`, the number of minor offenses (from a list of 23, such as shoplifting, petty theft, vandalism and unarmed fights) which the pupil reports to have committed in the last twelve months, at the first wave, transformed as ln(1+x); `delinquency_rounded`, the same measure at the wave of the network, rounded to integer values; `school_friends`, the importance of school friends, from 1 to 4 (the documentation describes this scale inconsistently, as either from 1: very important to 4: unimportant, or from 1: friends outside school are more important to 4: no friends outside school)."""
+- (Node) `gender` (1: girl, 2: boy).
+- (Node) `delinquency`: the number of minor offenses (from a list of 23, such as shoplifting, petty theft, vandalism and unarmed fights) which the pupil reports to have committed in the last twelve months, at the first wave, transformed as ln(1+x).
+- (Node) `delinquency_rounded`: the same measure at the wave of the network, rounded to integer values.
+- (Node) `school_friends`: the importance of school friends, from 1 to 4 (the documentation describes this scale inconsistently, as either from 1: very important to 4: unimportant, or from 1: friends outside school are more important to 4: no friends outside school)."""
tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
url = 'https://www.stats.ox.ac.uk/~snijders/siena/BaerveldtData.html'
citation = [('B. Houtzager, C. Baerveldt, "Just like normal: A social network study of the relation between petty crime and the intimacy of adolescent friendships." Social Behavior and Personality 27(2), 177-192 (1999)', 'https://doi.org/10.2224/sbp.1999.27.2.177'),
[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/dutch_classrooms/__init__.py b/entries/dutch_classrooms/__init__.py
index 6dda368..6e6332f 100644
--- a/entries/dutch_classrooms/__init__.py
+++ b/entries/dutch_classrooms/__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 fnames, 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/dutch_classrooms/__init__.py b/entries/dutch_classrooms/__init__.py
index b4961e0..6dda368 100644
--- a/entries/dutch_classrooms/__init__.py
+++ b/entries/dutch_classrooms/__init__.py
@@ -26,7 +26,7 @@ A directed edge (i, j) indicates that pupil i reported receiving emotional suppo
The networks have the following properties:
-- Nodes: `gender` (1: girl, 2: boy); `delinquency`, the number of minor offences (from a list of 23, such as shoplifting, petty theft, vandalism and unarmed fights) which the pupil reports to have committed in the last twelve months, at the first wave, transformed as ln(1+x); `delinquency_rounded`, the same measure at the wave of the network, rounded to integer values; `school_friends`, the importance of school friends, from 1 to 4 (the documentation describes this scale inconsistently, as either from 1: very important to 4: unimportant, or from 1: friends outside school are more important to 4: no friends outside school)."""
+- Nodes: `gender` (1: girl, 2: boy); `delinquency`, the number of minor offenses (from a list of 23, such as shoplifting, petty theft, vandalism and unarmed fights) which the pupil reports to have committed in the last twelve months, at the first wave, transformed as ln(1+x); `delinquency_rounded`, the same measure at the wave of the network, rounded to integer values; `school_friends`, the importance of school friends, from 1 to 4 (the documentation describes this scale inconsistently, as either from 1: very important to 4: unimportant, or from 1: friends outside school are more important to 4: no friends outside school)."""
tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
url = 'https://www.stats.ox.ac.uk/~snijders/siena/BaerveldtData.html'
citation = [('B. Houtzager, C. Baerveldt, "Just like normal: A social network study of the relation between petty crime and the intimacy of adolescent friendships." Social Behavior and Personality 27(2), 177-192 (1999)', 'https://doi.org/10.2224/sbp.1999.27.2.177'),
[entries] New entry: dutch_classrooms 9634e77
diff --git a/entries/dutch_classrooms/__init__.py b/entries/dutch_classrooms/__init__.py
new file mode 100644
index 0000000..b4961e0
--- /dev/null
+++ b/entries/dutch_classrooms/__init__.py
@@ -0,0 +1,70 @@
+#! /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 = "Dutch Social Behavior study classrooms (1994-1996)"
+description = """Emotional support networks among the pupils of 19 school year groups in Dutch secondary schools, from the Dutch Social Behavior study of C. Baerveldt and collaborators, a two-wave survey on petty crime and social networks of adolescents. The pupils followed the MAVO track (the lower middle level of the Dutch secondary school system) in urban high schools, and filled in a questionnaire during a lesson in their third year (1994/1995, first wave) and fourth year (second wave, about one year later). All pupils of the same year of MAVO in a school form one network, and only pupils who responded in both waves are included (990 pupils in total). The data were distributed by T. Snijders with the SIENA software.
+
+A directed edge (i, j) indicates that pupil i reported receiving emotional support from, or giving emotional support to, pupil j ("Which pupils help you when you are depressed, for example, after the end of a love affair or when you have a conflict with other people?", and "Which pupils do you help when they are depressed...?"). Up to twelve pupils could be named in each question. The network `schoolH_wW` corresponds to the school number H (as numbered in the source data) and wave W. A few diagonal entries of the source matrices are nonzero, and are ignored.
+
+The networks have the following properties:
+
+- Nodes: `gender` (1: girl, 2: boy); `delinquency`, the number of minor offences (from a list of 23, such as shoplifting, petty theft, vandalism and unarmed fights) which the pupil reports to have committed in the last twelve months, at the first wave, transformed as ln(1+x); `delinquency_rounded`, the same measure at the wave of the network, rounded to integer values; `school_friends`, the importance of school friends, from 1 to 4 (the documentation describes this scale inconsistently, as either from 1: very important to 4: unimportant, or from 1: friends outside school are more important to 4: no friends outside school)."""
+tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
+url = 'https://www.stats.ox.ac.uk/~snijders/siena/BaerveldtData.html'
+citation = [('B. Houtzager, C. Baerveldt, "Just like normal: A social network study of the relation between petty crime and the intimacy of adolescent friendships." Social Behavior and Personality 27(2), 177-192 (1999)', 'https://doi.org/10.2224/sbp.1999.27.2.177'),
+ ('T. A. B. Snijders, C. Baerveldt, "A multilevel network study of the effects of delinquent behavior on friendship evolution." Journal of Mathematical Sociology 27(2-3), 123-151 (2003)', 'https://doi.org/10.1080/00222500305892')]
+icon_hash = '5944ad3a4ed8f1bb6022a49e'
+upstream_license = None
+upstream_prefix = 'https://www.stats.ox.ac.uk/~snijders/siena'
+schools = [1, 3, 4, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23]
+files = [((f'CB_data.zip:{"N34" if w == 1 else "HN34"}_{h}.DAT',
+ f'CB_data.zip:CBE{h}.DAT', f'CB_data.zip:cbc{h}.dat'),
+ f'school{h}_w{w}', None) for h in schools for w in [1, 2]]
+
+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
+ w = int(alt.split("_w")[1])
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r"))
+ for fn in fnames]
+ A = numpy.loadtxt(fs[0], dtype="int")
+ att = numpy.loadtxt(fs[1])
+ beh = numpy.loadtxt(fs[2], dtype="int")
+ numpy.fill_diagonal(A, 0)
+ g = Graph(directed=True)
+ g.add_vertex(A.shape[0])
+ g.add_edge_list(numpy.transpose(A.nonzero()))
+ g.vp.gender = g.new_vp("int", vals=att[:, 0].astype("int"))
+ g.vp.delinquency = g.new_vp("double", vals=att[:, 1])
+ g.vp.delinquency_rounded = g.new_vp("int", vals=beh[:, w - 1])
+ g.vp.school_friends = g.new_vp("int", vals=att[:, 2].astype("int"))
+ yield alt, g