Skip to content

Commit

Permalink
Merge pull request #21 from swerik-project/dev
Browse files Browse the repository at this point in the history
ready for release of new version
  • Loading branch information
BobBorges authored May 20, 2024
2 parents 5d8354d + 156fdfb commit 3976ec1
Show file tree
Hide file tree
Showing 21 changed files with 6,576 additions and 4,361 deletions.
52 changes: 46 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -29,9 +29,9 @@ jobs:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -52,9 +52,9 @@ jobs:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -65,3 +65,43 @@ jobs:
- name: Test manually curated mandate dates do not change
run: |
python -m unittest test.mandates
partyAffiliation:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyriksdagen
pip install pytest-cfg-fetcher
- name: Test MPs agains manually curated data
run: |
python -m unittest test.party-affiliation
frequency-distr:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyriksdagen
pip install pytest-cfg-fetcher
- name: Test at least 95% of parliament days have the correct N MPs (+-10%)
run: |
python -m unittest test.mp-frequency-test
46 changes: 46 additions & 0 deletions .github/workflows/test-protocols.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Test persons repo agains records for misplaced MPs"

on:
pull_request:
branches:
- 'dev'
- 'main'

jobs:
mp-unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: GuillaumeFalourd/[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyriksdagen
pip install pytest-cfg-fetcher
- name: Install jq
uses: dcarbone/install-jq-action@v2
with:
version: 1.7
force: false
- name: get records
run: |
RECORDS_INFO="$(curl -L https://api.github.com/repos/swerik-project/riksdagen-records/releases/latest)"
RECORDS_TAG="$(echo $RECORDS_INFO | jq -r .tag_name)"
curl -LO https://github.com/swerik-project/riksdagen-records/archive/refs/tags/$RECORDS_TAG.zip
RECORDS_TAGNR=$(echo ${RECORDS_TAG:1})
ls -la
unzip $RECORDS_TAG.zip riksdagen-records-$RECORDS_TAGNR/test/*
unzip $RECORDS_TAG.zip riksdagen-records-$RECORDS_TAGNR/data/*
rsync -vr riksdagen-records-$RECORDS_TAGNR/ .
ls -l data
ls -l test
- name: mp-test
run: |
python -m unittest test.mp
20 changes: 20 additions & 0 deletions .github/workflows/validate-cff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Riksdagen Persons: Validate CITATION cff"

on:
push:
paths:
- CITATION.cff
- .github/workflows/validate-cff.yml

jobs:
Validate-CITATION-cff:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate CITATION.cff
uses: dieghernan/cff-validator@v3
39 changes: 39 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cff-version: 1.2.0
message: To cite this reposository, please use these metadata.
title: "The Swedish Parliament Corpus: Riksdagen Persons"
version: v1.0.0
authors:
- given-names: Väinö
family-names: Yrjänäinen
alias: ninpnin
- given-names: Fredrik
family-names: Mohammadi Norén
orcid: "https://orcid.org/0000-0001-8820-1082"
alias: fredrik1984
- family-names: Borges
given-names: Robert
orcid: "https://orcid.org/0000-0002-7647-4048"
alias: BobBorges
- given-names: Johan
family-names: Jarlbrink
orcid: "https://orcid.org/0000-0002-1167-046X"
- given-names: Lotta
family-names: Åberg Brorsson
alias: Lottabrorson
- given-names: Anders P.
family-names: Olsson
- given-names: Pelle
family-names: Snickars
orcid: "https://orcid.org/0000-0001-5122-1549"
- given-names: Måns
family-names: Magnusson
orcid: "https://orcid.org/0000-0002-0296-2719"
alias: MansMeg
date-released: 2024-04-17
identifiers:
- description: Repository basename
type: other
value: riksdagen-persons
repository-code: "https://github.com/swerik-project/riksdagen-persons"
url: "https://github.com/swerik-project/the-swedish-parliament-corpus"
type: dataset
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Riksdagen Politicians
# Riksdagen Persons

This repository contains data related to Members of Parliament, Ministers, Speakers, and other Political figures who participate in the workings of the Riksdag.

Expand All @@ -11,11 +11,7 @@ Contains metadata on individuals.

### The `test/` directory

Contains integrity tests related to the riksdagen-persons repository.

### The `quality_estimation/` directory

Contains scripts to estimate quality and coverage of the data in `data/`.
Contains integrity tests related to the riksdagen-persons repository and to the estimation of quality and coverage of the data in `data/`.


## Data
Expand All @@ -39,6 +35,13 @@ The `data/` directory contains a number of csv files in Normal form where the `p
- source
- volume

### `data/explicit_no_party.csv`
- person_id
- wiki_id
- pages
- ref
- vol

### `data/external_identifiers.csv`
- person_id
- authority
Expand Down
Loading

0 comments on commit 3976ec1

Please sign in to comment.