-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance plots in get_osm_data
script
#266
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #266 +/- ##
=======================================
Coverage 90.50% 90.50%
=======================================
Files 37 37
Lines 4908 4908
Branches 454 454
=======================================
Hits 4442 4442
Misses 466 466
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -16,12 +16,16 @@ | |||
import ast | |||
import logging | |||
from pathlib import Path | |||
from matplotlib import pyplot as plt |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'matplotlib' (import-error) Warning
import osmnx as ox | ||
from tqdm import tqdm |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'tqdm' (import-error) Warning
@@ -128,18 +132,21 @@ | |||
else: | |||
CUSTOM_FILTER = f"[\"highway\"~\"{'|'.join(FLAGS)}\"]" | |||
logging.info("Custom filter: %s", CUSTOM_FILTER) | |||
GRAPH = ox.graph_from_place(parser.place, network_type="drive") | |||
FULL_GRAPH = ox.graph_from_place(parser.place, network_type="drive") | |||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "ax" doesn't conform to UPPER_CASE naming style Warning
@@ -128,18 +132,21 @@ | |||
else: | |||
CUSTOM_FILTER = f"[\"highway\"~\"{'|'.join(FLAGS)}\"]" | |||
logging.info("Custom filter: %s", CUSTOM_FILTER) | |||
GRAPH = ox.graph_from_place(parser.place, network_type="drive") | |||
FULL_GRAPH = ox.graph_from_place(parser.place, network_type="drive") | |||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "fig" doesn't conform to UPPER_CASE naming style Warning
@@ -160,13 +170,50 @@ | |||
len(GRAPH.edges), | |||
) | |||
# plot graph on a 16x9 figure and save into file | |||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "fig" doesn't conform to UPPER_CASE naming style Warning
@@ -160,13 +170,50 @@ | |||
len(GRAPH.edges), | |||
) | |||
# plot graph on a 16x9 figure and save into file | |||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "ax" doesn't conform to UPPER_CASE naming style Warning
for full_edge in tqdm(FULL_GRAPH.edges) | ||
] | ||
|
||
node_colors = [ |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "node_colors" doesn't conform to UPPER_CASE naming style Warning
RGBA_RED if node not in GRAPH.nodes else RGBA_WHITE | ||
for node in FULL_GRAPH.nodes | ||
] | ||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "ax" doesn't conform to UPPER_CASE naming style Warning
RGBA_RED if node not in GRAPH.nodes else RGBA_WHITE | ||
for node in FULL_GRAPH.nodes | ||
] | ||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "fig" doesn't conform to UPPER_CASE naming style Warning
for i in range(len(gdf_edges)) | ||
] | ||
edge_line_width = [ |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "edge_line_width" doesn't conform to UPPER_CASE naming style Warning
edge_line_width = [ | ||
2 if duplicated_mask.iloc[i] else 0.5 for i in range(len(gdf_edges)) | ||
] | ||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "ax" doesn't conform to UPPER_CASE naming style Warning
edge_line_width = [ | ||
2 if duplicated_mask.iloc[i] else 0.5 for i in range(len(gdf_edges)) | ||
] | ||
fig, ax = plt.subplots(figsize=(24, 24)) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "fig" doesn't conform to UPPER_CASE naming style Warning
No description provided.