Giter Club home page Giter Club logo

addok-geozones's Issues

Add a license

The repository does not have a license while it should.

Successors pointing to null

Traceback (most recent call last):
  File "/home/ybon/.virtualenvs/geozone/bin/addok", line 11, in <module>
    sys.exit(main())
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/bin/__init__.py", line 30, in main
    args.func(args)
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/shell.py", line 478, in invoke
    cmd.loop()
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/shell.py", line 74, in loop
    self.cmdloop()
  File "/usr/lib64/python3.6/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib64/python3.6/cmd.py", line 216, in onecmd
    return self.default(line)
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/shell.py", line 66, in default
    return self.do_SEARCH(line)
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/shell.py", line 196, in do_SEARCH
    self._search(query)
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/shell.py", line 166, in _search
    results = helper(query, lat=lat, lon=lon, **filters)
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/core.py", line 169, in __call__
    return self.render()
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/core.py", line 183, in render
    self.convert()
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/core.py", line 230, in convert
    processor(self, result)
  File "/home/ybon/Code/py/addok-geozones/addok_geozones/utils.py", line 32, in follow_successor
    successor = Result.from_id(id)
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/core.py", line 107, in from_id
    return Result(dbkeys.document_key(_id))
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/core.py", line 35, in __init__
    self.load(_id)
  File "/home/ybon/.virtualenvs/geozone/lib/python3.6/site-packages/addok/core.py", line 45, in load
    raise ValueError('id "{}" not found'.format(doc_or_id[2:]))
ValueError: id "fr:commune:27049@2016-01-01" not found

When searching for "épinay" with latest dataset.
Having a quick look at it, it seems that the bug appears because some city have a successor which has a successor itself, so the first target does not exist in the dataset.
I'll work around for now, to prevent a crash.

cc @davidbgk

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.