Comments (1)
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:
-
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 underneathVoterTurnout
:ABSENTEE
,Nonpartisan-Partisan
, andNonpartisan-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. -
Oddly enough, summing
ballotsCast
attributes of the precincts found under the/ElectionResult/VoterTurnout/Precincts/Precinct
XPATH match theballotsCast
attribute of theVoterTurnout
(which is probably calculated from summing the individual precincts. This leads the broader question of where the ballots considered under theNonpartisan-Partisan
name are counted. -
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)
- Fix subjurisdictions fetcher for new-style summary pages
- Additional usage examples for README
- Mock HTTP responses in tests
- Precinct lookup fails when precinct not in VoterTurnout element HOT 7
- _parse_url not producing the correct report detail URLs HOT 14
- Add support for JSON summary results HOT 2
- Add support for current_ver HOT 1
- Add CLI interface HOT 13
- url tests failing in test_jurisdiction (http / https issues) HOT 1
- Add support for getting elections from JSON HOT 2
- Install fails HOT 3
- Handle new-style "Web02" Clarity sites HOT 11
- UnknownTimezoneWarning HOT 2
- KeyError when precinct isn't listed under <precincts> HOT 4
- Stricter validation of constructor parameters HOT 1
- Fix broken unit test for parser
- New path versions
- Class for fetching, unzipping, parsing results
- Publish to PyPI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clarify.