logo Netzschleuder network catalog, repository, and centrifuge

History of us_congress

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 by Tiago de Paula Peixoto 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/us_congress/__init__.py b/entries/us_congress/__init__.py
index ff33ecd..b372101 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__init__.py
@@ -32,7 +32,7 @@ tags = ['Social', 'Political', 'Signed', 'Temporal']
 url = 'https://doi.org/10.6084/m9.figshare.8096429'
 citation = [('Z. P. Neal, "A sign of the times? Weak and strong polarization in the U.S. Congress, 1973-2016." Social Networks 60, 103-112 (2020)', 'https://doi.org/10.1016/j.socnet.2018.07.007'),
             ('Neal, Z. P. (2014). "The backbone of bipartite projections: Inferring relationships from co-authorship, co-sponsorship, co-attendance and other co-behaviors." Social Networks, 39, 84-97.', 'https://doi.org/10.1016/j.socnet.2014.06.001')]
-icon_hash = '5e252c0878691ca4060b74bd'
+date_added = '2020-08-11'
 upstream_prefix = 'https://ndownloader.figshare.com/files/'
 files = [('20758701', f'H{d}', None) for d in range(93, 115)] + \
     [('20758701', f'S{d}', None) for d in range(93, 115)]
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto 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/us_congress/__init__.py b/entries/us_congress/__init__.py
index 45d0cf4..ff33ecd 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__init__.py
@@ -26,8 +26,8 @@ Nodes are representatives or senators. The relationships were obtained from the
 
 The networks have the following properties:
 
