From cdea81e3e67ae0347e5f7e37b882e31c1d074d35 Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Mon, 3 Dec 2018 03:11:41 -0500 Subject: [PATCH 01/10] Sort colocated waypoint lists --- siteupdate/python-teresco/siteupdate.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 3f85a266..1243fdaa 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -1155,8 +1155,6 @@ def __init__(self,waypoint_list,datacheckerrors): hid_list.append(w) else: vis_list.append(w) - vis_list.sort(key=lambda waypoint: waypoint.route.root + "@" + waypoint.label) - hid_list.sort(key=lambda waypoint: waypoint.route.root + "@" + waypoint.label) datacheckerrors.append(DatacheckEntry(vis_list[0].route,[vis_list[0].label],"VISIBLE_HIDDEN_COLOC", hid_list[0].route.root+"@"+hid_list[0].label)) @@ -1589,8 +1587,9 @@ def __init__(self, all_waypoints, highway_systems, datacheckerrors): vinfo.is_hidden = False continue if len(vinfo.incident_collapsed_edges) > 2: - dc_waypoint = sorted(vinfo.first_waypoint.colocated, key=lambda waypoint: waypoint.route.root + "@" + waypoint.label)[0] - datacheckerrors.append(DatacheckEntry(dc_waypoint.route,[dc_waypoint.label],"HIDDEN_JUNCTION",str(len(vinfo.incident_collapsed_edges)))) + datacheckerrors.append(DatacheckEntry(vinfo.first_waypoint.colocated[0].route, + [vinfo.first_waypoint.colocated[0].label], + "HIDDEN_JUNCTION",str(len(vinfo.incident_collapsed_edges)))) vinfo.is_hidden = False continue # construct from vertex_info this time @@ -2158,6 +2157,11 @@ def run(self): print(et.et() + "Sorting waypoints in Quadtree.") all_waypoints.sort() +print(et.et() + "Sorting colocated point lists.") +for w in all_waypoints.point_list(): + if w.colocated is not None: + w.colocated.sort(key=lambda waypoint: waypoint.route.root + "@" + waypoint.label) + print(et.et() + "Finding unprocessed wpt files.", flush=True) unprocessedfile = open(args.logfilepath+'/unprocessedwpts.log','w',encoding='utf-8') if len(all_wpt_files) > 0: From 850e4a71870413f4ecc932c600904de9613f5e23 Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Fri, 7 Dec 2018 04:10:25 -0500 Subject: [PATCH 02/10] qtdebug fix --- siteupdate/python-teresco/siteupdate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 1243fdaa..92cc7013 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -77,8 +77,8 @@ def insert(self,w): #print("QTDEBUG: " + str(self) + " insert " + str(w)) if self.points is not None: if self.waypoint_at_same_point(w) is None: + #print("QTDEBUG: " + str(self) + " at " + str(self.unique_locations) + " unique locations") self.unique_locations += 1 - #print("QTDEBUG: " + str(self) + " has " + str(self.unique_locations) + " unique locations") self.points.append(w) if self.unique_locations > 50: # 50 unique points max per quadtree node self.refine() From 12f00bd9ef3378394dff9de74b8e7de10c345932 Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Mon, 10 Dec 2018 00:50:08 -0500 Subject: [PATCH 03/10] nearmatchfps.log formatting --- siteupdate/python-teresco/siteupdate.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 92cc7013..c4e918da 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -3202,9 +3202,8 @@ def run(self): toremove.append(fp) break if d.match_except_info(fp): - fpfile.write("DCERROR: " + str(d) + "\n") - fpfile.write("FPENTRY: " + fp[0] + ';' + fp[1] + ';' + fp[2] + ';' + fp[3] + ';' + fp[4] + ';' + fp[5] + '\n') - fpfile.write("REPLACEWITH: " + fp[0] + ';' + fp[1] + ';' + fp[2] + ';' + fp[3] + ';' + fp[4] + ';' + d.info + '\n') + fpfile.write("FP_ENTRY: " + fp[0] + ';' + fp[1] + ';' + fp[2] + ';' + fp[3] + ';' + fp[4] + ';' + fp[5] + '\n') + fpfile.write("CHANGETO: " + fp[0] + ';' + fp[1] + ';' + fp[2] + ';' + fp[3] + ';' + fp[4] + ';' + d.info + '\n') fpfile.close() # now remove the ones we matched from the list From ed5e912dd5b0f33a5c89e8cf677352246757faed Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Mon, 10 Dec 2018 01:47:12 -0500 Subject: [PATCH 04/10] use .list line formatting in str(HighwaySegment) --- siteupdate/python-teresco/siteupdate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index c4e918da..28afbcf1 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -601,8 +601,7 @@ def __init__(self,w1,w2,route): self.segment_name = None def __str__(self): - return self.waypoint1.label + " to " + self.waypoint2.label + \ - " via " + self.route.root + return self.route.region + " " + self.route.route + " " + self.waypoint1.label + " " + self.waypoint2.label def add_clinched_by(self,traveler): if traveler not in self.clinched_by: From eccdb9b983447d54686d0179bd1c70224ef9c501 Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Mon, 10 Dec 2018 01:55:38 -0500 Subject: [PATCH 05/10] remove unused strings in Route and ConnectedRoute --- siteupdate/python-teresco/siteupdate.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 28afbcf1..8be0f163 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -672,7 +672,6 @@ class Route: def __init__(self,line,system,el): """initialize object from a .csv file line, but do not yet read in waypoint file""" - self.line = line fields = line.split(";") if len(fields) != 8: el.add_error("Could not parse csv line: [" + line + @@ -800,7 +799,6 @@ class ConnectedRoute: def __init__(self,line,system,el): """initialize the object from the _con.csv line given""" - self.line = line fields = line.split(";") if len(fields) != 5: el.add_error("Could not parse _con.csv line: [" + line + From d0cca48a2fd648a795490040eabb275ffe7e7a78 Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Mon, 10 Dec 2018 02:11:22 -0500 Subject: [PATCH 06/10] ConnectedRoute.mileage comment --- siteupdate/python-teresco/siteupdate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 8be0f163..85317868 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -830,7 +830,7 @@ def __init__(self,line,system,el): rootOrder += 1 if len(self.roots) < 1: el.add_error("No roots in _con.csv line [" + line + "]") - # will be computed for routes in active systems later + # will be computed for routes in active & preview systems later self.mileage = 0.0 def csv_line(self): From 6b2688c800ba0d8661f4aacc142335cb7a67888e Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Mon, 10 Dec 2018 12:40:53 -0500 Subject: [PATCH 07/10] Duplicate root in con_route: variable names --- siteupdate/python-teresco/siteupdate.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 85317868..9854220e 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -2025,12 +2025,12 @@ def __init__(self,filename,descr,vertices,edges,format,category): con_roots = set() for h in highway_systems: - for r in h.con_route_list: - for cr in r.roots: - if cr.root in con_roots: - el.add_error("Duplicate root in con_route lists: " + cr.root) + for cr in h.con_route_list: + for r in cr.roots: + if r.root in con_roots: + el.add_error("Duplicate root in con_route lists: " + r.root) else: - con_roots.add(cr.root) + con_roots.add(r.root) # Make sure every route was listed as a part of some connected route if len(roots) == len(con_roots): From 6c8512ab91dff5436b63ef470e18940047166192 Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Mon, 10 Dec 2018 13:03:41 -0500 Subject: [PATCH 08/10] simplify duplicate list name reporting --- siteupdate/python-teresco/siteupdate.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 9854220e..997a4433 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -2053,14 +2053,9 @@ def __init__(self,filename,descr,vertices,edges,format,category): # report any duplicate list names as errors if len(duplicate_list_names) > 0: - print("Found " + str(len(duplicate_list_names)) + " DUPLICATE_LIST_NAME cases.") - num_found = 0 - for h in highway_systems: - for r in h.route_list: - if r.region + ' ' + r.list_entry_name() in duplicate_list_names: - el.add_error("Duplicate list name: " + r.region + ' ' + r.list_entry_name()) - num_found += 1 - print("Added " + str(num_found) + " DUPLICATE_LIST_NAME error entries.") + print("Found " + str(len(duplicate_list_names)) + " DUPLICATE_LIST_NAME case(s).") + for d in duplicate_list_names: + el.add_error("Duplicate list name: " + d) else: print("No duplicate list names found.") From 81d87af819c9270e69f0c2d9724631e04575e41f Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Thu, 13 Dec 2018 13:40:31 -0500 Subject: [PATCH 09/10] remove unused arg from TravelerList constructor --- siteupdate/python-teresco/siteupdate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 997a4433..5b051d4b 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -927,7 +927,7 @@ class TravelerList: start_waypoint end_waypoint """ - def __init__(self,travelername,systems,route_hash,path="../../../UserData/list_files"): + def __init__(self,travelername,route_hash,path="../../../UserData/list_files"): self.list_entries = [] self.clinched_segments = set() self.traveler_name = travelername[:-5] @@ -2280,7 +2280,7 @@ def run(self): for t in traveler_ids: if t.endswith('.list'): print(" " + t,end="",flush=True) - traveler_lists.append(TravelerList(t,highway_systems,route_hash,args.userlistfilepath)) + traveler_lists.append(TravelerList(t,route_hash,args.userlistfilepath)) print(" processed " + str(len(traveler_lists)) + " traveler list files.") # Read updates.csv file, just keep in the fields array for now since we're From dc8a05c0968abaee8b136305c5e5118fdcdbb84c Mon Sep 17 00:00:00 2001 From: Eric Bryant Date: Fri, 14 Dec 2018 14:27:06 -0500 Subject: [PATCH 10/10] fix str(HighwaySegment) done incorrectly in ed5e912dd5b0f33a5c89e8cf677352246757faed --- siteupdate/python-teresco/siteupdate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/siteupdate/python-teresco/siteupdate.py b/siteupdate/python-teresco/siteupdate.py index 5b051d4b..874e63c3 100755 --- a/siteupdate/python-teresco/siteupdate.py +++ b/siteupdate/python-teresco/siteupdate.py @@ -601,7 +601,7 @@ def __init__(self,w1,w2,route): self.segment_name = None def __str__(self): - return self.route.region + " " + self.route.route + " " + self.waypoint1.label + " " + self.waypoint2.label + return self.route.readable_name() + " " + self.waypoint1.label + " " + self.waypoint2.label def add_clinched_by(self,traveler): if traveler not in self.clinched_by: