Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesL2 committed Nov 13, 2024
1 parent fb33b5d commit 9d5351e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pretty_gpx/common/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ def generate_unique_strings(n_min: int) -> Iterator[str]:
q = n_min // len(string.ascii_lowercase) + 1
for size in itertools.count(q):
for s in itertools.product(string.ascii_lowercase, repeat=size):
yield "".join(s)
yield "".join(s)
4 changes: 0 additions & 4 deletions pretty_gpx/rendering_modes/city/data/city_road_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ class RoadTypeData:
assert list(ROAD_TYPE_DATA.keys()) == sorted(ROAD_TYPE_DATA.keys(),
key=lambda road_type: ROAD_TYPE_DATA[road_type].priority)

ROAD_PRIORITY = {
str(road.priority):road.priority for road in ROAD_TYPE_DATA.values()
}


def get_city_roads_with_priority_better_than(x: int) -> list[CityRoadType]:
"""Returns a list of CityRoadType with a priority better than the given x."""
Expand Down
4 changes: 2 additions & 2 deletions pretty_gpx/rendering_modes/city/data/roads.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def process_city_roads(query: OverpassQuery,
cache_pkl = ROADS_CACHE.get_path(bounds)
write_pickle(cache_pkl, roads)
query.add_cached_result(ROADS_CACHE.name, cache_file=cache_pkl)
return roads
elif query.is_cached(ROADS_CACHE.name):
cache_file = query.get_cache_file(ROADS_CACHE.name)
roads = read_pickle(cache_file)
return read_pickle(cache_file)
else:
raise FileNotFoundError("Query is supposed to be cached but it is not.")
return roads

0 comments on commit 9d5351e

Please sign in to comment.