History of ncaa_basketball_2017
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] Remove superfluous details of the upstream distribution from the descriptions dc07aa0
The descriptions mentioned incidental details of how the upstream data are made available: the file formats (CSV, JSON, XML, GEXF, SBML, HIF, Pajek, UCINET, ...), file names, where the files were published or obtained from (Zenodo, figshare, Kaggle, the Pajek datasets page, the Internet Archive), and that some networks are only available in the gt format. These are left out; caveats about the data themselves are kept, referring to "the data" instead of "the file". The description of sp_baboons now lists its properties instead of the upstream columns, and says that events without a recipient are left out.
diff --git a/entries/ncaa_basketball_2017/__init__.py b/entries/ncaa_basketball_2017/__init__.py
index 4abcb9e..22afb60 100644
--- a/entries/ncaa_basketball_2017/__init__.py
+++ b/entries/ncaa_basketball_2017/__init__.py
@@ -24,7 +24,7 @@ description = """Directed network of the games played among the teams of the 201
A node is a team, and a directed edge from team A to team B is a game won by A over B. Each game between two of the teams is a separate edge, and is taken from the results of either team. The crawler omitted the last game in the schedule of each team, so games that were the last ones played by both teams (such as some conference tournament finals) are missing.
-The network published upstream (`tournament_schedule.gexf`) instead joins the games of each pair of teams in a single edge, weighted by the cumulative point differential, but is built with a comparison of the scores as text, which misclassifies games where one team scored 100 points or more, and does not match the alternative names of four teams (e.g. "UNC" and "North Carolina"); the network here is built from the game results crawled upstream (`results.csv`).
+The network published upstream instead joins the games of each pair of teams in a single edge, weighted by the cumulative point differential, but is built with a comparison of the scores as text, which misclassifies games where one team scored 100 points or more, and does not match the alternative names of four teams (e.g. "UNC" and "North Carolina"); the network here is built from the game results crawled upstream.
The network has the following properties:
[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/ncaa_basketball_2017/__init__.py b/entries/ncaa_basketball_2017/__init__.py
index 257e3ae..4abcb9e 100644
--- a/entries/ncaa_basketball_2017/__init__.py
+++ b/entries/ncaa_basketball_2017/__init__.py
@@ -34,7 +34,7 @@ The network has the following properties:
tags = ['Social', 'Sports', 'Multigraph', 'Timestamps']
url = 'https://github.com/brianckeegan/NCAA-MBB-2017'
citation = [('B. Keegan, "NCAA-MBB-2017: Quick-and-dirty network analysis of the 2017 NCAA Men\'s Basketball tournament." https://github.com/brianckeegan/NCAA-MBB-2017 (2017)', 'https://github.com/brianckeegan/NCAA-MBB-2017')]
-icon_hash = '592de64167ec90f1500d4e42'
+date_added = '2026-10-25'
upstream_license = None
upstream_prefix = 'https://raw.githubusercontent.com/brianckeegan/NCAA-MBB-2017/625a75e31dbe55c6adbb6384da06b662949239b7'
files = [('results.csv', 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/ncaa_basketball_2017/__init__.py b/entries/ncaa_basketball_2017/__init__.py
index fdc8360..257e3ae 100644
--- a/entries/ncaa_basketball_2017/__init__.py
+++ b/entries/ncaa_basketball_2017/__init__.py
@@ -28,8 +28,9 @@ The network published upstream (`tournament_schedule.gexf`) instead joins the ga
The network has the following properties:
-- Nodes: `name`, the team name.
-- Edges: `date`, the date of the game (YYYY-MM-DD); `winner_points` and `loser_points`, the points scored by the winning and losing team."""
+- (Node) `name`: the team name.
+- (Edge) `date`: the date of the game (YYYY-MM-DD).
+- (Edge) `winner_points` and `loser_points`: the points scored by the winning and losing team."""
tags = ['Social', 'Sports', 'Multigraph', 'Timestamps']
url = 'https://github.com/brianckeegan/NCAA-MBB-2017'
citation = [('B. Keegan, "NCAA-MBB-2017: Quick-and-dirty network analysis of the 2017 NCAA Men\'s Basketball tournament." https://github.com/brianckeegan/NCAA-MBB-2017 (2017)', 'https://github.com/brianckeegan/NCAA-MBB-2017')]
[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/ncaa_basketball_2017/__init__.py b/entries/ncaa_basketball_2017/__init__.py
index 27202ae..fdc8360 100644
--- a/entries/ncaa_basketball_2017/__init__.py
+++ b/entries/ncaa_basketball_2017/__init__.py
@@ -53,7 +53,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: ncaa_basketball_2017 b6b70a6
diff --git a/entries/ncaa_basketball_2017/__init__.py b/entries/ncaa_basketball_2017/__init__.py
new file mode 100644
index 0000000..27202ae
--- /dev/null
+++ b/entries/ncaa_basketball_2017/__init__.py
@@ -0,0 +1,91 @@
+#! /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 = "NCAA men's basketball tournament teams (2016-2017)"
+description = """Directed network of the games played among the teams of the 2017 NCAA Division I men's basketball tournament ("March Madness") during the 2016-2017 regular season and conference tournaments, compiled by B. Keegan. The season schedules and results of the 60 teams that entered the main tournament draw directly (the 8 teams of the "First Four" play-in games are not included) were crawled from sports-reference.com on 15 March 2017, and cover the games from 11 November 2016 to 12 March 2017.
+
+A node is a team, and a directed edge from team A to team B is a game won by A over B. Each game between two of the teams is a separate edge, and is taken from the results of either team. The crawler omitted the last game in the schedule of each team, so games that were the last ones played by both teams (such as some conference tournament finals) are missing.
+
+The network published upstream (`tournament_schedule.gexf`) instead joins the games of each pair of teams in a single edge, weighted by the cumulative point differential, but is built with a comparison of the scores as text, which misclassifies games where one team scored 100 points or more, and does not match the alternative names of four teams (e.g. "UNC" and "North Carolina"); the network here is built from the game results crawled upstream (`results.csv`).
+
+The network has the following properties:
+
+- Nodes: `name`, the team name.
+- Edges: `date`, the date of the game (YYYY-MM-DD); `winner_points` and `loser_points`, the points scored by the winning and losing team."""
+tags = ['Social', 'Sports', 'Multigraph', 'Timestamps']
+url = 'https://github.com/brianckeegan/NCAA-MBB-2017'
+citation = [('B. Keegan, "NCAA-MBB-2017: Quick-and-dirty network analysis of the 2017 NCAA Men\'s Basketball tournament." https://github.com/brianckeegan/NCAA-MBB-2017 (2017)', 'https://github.com/brianckeegan/NCAA-MBB-2017')]
+icon_hash = '592de64167ec90f1500d4e42'
+upstream_license = None
+upstream_prefix = 'https://raw.githubusercontent.com/brianckeegan/NCAA-MBB-2017/625a75e31dbe55c6adbb6384da06b662949239b7'
+files = [('results.csv', None, None)]
+
+# Names used in the schedules of the opponents for the teams whose
+# tournament name is an abbreviation
+aliases = {"East Tennessee State": "ETSU",
+ "Southern Methodist": "SMU",
+ "North Carolina": "UNC",
+ "Virginia Commonwealth": "VCU"}
+
+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
+ with open_upstream_file(name, fname, "r") as f:
+ rows = list(csv.DictReader(f))
+ teams = []
+ for r in rows:
+ if r["team"] not in teams:
+ teams.append(r["team"])
+ idx = {t: i for i, t in enumerate(teams)}
+ # Games among the teams, as (winner, loser, date) -> (points, points)
+ games = {}
+ for r in rows:
+ team = r["team"]
+ opp = aliases.get(r["opponent"], r["opponent"])
+ if opp not in idx:
+ continue
+ score, opp_score = int(r["score"]), int(r["opp_score"])
+ if r["result"] == "W":
+ games[(team, opp, r["date"])] = (score, opp_score)
+ else:
+ games[(opp, team, r["date"])] = (opp_score, score)
+ g = Graph(directed=True)
+ g.add_vertex(len(teams))
+ g.vp.name = g.new_vp("string", vals=teams)
+ g.ep.date = g.new_ep("string")
+ g.ep.winner_points = g.new_ep("int")
+ g.ep.loser_points = g.new_ep("int")
+ for (w, l, d), (sw, sl) in sorted(games.items(), key=lambda x: x[0][2]):
+ e = g.add_edge(idx[w], idx[l])
+ g.ep.date[e] = d
+ g.ep.winner_points[e] = sw
+ g.ep.loser_points[e] = sl
+ yield alt, g