{ "info": { "author": "David R. MacIver", "author_email": "david@drmaciver.com", "bugtrack_url": null, "classifiers": [], "description": "This is an implementation of the Majority Judgement voting procedure, as\nproposed by Michel Balinski and Rida Laraki in `A theory of measuring, electing\n, and ranking `_\n\nIt takes tallies of grades provided by voters and provides a python type to \nwrap them which is ordered according to the majority judgement order. \n\nFor example::\n\n x = MajorityJudgement([5, 5])\n y = MajorityJudgement([3, 7])\n assert x < y\n\nThe first is the grade for a candidate who has received 5 votes of 0 and 5 votes\nof 1. The second is a candidate with 3 votes of 0 and 7 of 1. As a result the \nmajority judgement procedure ranks the first candidate as being worse than the \nsecond candidate.\n\nIn the event that you want more information about the details of the voting,\nthe MajorityJudgement objects behave like the corresponding lists of grades\nassigned to them.\n\nSo for example::\n\n assert list(MajorityJudgement([2,2])) == [0,1,0,1]\n\nThe MajorityJudgement object can generally be used exactly like its \ncorresponding list of grades. In particular it supports all the container \nmethods in an efficient manner.\n\nInternally the implementation is rather different. It is encoded as a list of \nrepeating cycles. So the list\n\n [0, 0, 0, 1, 0, 1, 0, 1]\n\nis internally represented as \n\n [[[0], 3], [[1], 1], [[0, 1], 2]]\n\nThe representation we choose only ever builds cycles of length one or two: A \ncycle of length one is usually built when there is an unambiguous median, while\na cycle of length 2 will usually be built when the lower and upper medians are \ndifferent (this isn't entirely true. e.g. the list of votes [1,1,1,1] will not\nproduce any cycles of length 2, but it's a good rule of thumb)\n\nRather than building the whole list and then compressing, entire cycles are \nbuilt at once by working how large a run can be popped from the remaining votes\nand popping it all at once. This means that even very large populations of \nvoters may be efficiently worked with as the resulting lists are actually very\nsmall.\n\nThe comparisons too may be performed efficiently on this compressed\nrepresentation: Equality works straightforwardly in the sense that two equal\nvotes will produce two equal representations. Comparisons may be performed by \npopping common prefixes first: So if two lists both start with [x, n] and [x,m]\nthen we may throw away min(m,n) entries immediately rather than having to \niterate through.\n\nIt appears to be the case that all votes can be represented as a compressed \nlist of this form with very few cycles. I conjecture that it can be done in \nO(log(voters)), but have not verified this. Certainly in practice it seems to \nbe the case.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DRMacIver/majority-judgement-python", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "majorityjudgement", "package_url": "https://pypi.org/project/majorityjudgement/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/majorityjudgement/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/DRMacIver/majority-judgement-python" }, "release_url": "https://pypi.org/project/majorityjudgement/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "Implementation of majority judgement voting procedure", "version": "0.3.2" }, "last_serial": 1334072, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "aa7fbffe140604edf4287c0d1a8b541a", "sha256": "30a925e86c2859d10d03c059a0f16221dcd58eb40a0ca3b5ea232fe30fbcee5d" }, "downloads": -1, "filename": "majorityjudgement-0.0.1.tar.gz", "has_sig": false, "md5_digest": "aa7fbffe140604edf4287c0d1a8b541a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5970, "upload_time": "2013-02-17T16:40:56", "url": "https://files.pythonhosted.org/packages/52/f7/4227451a88bdda23fc92e88490a3f2014f298b85c97e47b91bfda24b6f68/majorityjudgement-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "344bad5d4ff46a8552482079cc61f385", "sha256": "a6e98a387d55297a32dd070d61960c885f567325e697ae0767df0cfac4bdb829" }, "downloads": -1, "filename": "majorityjudgement-0.0.2.tar.gz", "has_sig": false, "md5_digest": "344bad5d4ff46a8552482079cc61f385", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6001, "upload_time": "2013-02-17T16:47:51", "url": "https://files.pythonhosted.org/packages/6a/02/6ad1aef1bc2bd8104a9263f0ee9f5dd70f9e9fcf0d32d34c204ee9639837/majorityjudgement-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "6b5172b325f95c5aa66616c928feec14", "sha256": "cd42d358ffa4ba31026140284d95eff23187ed273488f848966f0f9bae802f4e" }, "downloads": -1, "filename": "majorityjudgement-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6b5172b325f95c5aa66616c928feec14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4512, "upload_time": "2013-02-17T17:51:16", "url": "https://files.pythonhosted.org/packages/61/23/9df0a98e2edb1cfd78e0259d2d2aa8878a40cf6b5632e97a4f418ff9fdb8/majorityjudgement-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "37ed9b70dca68ff37475dc80c2cf2495", "sha256": "7d356ce7ea53a4b7e58cec6bc60fe4a0029120262247368c09a2048d9518410e" }, "downloads": -1, "filename": "majorityjudgement-0.1.1.tar.gz", "has_sig": false, "md5_digest": "37ed9b70dca68ff37475dc80c2cf2495", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4872, "upload_time": "2013-02-18T19:38:48", "url": "https://files.pythonhosted.org/packages/82/94/24f89b9b33e207aa8c3c8c740b9e58aa4eb71c821b12b4d87be9c9fe937f/majorityjudgement-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a072300590ac616ae3b9d700618ebecd", "sha256": "8ecb1f5972e6f58e1690a0ba3b9a10067c98ca2ea33773ee3997bf62da3d7fc6" }, "downloads": -1, "filename": "majorityjudgement-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a072300590ac616ae3b9d700618ebecd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5259, "upload_time": "2013-02-18T22:29:37", "url": "https://files.pythonhosted.org/packages/ff/ba/3a1282dd3123bd11d25c0d8c68706ed2e5e307ce5bf53c458a68da08d707/majorityjudgement-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "eba126e6cc0b89df2fa25b0c20f661b6", "sha256": "792e87233cf8cbf5830b6d10b9ed3128508873e25b30714f60007d35449d54f4" }, "downloads": -1, "filename": "majorityjudgement-0.2.0.tar.gz", "has_sig": false, "md5_digest": "eba126e6cc0b89df2fa25b0c20f661b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6215, "upload_time": "2013-02-20T11:49:58", "url": "https://files.pythonhosted.org/packages/fb/90/39f68c2ad2f472bc3af22c9688078cfbabc0e417ea9a31e09005d4598bc7/majorityjudgement-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d9d02b344636194b0d71e2999d27eb16", "sha256": "1f2593c9188599ba0caddd5e265af30a5d1d2d331e19ea1311e22d2dc0254265" }, "downloads": -1, "filename": "majorityjudgement-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d9d02b344636194b0d71e2999d27eb16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5840, "upload_time": "2013-03-02T17:35:38", "url": "https://files.pythonhosted.org/packages/89/64/a3b6eebae5d79c33d2981af4522cd143d5f718d6baedbc49a4483ebd19c8/majorityjudgement-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "d7507317c967832e34d51bfc8569d1ea", "sha256": "71e3a2975bf39c96e353f96556b2e74789326415dfc9b2d7977ecc9c2b9a8912" }, "downloads": -1, "filename": "majorityjudgement-0.3.1.tar.gz", "has_sig": false, "md5_digest": "d7507317c967832e34d51bfc8569d1ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5864, "upload_time": "2013-03-13T10:23:45", "url": "https://files.pythonhosted.org/packages/25/b4/f7cbe664070060d00480eb65f3f3eba34821ac57db1f2f588d5b22017f83/majorityjudgement-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "5d8a08d0f444da63b396eaf32d74b0f3", "sha256": "7588bc3ecc341e95c2d0740961848d8b5eb352f5c56fce002addf06160e3adca" }, "downloads": -1, "filename": "majorityjudgement-0.3.2.tar.gz", "has_sig": false, "md5_digest": "5d8a08d0f444da63b396eaf32d74b0f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5285, "upload_time": "2014-12-07T10:39:53", "url": "https://files.pythonhosted.org/packages/9c/5d/a671e22c8ab59e6c94a5fac304dcd87a1246c203d09a1198d30b246b9490/majorityjudgement-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5d8a08d0f444da63b396eaf32d74b0f3", "sha256": "7588bc3ecc341e95c2d0740961848d8b5eb352f5c56fce002addf06160e3adca" }, "downloads": -1, "filename": "majorityjudgement-0.3.2.tar.gz", "has_sig": false, "md5_digest": "5d8a08d0f444da63b396eaf32d74b0f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5285, "upload_time": "2014-12-07T10:39:53", "url": "https://files.pythonhosted.org/packages/9c/5d/a671e22c8ab59e6c94a5fac304dcd87a1246c203d09a1198d30b246b9490/majorityjudgement-0.3.2.tar.gz" } ] }