On 2015-03-28 06:34, Alan D. Cabrera wrote:
On Mar 27, 2015, at 10:25 PM, Alan D. Cabrera <[email protected]> wrote:


On Mar 24, 2015, at 7:07 PM, Daniel Gruno <[email protected]> wrote:

Right, so I went a bit on a rampage, so we now have:
- Single Transferable Vote
- Yes/No/Abstain
- D'Hont / Jefferson voting
- Multiple Non-Transferable Votes (Plurality-at-large)
- First Past the Post (whoever gets most votes wins, Prez elections etc)

all with setup, editing, voting, tallying in working condition.
Pretty cool.

Is this really a plugin architecture?  If so, can you provide some details?
Ok, I just finished scanning the code.  You may want to consider Python entry 
points as a basis for the plugins framework.

http://pylons-webframework.readthedocs.org/en/latest/advanced_pylons/entry_points_and_plugins.html

Hi Alan,
I will most definitely consider this an option :)

It was never my intention to start out with the Perfect Plugin (I'm too much of a fuzzyhead for that). I wanted to do a proof of concept on pySTeVe that would....work, and then start looking at making it smarter put together and well documented, which is something I'll start doing over the next week or so. This was about transferring some ideas from a light bulb over my head and down on paper.

I can imagine the file-based and ES-based features being put into separate "plugins"/libs so as to make election.py more abstract and easier to follow, and I intend to look into that....but I also really wanted to see "can this be done so that it will work with minimal setting up, set pySTeVe apart from our legacy code, and not break a gajillion times when you use it?".

I can also definitely see the various vote libs being way way more easy to grok from a "yeah, but what does this thing do?" point of view, and that's also something I'll be moving towards (coupled to the note below).

Last but not least, I have some glossaries and wikis on my TODO list, actually explaining how the various voting systems work, which is where I'm hoping Rich can help me out :)

With regards,
Daniel.


On 2015-03-24 23:00, Daniel Gruno wrote:
I thought I'd write a note on what I am currently working on in pysteve, which 
is turning each vote type into a module/plugin.
This is not a complete API yet, but if you look at the libs/plugins dir, you 
should get the gist of what I'm trying to do; making validation and tallying a 
function native to the plugins instead of trying to pull everything into 
election.py. This way we can add new vote types as we see fit, and people can 
enable/disable what they want to use.

There is still some work left, as different vote types have different data 
fields associated with them, and I expect to be able to address that in the 
coming days. This will likely mean breaking the previously established JSON 
structure a bit.

I've also added the D'Hondt (Jefferson) based voting system to the list of 
supported votes types, and I plan to add more vote types as the days go by.

WIth regards,
Daniel.

Reply via email to