Skip to content

Subset of site update process to verify highway data changes #73

Closed

Description

@jteresco

Idea: add an option to the site update program that only does enough to find common mistakes in highway data. No graphs would need to be generated, user list files would not need to be fully processed, and no sql file would need to be generated.

Activity

  1. self-assigned this
    on May 13, 2018
  2. jteresco commented on May 20, 2018

    @jteresco
    ContributorAuthor

    This should read the updates.csv and systemupdates.csv and should generate a datacheck log file or other messages that can be used to find datacheck problems.

  3. michihdeu commented on May 20, 2018

    @michihdeu
    Contributor

    More requirements:

    • Log of Data Errors (without FPs) It would be great if the datacheck log mentioned by Jim would output errors without FPs so that one can directly find the relevant entries caused by one's latest update. The entry order should be alphabetically by region.
    • Log of Unmatched FPs from datacheckfps.csv
    • Log of Unprocessed WPTs in the Repository
    • Graph generation for a specific region The user should be able to enter a region code, e.g. "deu-rp". The output file can be manually load to HDX for checking concurrencies et cetera; I think it should likely be a different command to be run

    That means, one must be able to download the file.

  4. yakra commented on May 20, 2018

    @yakra
    Contributor

    Log of Data Errors (without FPs) It would be great if the datacheck log mentioned by Jim would output errors without FPs so that one can directly find the relevant entries caused by one's latest update. The entry order should be alphabetically by region.

    Having the log file available to inspect immediately would be useful. I found myself wishing for this a couple times.
    http://tm.teresco.org/forum/index.php?topic=325

    Log of Unmatched FPs from datacheckfps.csv
    Log of Unprocessed WPTs in the Repository

    unmatchedfps.log and unprocessedwpts.log are produced by the full siteupdate.py, and stored in siteupdate/python-teresco. This functionality could be preserved in a "siteupdate-lite" program, possibly with a commandline switch to disable if it would result in significant time savings.

    Graph generation for a specific region The user should be able to enter a region code, e.g. "deu-rp". The output file can be manually load to HDX for checking concurrencies et cetera; I think it should likely be a different command to be run

    I'm more lukewarm on this personally. I think we'd be better off just running the full siteupdate.py here. The process can be sped up by editing systems.csv to only include the systems that would be relevant for such a graph. (E.G., for deu-rp, include only deua, deub, deurpl, & eure.)
    We'd just have to be sure to include at least one active and at least one preview system (#16).

  5. michihdeu commented on May 20, 2018

    @michihdeu
    Contributor

    This functionality could be preserved in a "siteupdate-lite" program, possibly with a commandline switch to disable if it would result in significant time savings.

    From the last update:

    [231.8] Performing data checks.
    [247.2] Marking datacheck false positives.
    [269.0] Writing log of unmatched datacheck FP entries.
    [269.0] Creating route hash table for list processing:

    37 seconds. Should be an option, e.g. "-d" to include it

  6. michihdeu commented on May 20, 2018

    @michihdeu
    Contributor

    The process can be sped up by editing systems.csv to only include the systems that would be relevant for such a graph. (E.G., for deu-rp, include only deua, deub, deurpl, & eure.)

    I also thought about this option but I don't like that we have to modify systems.csv because we must remember to undo it again. You can easily forget systems, e.g. of neighboring countries when you've synced wpts at borders. I don't think that it's clever to check data with a modified set of it.

    Well, I mean, Jim wrote that he wants to disable graph generation by default. If an option remains to generate (one or all) graphs, it's fine with me.

    I've mentioned it because we need an option to download the graph files.

  7. jteresco commented on May 20, 2018

    @jteresco
    ContributorAuthor

    My plan is to have the same information that's in the DB to populate the datacheck page, but produced in a plain text format useful to find the errors quickly.

  8. michihdeu commented on May 20, 2018

    @michihdeu
    Contributor

    My plan is to have the same information

    This!

    I think it's wise to avoid redundant data.

  9. jteresco commented on May 20, 2018

    @jteresco
    ContributorAuthor

    For a modified systems.csv, there's already an option you can use to limit to your own systems if you want. If you had a deu.csv in the same location as systems.csv, you could add

    -s deu.csv

    to your command line and it would only process systems listed there.

    I expect we'd run into some trouble trying to generate graphs when a small subset of the data is loaded.

  10. jteresco commented on May 20, 2018

    @jteresco
    ContributorAuthor

    I'm thinking the generation of the nmp_merged files can be left out for the error checking option on the site update program. Opinions?

  11. jteresco commented on May 20, 2018

    @jteresco
    ContributorAuthor

    I also think it's worth keeping in the user list file processing so points in use and unused alt label logs can be generated. That part of the process looks to take about 25 seconds on my Mac.

  12. michihdeu commented on May 20, 2018

    @michihdeu
    Contributor

    Good to know the -s option but again, I don't like it for data check because the result might be falsified if you do something wrong and the check should be used to find exactly these errors.

    NMP: I have no strong feeling on this. I currently pay no attention to it because of the difficult FP handling. And I forgot the details meanwhile. I wait for improvement: TravelMapping/Web#187. However, I think it's a very important data check! I partially do it manually now.

    Once NMP check will be fully integrated, it will be needed here to avoid broken concurrencies on the site.

    If user list file processing remains, only the subsequent things could be skipped to save time (plus graphs which were skipped last time):
    [326.3] Creating per-traveler stats log entries and augmenting data structure.
    [369.8] Writing traveler list logs.
    [370.1] Writing stats csv files.
    [370.3] SKIPPING generation of graphs.
    [370.3] Writing database file TravelMapping.sql.
    [382.7] Processed 292 highway systems.

  13. jteresco commented on May 20, 2018

    @jteresco
    ContributorAuthor

    Since those last ones are fairly quick, I've left them in so far.

    What are preferences for datacheck.log? Include matched FPs (labeled as such), put matched FPs in a separate log file, or ignore matched FPs? Right now, I have it generating lines like these:

    nv.nv599 JonBlvd VISIBLE_HIDDEN_COLOC nv.us095buslsv@+NV596
    FP chnnx.g70 +G22_W VISIBLE_HIDDEN_COLOC chnnx.g22@G70_W
    FP chngx.g72 +G65/G76 VISIBLE_HIDDEN_COLOC chngx.g65@G72_E
    isl.f235 ToHel VISIBLE_HIDDEN_COLOC isl.f235@+X20
    FP imn.ttcir Start VISIBLE_HIDDEN_COLOC imn.a002@+TTSF
    FP imn.ttcir Finish VISIBLE_HIDDEN_COLOC imn.a002@+TTSF
    az.us066hiskin +Coc/Yav VISIBLE_HIDDEN_COLOC az.az066@Coc/Yav
    mo.us066hisstl FR144 VISIBLE_HIDDEN_COLOC mo.mo266@+X01
    ca.us099hisind +PalmSprLim VISIBLE_HIDDEN_COLOC ca.ca111pal@PalmSprLim
    FP alb.a001 +X935790 +X557517 SH5 SHARP_ANGLE 153.23
    
  14. michihdeu commented on May 20, 2018

    @michihdeu
    Contributor

    It's just a log for contributors testing their latest changes. I would exclude FPs to keep it as simple as possible for contributors. Another log file for unmatched FPs.

  15. jteresco commented on May 20, 2018

    @jteresco
    ContributorAuthor

    The first version of the highway data check mode (-e flag) is up. Most often, it will be invoked through the new datacheck.sh script. Details are on an updated version of https://github.com/TravelMapping/DataProcessing/blob/master/RUNNING.md

  16. yakra commented on May 21, 2018

    @yakra
    Contributor

    I see via the forum that FPs are omitted.
    I agree with michih that they should be excluded. Keep it simple.

    ca.us099hisind +PalmSprLim VISIBLE_HIDDEN_COLOC ca.ca111pal@PalmSprLim
    FP alb.a001 +X935790 +X557517 SH5 SHARP_ANGLE 153.23

    I'd like to avoid this format -- I foresee pasting datacheck.log into LibreOffice and filtering it. Having the roots in different columns could complicate things a bit.

    I think I would prefer the same semicolon-separated format that's used to report FPs.


    I'm thinking the generation of the nmp_merged files can be left out for the error checking option on the site update program. Opinions?

    I have no use for, and would not miss them. I always check & edit NMPs manually.


    I expect we'd run into some trouble trying to generate graphs when a small subset of the data is loaded.

    Indeed. When I run siteupdate.py with only usaor & usari in systems.csv, I get:

    [10.4] Creating system data graphs.
    Traceback (most recent call last):
    File "./siteupdate.py", line 3071, in
    print(h.systemname + ' ', end="",flush=True)
    AttributeError: 'NoneType' object has no attribute 'systemname'

    because

        # We will create graph data and a graph file for only a few interesting
        # systems, as many are not useful on their own
        for hname in ['usai', 'usaus', 'cantch', 'eure']: # no usaor or usari here
            h = None
            for hs in highway_systems:                    # only usaor & usari here
                if hs.systemname == hname:                # thus systemname never equals hname
                    h = hs                                # thus this never happens
                    break
            print(h.systemname + ' ', end="",flush=True)  # h still == None

    ...Maybe something like?:

        # We will create graph data and a graph file for only a few interesting
        # systems, as many are not useful on their own
        hnames = ['usai', 'usaus', 'cantch', 'eure']
        for h in highway_systems:
            if h.systemname in hnames:
                print(h.systemname + ' ', end="",flush=True)
                # et cetera

    Does this look right; would it work? I only "learned" Python 4 days ago... :)

  17. michihdeu commented on May 21, 2018

    @michihdeu
    Contributor

    Does this look right; would it work? I only "learned" Python 4 days ago... :)

    I guess it's less a matter of Python language but more a matter of programming and data structure. Just by 2c

  18. michihdeu commented on May 21, 2018

    @michihdeu
    Contributor

    "The git pull makes sure you have the latest version of the site update program from the DataProcessing repository, and sh datacheck.sh does the real work."

    git pull also automatically updates UserData repository and my HighwayData! Please add it.

  19. michihdeu commented on May 21, 2018

    @michihdeu
    Contributor

    datacheck.sh runs well! It's very simple to be executed 🥇 👍

    I have some minor issues and requirements:

    1. Progress bar
    The program sometimes seems to stuck. It would be great to get a progress bar for all steps which can take longer than 3 or 5 seconds. Especially duplicate check at the beginning:

    • Checking for duplicate list names in routes, roots in routes and connected routes (103s)
    • Performing data checks (22s)
    • Marking datacheck fps (33s)
    • Computing stats (29s)

    2. I think there's an output issue:
    Augmenting travelers for detected concurrent segments seems to stuck but the final output shows that it stuck with Computing stats.
    Line2611:
    print(et.et() + "Computing stats.")
    -->
    print(et.et() + "Computing stats.",end="",flush=True)
    ?

    3. Output at the end
    Computing waypoint colocation stats, reporting all with 8 or more colocations
    Is this really important here? I think it's too much (useless) data and should be omit. The final line should be something like:
    Data check done! Congrats!

    4. File download
    I still don't know how to download the log files. Is there a (simple) way?

  20. jteresco commented on May 21, 2018

    @jteresco
    ContributorAuthor

    More on all of this a bit later, but a quick answer to 4 above. If you want to get familiar with a few more unix commands, you can view them right there on the server. But most likely, you want to install WinSCP, then use it to browse your files on the server. Connect with the same host name, login credentials and port number as you use with PuTTY, but now you will be presented with two panes of files. Your computer on one side, files on noreaster on the other. You can either download or click on remote files to bring them up in a simple editor. I'll update the instructions with this soon.

  21. michihdeu commented on May 21, 2018

    @michihdeu
    Contributor

    I think I would prefer the same semicolon-separated format that's used to report FPs.

    Exactly! The current datacheck.log format cannot be used to add lines to datacheckfps.csv - the only purpose of the file

    btw: WinSCP works fine. Thanks!

  22. jteresco commented on May 21, 2018

    @jteresco
    ContributorAuthor

    Almost everything above is fixed in the latest version I just pushed. Please give it a try!

  23. jteresco commented on May 21, 2018

    @jteresco
    ContributorAuthor

    I'm going to close this issue. Please open new ones for problems you find with the highway data test mode.

  24. michihdeu commented on May 22, 2018

    @michihdeu
    Contributor

    Looks fine. Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions