Commit 669266f1 authored by Dominique Merle's avatar Dominique Merle
Browse files

Ooooops previous commit was incomplete.

#norewrite
parent 967532f1
# Majority Judgment Polling
> Requires `Python 3.*`.
## Usage
cd limaju
### Via STDIN
cat examples/judgments_01.csv | ./limaju.py
### Via argument
./limaju.py --input examples/judgments_01.csv
### With custom mentions
./limaju.py \
--input examples/judgments_02.csv \
--mentions examples/mentions_02 \
--skip-cols 1
## Mentions
Mentions are ordered. Topmost wins.
You may provide your own mentions in the configuration file.
#### config.yml
```yaml
mentions:
- name: EXCELLENT
- name: VERY GOOD
- name: GOOD
color: #ff3399
- name: SOMEWHAT GOOD
- name: PASSABLE
- name: POOR
- name: REJECT
```
Mentions are ordered. Topmost wins. Case matters.
### Defaults
EXCELLENT
VERY GOOD
GOOD
SOMEWHAT GOOD
PASSABLE
POOR
REJECT
## Input Vote Data
......@@ -75,10 +90,6 @@ PASSABLE,PASSABLE,REJECT,GOOD,PASSABLE,VERY GOOD
```
## Usage
cat votes.csv | limaju.py -c config.yml
......
Timestamp,un Tyran Sanguinaire serait …,mon Chien préféré serait …,un Écologiste Décroissant serait …,un Capitaliste Prédateur serait …,un Humaniste Candide serait …,un Imposteur Crapuleux serait …,un Nationaliste Identitaire serait …,un Camarade Communiste serait …,une Citoyenne nommée Marianne tirée au hasard dans la population serait …
Timestamp,Tyran Sanguinaire,Chien,Écologiste Décroissant,Capitaliste Prédateur,Humaniste Candide,Imposteur Crapuleux,Nationaliste Identitaire,Camarade Communiste,Marianne
12/8/2019 12:33:54,insuffisant⋅e,excellent⋅e,excellent⋅e,à rejeter,très bien,passable,à rejeter,très bien,excellent⋅e
12/8/2019 12:58:36,à rejeter,excellent⋅e,à rejeter,à rejeter,excellent⋅e,à rejeter,bien,à rejeter,excellent⋅e
12/8/2019 13:19:19,à rejeter,insuffisant⋅e,très bien,à rejeter,insuffisant⋅e,à rejeter,à rejeter,insuffisant⋅e,très bien
......
#!/usr/bin/env python
"""
A tool to summarize majority judgment polling.
"""
__author__ = "Constituantes"
......@@ -17,7 +15,6 @@ import math
import copy
from io import StringIO
from functools import cmp_to_key
# import pandas
VERBOSITY_NONE = 0
......@@ -233,8 +230,8 @@ def main(args):
)
for i, candidate in enumerate(sorted_candidates):
log("%02d. %14s %s" % (
i,
log("%02d. %18s %s" % (
i+1,
get_median(judgments_tallies[candidate], mentions),
candidate,
))
......@@ -255,15 +252,6 @@ if __name__ == "__main__":
# help=""
# )
# Optional argument which requires a parameter (eg. -d test)
# parser.add_argument(
# "-c",
# "--config",
# action="store",
# dest="config",
# help="A configuration file in YML."
# )
# Input CSV file. Overrides stdin when provided.
parser.add_argument(
"-i",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment