GithubHelp home page GithubHelp logo

Comments (2)

da115115 avatar da115115 commented on June 17, 2024

Thanks @alexprengere!

Yes, that happens when the POR are unknown from both OpenTravelData (opentraveldata/optd_por_best_known_so_far.csv CSV file) and Geonames. A time-zone code is then assigned based only on the country (as seen in the opentraveldata/optd_tz_light.csv CSV file) by the tools/extract_non_geonames_por.awk AWK script.

As some countries span multiple time-zones, that process may be refined thanks to the opentraveldata/optd_por_tz.csv CSV file, as seen in the tools/extract_non_geonames_por.awk AWK script again.

But, at that stage, rather than adding an entry to the opentraveldata/optd_por_tz.csv CSV file, it is much better to add the POR in Geonames and in OpenTravelData (opentraveldata/optd_por_best_known_so_far.csv CSV file)... which I have done for both the POR you mentioned above :)
So, the issue should have been fixed.

Could you please give the script which you have run in order to find out that issue?

Also, please do not hesitate to contribute to the Service Delivery Quality (SDQ) project, which is a collection of QA scripts in Python for monitoring the quality of the OpenTravelData data.

from opentraveldata.

alexprengere avatar alexprengere commented on June 17, 2024

I just checked the latest file, the issue is fixed indeed.

The code I used is part of the NeoBase test suite. To create a Neobase instance from a specific optd file, you can either set the environment variable OPTD_POR_FILE, or use NeoBase(open(filename)).

Here is an extraction of those tests in an independant script that checks both timezones and geocodes.

import pytz

def test_timezones(base):
    for por in base:
        tz = base.get(por, 'timezone')
        try:
            pytz.timezone(tz)
        except pytz.exceptions.UnknownTimeZoneError:
            print('Unknown timezone for {0} ({1})'.format(por, tz))


def test_geocodes(base):
    for por in base:
        if base.get_location(por) is None:
            print('Missing geocode for {0}'.format(por))


if __name__ == '__main__':
    from neobase import NeoBase
    test_timezones(NeoBase())
    test_geocodes(NeoBase())

You need to install the latest pytz, otherwise you might get false positives. Then run the tests with:

OPTD_POR_FILE=./optd_por_public.csv python test.py

from opentraveldata.

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.