Code Monkey home page Code Monkey logo

Comments (4)

Kirkman avatar Kirkman commented on August 26, 2024

I was using clarify 0.4.0 installed via pip.

It looks like the most recent commit (f9bfb09) in this repo solves my issue.

However, I also found that, in 0.4.0, simply deleting the second line here ...

            for subjurisdiction_el in vt_el.xpath('./Precinct') + vt_el.xpath('./County'):
                subjurisdiction = self.get_result_jurisdiction(subjurisdiction_el.attrib['name'])
                subjurisdiction = self._get_or_create_result_jurisdiction(subjurisdiction_el)

...resolved the issue as well.

from clarify.

dwillis avatar dwillis commented on August 26, 2024

Oh, interesting, thanks!

from clarify.

Kirkman avatar Kirkman commented on August 26, 2024

Do you anticipate a version bump for Clarify soon on PyPi incorporating that change?

from clarify.

jlkravitz avatar jlkravitz commented on August 26, 2024

I seem to be having a similar issue. I'm trying to parse Fort Bend County, TX results
, and there are a few odd precinct names. Here is the output I get from the parser:

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 51, in parse
self._contests = self._parse_contests(tree)
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 284, in _parse_contests
return [self._parse_contest(el) for el in contest_els]
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 284, in
return [self._parse_contest(el) for el in contest_els]
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 312, in _parse_contest
for c in self._parse_choices(contest_el, contest):
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 369, in _parse_choices
return [self._parse_choice(c_el, contest)
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 369, in
return [self._parse_choice(c_el, contest)
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 409, in _parse_choice
subjurisdiction = self.get_result_jurisdiction(subjurisdiction_el.attrib['name'])
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 219, in get_result_jurisdiction
return self._result_jurisdiction_lookup[name]
KeyError: '1134 M68'

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.