From 9a66f784d06f02de35c8aacce037417711c1271e Mon Sep 17 00:00:00 2001 From: domi41 Date: Sun, 9 Aug 2020 02:34:58 +0200 Subject: [PATCH] feat: add the MJ plugin metadata and some docs Note that the doc was written first, as we followed the pattern: doc, test, code It was pretty nice, and it helped a lot. --- addons/majority_judgment/plugin.cfg | 7 ++++ addons/majority_judgment/plugin.gd | 64 +++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 addons/majority_judgment/plugin.cfg create mode 100644 addons/majority_judgment/plugin.gd diff --git a/addons/majority_judgment/plugin.cfg b/addons/majority_judgment/plugin.cfg new file mode 100644 index 0000000..e26dcd9 --- /dev/null +++ b/addons/majority_judgment/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Majority Judgment Poll Toolkit" +description="Majority Judgment poll resolution and display utilities." +author="MieuxVoter" +version="1.0" +script="plugin.gd" diff --git a/addons/majority_judgment/plugin.gd b/addons/majority_judgment/plugin.gd new file mode 100644 index 0000000..63d74b9 --- /dev/null +++ b/addons/majority_judgment/plugin.gd @@ -0,0 +1,64 @@ +tool +extends EditorPlugin + +""" + +Various utilities to help deliberate using Majority Judgment. + + +Examples +======== + +They are unit-tested using WAT. (see `tests/` directory) +WIP: Right now the `tests/` directory in not in the plugin itself. We aim to. + + +Features +======== + +A bunch of new References: + +- `MajorityJudgmentGrade` + A single grade, like Excellent or To Reject. + This is a class in order to handle localization. +- `MajorityJudgmentGrading` + An ordered list of `MajorityJudgmentGrade`, from worst to best. +- `MajorityJudgmentPoll` + Has a title, grades and candidates. +- `MajorityJudgmentCandidate` + A candidate in a poll, receiving judgments. +- `MajorityJudgmentParticipant` + Government of the People, by the People, for the People. +- `MajorityJudgmentJudgment` + A grade given by a judge to a candidate. +- `MajorityJudgmentTallier` + The algorithm computing the poll tally (and the order of candidates) + The default algorithm will follow Balinsky & Laraki suggestions + https://doi.org/10.1287/opre.2014.1269 + https://gargantua.polytechnique.fr/siatel-web/app/linkto/?objectId=DOCF002100000008000000000000095700000000 +- `MajorityJudgmentPollTally` + Output of the tallier above. Ordered candidate tallies, winner first. +- `MajorityJudgmentCandidateTally` + Amounts of judgments per grade for a specific candidate. + +They all are `class_name`d, so they are polluting the global namespace, +but their name should be unique enough, with the prefix `MajorityJudgment`. + +If it causes you pain, you're welcome to open an issue to discuss about it. + + +MajorityJudgmentLinearResultsControl +------------------------------------ +TODO + + +""" + + +#func _enter_tree(): +# add_custom_type("MajorityJudgmentLinearResultsControl", "Control", load("res://addons/majority_judgment/MajorityJudgmentLinearResultsControl.gd"), load("res://addons/majority_judgment/MajorityJudgmentLinearResultsControl.svg")) + + +#func _exit_tree(): +# remove_custom_type("MajorityJudgmentLinearResultsControl") +