History of dutch_school
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_school/__init__.py b/entries/dutch_school/__init__.py
index 76b59fe..dfc5aed 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__init__.py
@@ -40,7 +40,7 @@ The networks have the following node properties (in the attributes, 0 denotes a
tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
url = 'http://www.stats.ox.ac.uk/~snijders/siena/tutorial2010_data.htm'
citation = [('T. Snijders, G. van de Bunt, and C. Steglich, "Introduction to stochastic actor-based models for network dynamics." Social Networks 32(1), 44-60 (2010)', 'https://doi.org/10.1016/j.socnet.2009.02.004')]
-icon_hash = ['5944a99b4ed8f1bb6022a49b', '595b2181549f067e0263b53c']
+date_added = '2020-08-11'
upstream_prefix = 'http://www.stats.ox.ac.uk/~snijders/siena'
files = [('klas12b.zip:klas12b-net-1.dat', 'klas12b-net-1', 'matrix'), ('klas12b.zip:klas12b-net-2.dat', 'klas12b-net-2', 'matrix'), ('klas12b.zip:klas12b-net-3.dat', 'klas12b-net-3', 'matrix'), ('klas12b.zip:klas12b-net-3m.dat', 'klas12b-net-3m', 'matrix'), ('klas12b.zip:klas12b-net-4.dat', 'klas12b-net-4', 'matrix'), ('klas12b.zip:klas12b-net-4m.dat', 'klas12b-net-4m', 'matrix'), ('klas12b.zip:klas12b-primary.dat', 'klas12b-primary', 'matrix')]
[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_school/__init__.py b/entries/dutch_school/__init__.py
index 9a617cd..76b59fe 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__init__.py
@@ -52,7 +52,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] Fix parse bugs and improve descriptions and metadata 6bb6851
- parse fixes from the review of the descriptions, e.g. us_patents (directed), celegans_2019 (synapse direction), ecoli_transcription and yeast_transcription (regulator to target), bitcoin (direction, phantom node), ego_social (Google+ features and circles), scotus_majority, arxiv_authors and social_location (as in SNAP), caida_as, dnc, dom, mist, reuters and bibsonomy (names on the right nodes), uci_zoo - every description now states explicitly what the nodes and edges represent; corrected titles, years, tags, citations and licences - the "Hypergraph" tag is removed; very large entries are marked `huge = True` (see --skip-huge) - ICON ids of partial duplicates added (hiv_transmission, congress_bills, openflights, dutch_school)
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index b5a6f4f..9a617cd 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__init__.py
@@ -19,12 +19,28 @@
from .. import *
title = "Dutch school friendships (2003)"
-description = """A series of snapshots of the friendships among freshmen at secondary school in The Netherlands, in 2003-2004. Friendship ties were surveyed four times, at three month intervals. The direction of an edge indicates that student i is friends with student j. Missing data is coded as 0 or 10. Metadata includes sex, age, ethnicity, and religion.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = r"""Friendship networks among the 26 pupils of a school class (class "12b") in the first year of secondary school in the Netherlands, collected by A. Knecht in 2003–2004 for her PhD research on friendship dynamics in early adolescence, and used by T. A. B. Snijders, G. G. van de Bunt and C. E. G. Steglich to illustrate stochastic actor-oriented models. Friendship nominations were surveyed four times (waves 1 to 4), at intervals of three months. Nodes are pupils, and a directed edge $i \to j$ means that pupil $i$ nominated pupil $j$ as a friend. The same pupils are present in all networks, in the same order.
+
+The networks are:
+
+- `klas12b-net-1` to `klas12b-net-4`: friendships in each of the four waves;
+- `klas12b-net-3m` and `klas12b-net-4m`: variants of waves 3 and 4 in which all missing values are coded as 9 (their purpose is not documented in the source);
+- `klas12b-primary`: friendships in primary school, as reported in the first wave.
+
+In the source data, missing values are coded with 9 (incidentally missing nominator) or 10 (structurally missing nominator or nominee, e.g. a pupil who left the class); these entries are not represented as edges.
+
+The networks have the following node properties (in the attributes, 0 denotes a missing value):
+
+- `missing`: whether the nominations of the pupil are missing in the network.
+- `sex` (1: female, 2: male), `age` (in years, at wave 1), `ethnicity` (1: Dutch, 2: other) and `religion` (of the father; 1: Christian, 2: non-religious, 3: other religion).
+- `advice`: the school advice at the end of primary school (from 4, low, to 8, high).
+- `delinquency`: a scale of minor delinquency in waves 1 to 4 (1: never, 2: once, 3: 2–4 times, 4: 5–10 times, 5: more than 10 times).
+- `alcohol`: alcohol consumption in waves 2 to 4 (same scale as `delinquency`).
+- `present`: the first and last waves in which the pupil was present in the class."""
tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
url = 'http://www.stats.ox.ac.uk/~snijders/siena/tutorial2010_data.htm'
citation = [('T. Snijders, G. van de Bunt, and C. Steglich, "Introduction to stochastic actor-based models for network dynamics." Social Networks 32(1), 44-60 (2010)', 'https://doi.org/10.1016/j.socnet.2009.02.004')]
-icon_hash = '5944a99b4ed8f1bb6022a49b'
+icon_hash = ['5944a99b4ed8f1bb6022a49b', '595b2181549f067e0263b53c']
upstream_prefix = 'http://www.stats.ox.ac.uk/~snijders/siena'
files = [('klas12b.zip:klas12b-net-1.dat', 'klas12b-net-1', 'matrix'), ('klas12b.zip:klas12b-net-2.dat', 'klas12b-net-2', 'matrix'), ('klas12b.zip:klas12b-net-3.dat', 'klas12b-net-3', 'matrix'), ('klas12b.zip:klas12b-net-3m.dat', 'klas12b-net-3m', 'matrix'), ('klas12b.zip:klas12b-net-4.dat', 'klas12b-net-4', 'matrix'), ('klas12b.zip:klas12b-net-4m.dat', 'klas12b-net-4m', 'matrix'), ('klas12b.zip:klas12b-primary.dat', 'klas12b-primary', 'matrix')]
@@ -44,6 +60,29 @@ def parse(alts=None):
if isinstance(fnames, str):
fnames = [fnames]
with ExitStack() as stack:
- fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
- g = parse_graph(fs, fmt, directed=True)
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+ A = numpy.loadtxt(fs[0], dtype="int")
+
+ # entries: 0 (no friendship), 1 (friendship), 9 (incidentally
+ # missing nominator), 10 (structurally missing nominator or nominee)
+ g = Graph(directed=True)
+ g.add_vertex(A.shape[0])
+ g.add_edge_list(numpy.argwhere(A == 1))
+ # missing nominator: all entries of the row (except the diagonal)
+ # are missing values
+ M = (A == 9) | (A == 10)
+ numpy.fill_diagonal(M, True)
+ g.vp.missing = g.new_vp("bool", vals=M.all(axis=1))
+
+ def read(fn):
+ with open_upstream_file(name, f"klas12b.zip:klas12b-{fn}.dat", "r") as f:
+ return numpy.loadtxt(f, dtype="int", ndmin=2)
+
+ demo = read("demographics")
+ for i, k in enumerate(["sex", "age", "ethnicity", "religion"]):
+ g.vp[k] = g.new_vp("int", vals=demo[:, i])
+ g.vp.advice = g.new_vp("int", vals=read("advice")[:, 0])
+ g.vp.delinquency = g.new_vp("vector<int>", vals=read("delinquency"))
+ g.vp.alcohol = g.new_vp("vector<int>", vals=read("alcohol"))
+ g.vp.present = g.new_vp("vector<int>", vals=read("present"))
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index 6abfe57..b5a6f4f 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__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 3d288ea
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index e8b81fd..6abfe57 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__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 8d005ae
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index 78c77e2..e8b81fd 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__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
Update copyright info db2efcc
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index 8b76a9a..78c77e2 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# 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
Update citations to use DOIs e878874
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index 884e62f..8b76a9a 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__init__.py
@@ -23,7 +23,7 @@ description = """A series of snapshots of the friendships among freshmen at seco
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
url = 'http://www.stats.ox.ac.uk/~snijders/siena/tutorial2010_data.htm'
-citation = [('T. Snijders, G. van de Bunt, and C. Steglich, "Introduction to stochastic actor-based models for network dynamics." Social Networks 32(1), 44-60 (2010)', 'http://www.sciencedirect.com/science/article/pii/S0378873309000069')]
+citation = [('T. Snijders, G. van de Bunt, and C. Steglich, "Introduction to stochastic actor-based models for network dynamics." Social Networks 32(1), 44-60 (2010)', 'https://doi.org/10.1016/j.socnet.2009.02.004')]
icon_hash = '5944a99b4ed8f1bb6022a49b'
upstream_prefix = 'http://www.stats.ox.ac.uk/~snijders/siena'
files = [('klas12b.zip:klas12b-net-1.dat', 'klas12b-net-1', 'matrix'), ('klas12b.zip:klas12b-net-2.dat', 'klas12b-net-2', 'matrix'), ('klas12b.zip:klas12b-net-3.dat', 'klas12b-net-3', 'matrix'), ('klas12b.zip:klas12b-net-3m.dat', 'klas12b-net-3m', 'matrix'), ('klas12b.zip:klas12b-net-4.dat', 'klas12b-net-4', 'matrix'), ('klas12b.zip:klas12b-net-4m.dat', 'klas12b-net-4m', 'matrix'), ('klas12b.zip:klas12b-primary.dat', 'klas12b-primary', 'matrix')]
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index 3f6565d..884e62f 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__init__.py
@@ -3,18 +3,18 @@
#
# Copyright (C) 2020 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 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 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 General Public License for more details.
+# 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 General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# 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 *
Add explicit attribution to descriptions obtained from ICON 1645314
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
index 087b3d1..3f6565d 100644
--- a/entries/dutch_school/__init__.py
+++ b/entries/dutch_school/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Dutch school friendships (2003)"
-description = "A series of snapshots of the friendships among freshmen at secondary school in The Netherlands, in 2003-2004. Friendship ties were surveyed four times, at three month intervals. The direction of an edge indicates that student i is friends with student j. Missing data is coded as 0 or 10. Metadata includes sex, age, ethnicity, and religion."
+description = """A series of snapshots of the friendships among freshmen at secondary school in The Netherlands, in 2003-2004. Friendship ties were surveyed four times, at three month intervals. The direction of an edge indicates that student i is friends with student j. Missing data is coded as 0 or 10. Metadata includes sex, age, ethnicity, and religion.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
url = 'http://www.stats.ox.ac.uk/~snijders/siena/tutorial2010_data.htm'
citation = [('T. Snijders, G. van de Bunt, and C. Steglich, "Introduction to stochastic actor-based models for network dynamics." Social Networks 32(1), 44-60 (2010)', 'http://www.sciencedirect.com/science/article/pii/S0378873309000069')]
Initial commit cc85872
diff --git a/entries/dutch_school/__init__.py b/entries/dutch_school/__init__.py
new file mode 100644
index 0000000..087b3d1
--- /dev/null
+++ b/entries/dutch_school/__init__.py
@@ -0,0 +1,48 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 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 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "Dutch school friendships (2003)"
+description = "A series of snapshots of the friendships among freshmen at secondary school in The Netherlands, in 2003-2004. Friendship ties were surveyed four times, at three month intervals. The direction of an edge indicates that student i is friends with student j. Missing data is coded as 0 or 10. Metadata includes sex, age, ethnicity, and religion."
+tags = ['Social', 'Offline', 'Unweighted', 'Metadata', 'Temporal']
+url = 'http://www.stats.ox.ac.uk/~snijders/siena/tutorial2010_data.htm'
+citation = [('T. Snijders, G. van de Bunt, and C. Steglich, "Introduction to stochastic actor-based models for network dynamics." Social Networks 32(1), 44-60 (2010)', 'http://www.sciencedirect.com/science/article/pii/S0378873309000069')]
+icon_hash = '5944a99b4ed8f1bb6022a49b'
+upstream_prefix = 'http://www.stats.ox.ac.uk/~snijders/siena'
+files = [('klas12b.zip:klas12b-net-1.dat', 'klas12b-net-1', 'matrix'), ('klas12b.zip:klas12b-net-2.dat', 'klas12b-net-2', 'matrix'), ('klas12b.zip:klas12b-net-3.dat', 'klas12b-net-3', 'matrix'), ('klas12b.zip:klas12b-net-3m.dat', 'klas12b-net-3m', 'matrix'), ('klas12b.zip:klas12b-net-4.dat', 'klas12b-net-4', 'matrix'), ('klas12b.zip:klas12b-net-4m.dat', 'klas12b-net-4m', 'matrix'), ('klas12b.zip:klas12b-primary.dat', 'klas12b-primary', 'matrix')]
+
+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, "rb")) for fn in fnames]
+ g = parse_graph(fs, fmt, directed=True)
+ yield alt, g