Code Monkey home page Code Monkey logo

Comments (1)

bsmithgall avatar bsmithgall commented on August 26, 2024

Hello! I was poking around some of the open elections code looking for ways to contribute this weekend and found this. I am entirely new to the world of open elections so this might be off-base, but I did some research about Sarpy county in particular and found the following:

  1. There are three things that are considered to be <Precinct> elements in a particular <VoteType> underneath a <Contest> in the given election above (2014 General Election) that do not appear in the list of Precincts underneath VoterTurnout: ABSENTEE, Nonpartisan-Partisan, and Nonpartisan-Partisan 2. ABSENTEE has no votes in the entire county, but the other ones do have some:

    grep '"ABSENTEE" votes=' test.xml | grep -v '"0"' | wc -l
           0
    
    grep '"Nonpartisan-Partisan"' test.xml | grep -v '"0"' | wc -l
          63
    
    grep '"Nonpartisan-Partisan"' test.xml | grep -v '"0"' | head -n5
            <Precinct name="Nonpartisan-Partisan" votes="1"/>
                <Precinct name="Nonpartisan-Partisan" votes="5"/>
                <Precinct name="Nonpartisan-Partisan" votes="30"/>
                <Precinct name="Nonpartisan-Partisan" votes="7"/>
                <Precinct name="Nonpartisan-Partisan" votes="43"/>

    Since the parser uses the XPATH at /ElectionResult/VoterTurnout/Precincts/Precinct to figure out what to consider to store in _result_jurisdictions, the whole thing would blow up when it finds any of the above. This same thing happens in the 2016 primary.

  2. Oddly enough, summing ballotsCast attributes of the precincts found under the /ElectionResult/VoterTurnout/Precincts/Precinct XPATH match the ballotsCast attribute of the VoterTurnout (which is probably calculated from summing the individual precincts. This leads the broader question of where the ballots considered under the Nonpartisan-Partisan name are counted.

  3. The most recent election to appear on the list of election results[0] (the 2016 general election[1]) have Precincts that are not prefaced by "Precinct," but those do appear in the list of Precincts that ultimately ends up in the parser's _result_jurisdictions. This combination of things leads me to believe that it was probably a bug in whatever report generation engine that created the XML file that has (maybe?) since been fixed.

This leaves the question of what to do. I notice that when a new ResultJurisdiction is created (such as on parser#146[2]), it's initialized with all of the aggregated data coming directly out of
/ElectionResult/VoterTurnout/Precincts/Precinct. It seems like there is an edge case where we don't have that pre-built aggregation, so maybe the solution would be to add some methods to the ResultJurisdiction object that would let us build that manually? This would fix the issue but perhaps create another one where we would have invalid ballot counts (or at least counts that seem to contradict the final results?) so I would love some extra input on where to go.

[0] http://www.sarpy.com/election/election_results.html
[1] http://results.enr.clarityelections.com/NE/Sarpy/64652/184054/en/summary.html
[2] https://github.com/openelections/clarify/blob/master/clarify/parser.py#L146

from clarify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.