-- `name`: the name of the legislator, with state and party affiliation (e.g. `Baucus, M. (MT-D)`).
-- `weight`: the sign of the relationship, $+1$ (positive) or $-1$ (negative).""" 
+- (Node) `name`: the name of the legislator, with state and party affiliation (e.g. `Baucus, M. (MT-D)`).
+- (Edge) `weight`: the sign of the relationship, $+1$ (positive) or $-1$ (negative).""" 
 tags = ['Social', 'Political', 'Signed', 'Temporal']
 url = 'https://doi.org/10.6084/m9.figshare.8096429'
 citation = [('Z. P. Neal, "A sign of the times? Weak and strong polarization in the U.S. Congress, 1973-2016." Social Networks 60, 103-112 (2020)', 'https://doi.org/10.1016/j.socnet.2018.07.007'),
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 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/us_congress/__init__.py b/entries/us_congress/__init__.py
index 417f76e..45d0cf4 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__init__.py
@@ -47,7 +47,6 @@ def fetch_upstream(force=False):
 #@coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     wb = None
     for fname, alt, fmt in files:
[pipeline] Fix KONECT entity files, seekable upstream files and archive formats by Tiago de Paula Peixoto 2f6e19f
- konect.py: each ent.<net>.<entity>.<attr> file becomes a vertex
  property on the side of the entity it describes (per-vertex or per-edge
  files), instead of all of them being written from vertex 0 into `meta`
  (which put e.g. the item names of bibsonomy and reuters on the wrong
  nodes); only leading "%" lines are comments.
- open_upstream_file(..., seekable=True) returns a seekable file (via a
  temporary file) for readers that need one (openpyxl, scipy.io.loadmat,
  zipfile), replacing the per-entry BytesIO copies.
- .xz files can be read again; .xz, .rar and .7z downloads are stored as
  they are, and "x.tar.xz:", "x.rar:" and "x.7z:" member access works
  (with py7zr or the 7z command); caches in the previous layouts are still
  read.
- parsers.py: vprops_from_txt matches rows by name for graphs keyed by
  name; the Wikimedia dump readers (stub histories, SQL tables) are shared
  helpers; new read_doc (tables of Word documents via LibreOffice) and
  read_epanet (EPANET water network files) readers.
- The entries' workarounds are removed (all parse identically).
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index a195def..417f76e 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__init__.py
@@ -20,8 +20,14 @@ from openpyxl import load_workbook
 from .. import *
 
 title = "US Congressional co-sponsorship (1973-2016)"
-description = """Two temporal networks of bill co-sponsorship tendencies among US Congresspeople, from 1973 (93rd Congress) to 2016 (114th Congress). Edges are signed, indicating the presence of a significant tendency to co-sponsor, or tendency to not co-sponsor, bills. Two networks per year, one for each chamber (House, Senate). Each file contains the signed network for a chamber of congress (H = House, S = Senate) in one session (e.g. 93 = 93rd session of congress).[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project.""" 
+description = """Signed networks of relationships among the members of the U.S. Congress, inferred by Z. P. Neal from bill co-sponsorship data, for each chamber and each Congress from the 93rd (1973–1974) to the 114th (2015–2016). There is one network for each chamber and Congress, named by the chamber (`H` for the House of Representatives, `S` for the Senate) followed by the number of the Congress (e.g. `S100` for the Senate of the 100th Congress).
+
+Nodes are representatives or senators. The relationships were obtained from the bipartite network of legislators and the bills they sponsored or co-sponsored, by extracting its signed backbone with the stochastic degree sequence model (SDSM): two legislators have a positive relationship if they co-sponsored significantly more bills together than expected given the numbers of bills each of them (co-)sponsored and the numbers of (co-)sponsors of each bill, and a negative relationship if they co-sponsored significantly fewer bills together than expected. Pairs without a significant relationship are not connected.
+
+The networks have the following properties:
+
+- `name`: the name of the legislator, with state and party affiliation (e.g. `Baucus, M. (MT-D)`).
+- `weight`: the sign of the relationship, $+1$ (positive) or $-1$ (negative).""" 
 tags = ['Social', 'Political', 'Signed', 'Temporal']
 url = 'https://doi.org/10.6084/m9.figshare.8096429'
 citation = [('Z. P. Neal, "A sign of the times? Weak and strong polarization in the U.S. Congress, 1973-2016." Social Networks 60, 103-112 (2020)', 'https://doi.org/10.1016/j.socnet.2018.07.007'),
@@ -30,7 +36,8 @@ icon_hash = '5e252c0878691ca4060b74bd'
 upstream_prefix = 'https://ndownloader.figshare.com/files/'
 files = [('20758701', f'H{d}', None) for d in range(93, 115)] + \
     [('20758701', f'S{d}', None) for d in range(93, 115)]
-upstream_license = "CC-BY 4.0"
+upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
+                    "https://creativecommons.org/licenses/by/4.0/")
 
 def fetch_upstream(force=False):
     return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
@@ -47,7 +54,7 @@ def parse(alts=None):
         if alts is not None and alt not in alts:
             continue
         if wb is None:
-            with open_upstream_file(name, fname, "rb") as f:
+            with open_upstream_file(name, fname, "rb", seekable=True) as f:
                 wb = load_workbook(f)
 
         g = Graph(directed=False)
@@ -58,7 +65,7 @@ def parse(alts=None):
         for i, row in enumerate(wb[alt].values):
             if i == 0:
                 g.add_vertex(len(row)-1)
-            g.vp.name[g.vertex(0)] = row[0]
+            g.vp.name[g.vertex(i)] = row[0]
             for j, val in enumerate(row[1:]):
                 x = int(val)
                 if x == 0 or i > j:
Update copyright information by Tiago de Paula Peixoto 73a4f0d
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index f61fb1e..a195def 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__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 by Tiago de Paula Peixoto 3d288ea
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index c4c0b40..f61fb1e 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__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 by Tiago de Paula Peixoto 8d005ae
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index 8832419..c4c0b40 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__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 by Tiago de Paula Peixoto db2efcc
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index b71de73..8832419 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__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 by Tiago de Paula Peixoto e878874
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index 286b786..b71de73 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__init__.py
@@ -24,8 +24,8 @@ description = """Two temporal networks of bill co-sponsorship tendencies among U
 [^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project.""" 
 tags = ['Social', 'Political', 'Signed', 'Temporal']
 url = 'https://doi.org/10.6084/m9.figshare.8096429'
-citation = [('Z. P. Neal, "A sign of the times? Weak and strong polarization in the U.S. Congress, 1973-2016." Social Networks 60, 103-112 (2020)', 'http://dx.doi.org/10.1016/j.socnet.2018.07.007'),
-            ('Neal, Z. P. (2014). The backbone of bipartite projections: Inferring relationships from co-authorship, co-sponsorship, co-attendance and other co-behaviors. Social Networks, 39, 84-97.', 'http://dx.doi.org/10.1016/j.socnet.2014.06.001')]
+citation = [('Z. P. Neal, "A sign of the times? Weak and strong polarization in the U.S. Congress, 1973-2016." Social Networks 60, 103-112 (2020)', 'https://doi.org/10.1016/j.socnet.2018.07.007'),
+            ('Neal, Z. P. (2014). "The backbone of bipartite projections: Inferring relationships from co-authorship, co-sponsorship, co-attendance and other co-behaviors." Social Networks, 39, 84-97.', 'https://doi.org/10.1016/j.socnet.2014.06.001')]
 icon_hash = '5e252c0878691ca4060b74bd'
 upstream_prefix = 'https://ndownloader.figshare.com/files/'
 files = [('20758701', f'H{d}', None) for d in range(93, 115)] + \
Change license from GPLv3 to AGPLv3 by Tiago de Paula Peixoto d754be5
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index f2f46d9..286b786 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__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 openpyxl import load_workbook
 from .. import *
Add explicit attribution to descriptions obtained from ICON by Tiago de Paula Peixoto 1645314
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
index def927b..f2f46d9 100644
--- a/entries/us_congress/__init__.py
+++ b/entries/us_congress/__init__.py
@@ -20,7 +20,8 @@ from openpyxl import load_workbook
 from .. import *
 
 title = "US Congressional co-sponsorship (1973-2016)"
-description = "Two temporal networks of bill co-sponsorship tendencies among US Congresspeople, from 1973 (93rd Congress) to 2016 (114th Congress). Edges are signed, indicating the presence of a significant tendency to co-sponsor, or tendency to not co-sponsor, bills. Two networks per year, one for each chamber (House, Senate). Each file contains the signed network for a chamber of congress (H = House, S = Senate) in one session (e.g. 93 = 93rd session of congress)." 
+description = """Two temporal networks of bill co-sponsorship tendencies among US Congresspeople, from 1973 (93rd Congress) to 2016 (114th Congress). Edges are signed, indicating the presence of a significant tendency to co-sponsor, or tendency to not co-sponsor, bills. Two networks per year, one for each chamber (House, Senate). Each file contains the signed network for a chamber of congress (H = House, S = Senate) in one session (e.g. 93 = 93rd session of congress).[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project.""" 
 tags = ['Social', 'Political', 'Signed', 'Temporal']
 url = 'https://doi.org/10.6084/m9.figshare.8096429'
 citation = [('Z. P. Neal, "A sign of the times? Weak and strong polarization in the U.S. Congress, 1973-2016." Social Networks 60, 103-112 (2020)', 'http://dx.doi.org/10.1016/j.socnet.2018.07.007'),
Initial commit by Tiago de Paula Peixoto cc85872
diff --git a/entries/us_congress/__init__.py b/entries/us_congress/__init__.py
new file mode 100644
index 0000000..def927b
--- /dev/null
+++ b/entries/us_congress/__init__.py
@@ -0,0 +1,68 @@
+#! /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 openpyxl import load_workbook
+from .. import *
+
+title = "US Congressional co-sponsorship (1973-2016)"
+description = "Two temporal networks of bill co-sponsorship tendencies among US Congresspeople, from 1973 (93rd Congress) to 2016 (114th Congress). Edges are signed, indicating the presence of a significant tendency to co-sponsor, or tendency to not co-sponsor, bills. Two networks per year, one for each chamber (House, Senate). Each file contains the signed network for a chamber of congress (H = House, S = Senate) in one session (e.g. 93 = 93rd session of congress)." 
+tags = ['Social', 'Political', 'Signed', 'Temporal']
+url = 'https://doi.org/10.6084/m9.figshare.8096429'
+citation = [('Z. P. Neal, "A sign of the times? Weak and strong polarization in the U.S. Congress, 1973-2016." Social Networks 60, 103-112 (2020)', 'http://dx.doi.org/10.1016/j.socnet.2018.07.007'),
+            ('Neal, Z. P. (2014). The backbone of bipartite projections: Inferring relationships from co-authorship, co-sponsorship, co-attendance and other co-behaviors. Social Networks, 39, 84-97.', 'http://dx.doi.org/10.1016/j.socnet.2014.06.001')]
+icon_hash = '5e252c0878691ca4060b74bd'
+upstream_prefix = 'https://ndownloader.figshare.com/files/'
+files = [('20758701', f'H{d}', None) for d in range(93, 115)] + \
+    [('20758701', f'S{d}', None) for d in range(93, 115)]
+upstream_license = "CC-BY 4.0"
+
+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]
+    wb = None
+    for fname, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        if wb is None:
+            with open_upstream_file(name, fname, "rb") as f:
+                wb = load_workbook(f)
+
+        g = Graph(directed=False)
+
+        g.vp.name = g.new_vp("string")
+        g.ep.weight = g.new_ep("int16_t")
+
+        for i, row in enumerate(wb[alt].values):
+            if i == 0:
+                g.add_vertex(len(row)-1)
+            g.vp.name[g.vertex(0)] = row[0]
+            for j, val in enumerate(row[1:]):
+                x = int(val)
+                if x == 0 or i > j:
+                    continue
+                e = g.add_edge(i, j)
+                g.ep.weight[e] = x
+
+        yield alt, g