History of spotted_hyenas
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/spotted_hyenas/__init__.py b/entries/spotted_hyenas/__init__.py
index bbeb835..4d614e2 100644
--- a/entries/spotted_hyenas/__init__.py
+++ b/entries/spotted_hyenas/__init__.py
@@ -30,7 +30,7 @@ url = 'https://bitbucket.org/maucantor/unodf_analyses'
citation = [('K. E. Holekamp, J. E. Smith, C. C. Strelioff, R. C. Van Horn, H. E. Watts, "Society, demography and genetic structure in the spotted hyena." Molecular Ecology 21, 613-632 (2012)', 'https://doi.org/10.1111/j.1365-294X.2011.05240.x'),
('K. E. Holekamp, J. E. Smith, C. C. Strelioff, R. C. Van Horn, H. E. Watts, "Data from: Society, demography and genetic structure in the spotted hyena." Dryad Digital Repository (2011)', 'https://doi.org/10.5061/dryad.tg582'),
('M. Cantor, M. M. Pires, F. M. D. Marquitti, R. L. G. Raimundo, E. Sebastián-González, P. P. Coltri, S. I. Perez, D. R. Barneche, D. Y. C. Brandt, K. Nunes, F. G. Daura-Jorge, S. R. Floeter, P. R. Guimarães Jr., "Nestedness across biological scales." PLoS ONE 12(2), e0171691 (2017)', 'https://doi.org/10.1371/journal.pone.0171691')]
-icon_hash = None
+date_added = '2026-10-25'
upstream_license = None
upstream_prefix = 'https://bitbucket.org/maucantor/unodf_analyses/raw/cef0977496fcb93ec72d20d8c37f0dd46b9f18be/data'
files = [('pop_hyena.txt', None, None)]
[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/spotted_hyenas/__init__.py b/entries/spotted_hyenas/__init__.py
index 18b7505..bbeb835 100644
--- a/entries/spotted_hyenas/__init__.py
+++ b/entries/spotted_hyenas/__init__.py
@@ -23,8 +23,8 @@ description = """Weighted social network of the members of a clan of spotted hye
The network has the following properties:
-- Nodes: `name`, the numeric label of the individual in the source data.
-- Edges: `weight`, the twice-weight association index."""
+- (Node) `name`: the numeric label of the individual in the source data.
+- (Edge) `weight`: the twice-weight association index."""
tags = ['Social', 'Animal', 'Offline', 'Weighted']
url = 'https://bitbucket.org/maucantor/unodf_analyses'
citation = [('K. E. Holekamp, J. E. Smith, C. C. Strelioff, R. C. Van Horn, H. E. Watts, "Society, demography and genetic structure in the spotted hyena." Molecular Ecology 21, 613-632 (2012)', 'https://doi.org/10.1111/j.1365-294X.2011.05240.x'),
[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/spotted_hyenas/__init__.py b/entries/spotted_hyenas/__init__.py
index 8c64c90..18b7505 100644
--- a/entries/spotted_hyenas/__init__.py
+++ b/entries/spotted_hyenas/__init__.py
@@ -43,7 +43,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] New entry: spotted_hyenas d879a5f
diff --git a/entries/spotted_hyenas/__init__.py b/entries/spotted_hyenas/__init__.py
new file mode 100644
index 0000000..8c64c90
--- /dev/null
+++ b/entries/spotted_hyenas/__init__.py
@@ -0,0 +1,66 @@
+#! /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 = 'Spotted hyena clan associations (2012)'
+description = """Weighted social network of the members of a clan of spotted hyenas (*Crocuta crocuta*) in Kenya, from the long-term study of K. E. Holekamp and collaborators (data deposited in the Dryad repository). The data were compiled by M. Cantor and collaborators for a study of nestedness across levels of biological organization, and are distributed in the repository of that study (file `pop_hyena.txt`). Individuals were identified by photo-identification of natural markings (unique spot patterns), and two individuals were considered associated when observed in the same group. Nodes are individuals, and an undirected edge connects two individuals that were observed together at least once, weighted by their association index, the twice-weight index (TWI), an estimate of the proportion of time the two individuals spend together (from 0, never seen together, to 1, always together). To avoid spurious associations, only individuals observed more than five times, all from a single well-sampled clan, are included. The individuals are identified only by anonymous numeric labels. The source data list 585 pairs of individuals with nonzero association, among 36 individuals (the accompanying documentation states 35).
+
+The network has the following properties:
+
+- Nodes: `name`, the numeric label of the individual in the source data.
+- Edges: `weight`, the twice-weight association index."""
+tags = ['Social', 'Animal', 'Offline', 'Weighted']
+url = 'https://bitbucket.org/maucantor/unodf_analyses'
+citation = [('K. E. Holekamp, J. E. Smith, C. C. Strelioff, R. C. Van Horn, H. E. Watts, "Society, demography and genetic structure in the spotted hyena." Molecular Ecology 21, 613-632 (2012)', 'https://doi.org/10.1111/j.1365-294X.2011.05240.x'),
+ ('K. E. Holekamp, J. E. Smith, C. C. Strelioff, R. C. Van Horn, H. E. Watts, "Data from: Society, demography and genetic structure in the spotted hyena." Dryad Digital Repository (2011)', 'https://doi.org/10.5061/dryad.tg582'),
+ ('M. Cantor, M. M. Pires, F. M. D. Marquitti, R. L. G. Raimundo, E. Sebastián-González, P. P. Coltri, S. I. Perez, D. R. Barneche, D. Y. C. Brandt, K. Nunes, F. G. Daura-Jorge, S. R. Floeter, P. R. Guimarães Jr., "Nestedness across biological scales." PLoS ONE 12(2), e0171691 (2017)', 'https://doi.org/10.1371/journal.pone.0171691')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'https://bitbucket.org/maucantor/unodf_analyses/raw/cef0977496fcb93ec72d20d8c37f0dd46b9f18be/data'
+files = [('pop_hyena.txt', None, None)]
+
+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 fname, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ edges = []
+ with open_upstream_file(name, fname, "r") as f:
+ for line in f:
+ p = line.split()
+ if len(p) < 3:
+ continue
+ edges.append((int(p[0]), int(p[1]), float(p[2])))
+ ids = sorted(set(u for e in edges for u in e[:2]))
+ idx = {x: i for i, x in enumerate(ids)}
+ g = Graph(directed=False)
+ g.add_vertex(len(ids))
+ g.vp.name = g.new_vp("int", vals=ids)
+ g.ep.weight = g.new_ep("double")
+ g.add_edge_list([(idx[u], idx[v], w) for u, v, w in edges],
+ eprops=[g.ep.weight])
+ yield alt, g