Skip to content
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

Merged
merged 2 commits into from
Feb 13, 2025
Merged

Enhance plots in get_osm_data script #266

merged 2 commits into from
Feb 13, 2025

Conversation

Grufoony
Copy link
Collaborator

No description provided.

@Grufoony Grufoony merged commit f2c151e into main Feb 13, 2025
16 checks passed
@Grufoony Grufoony deleted the betterPlot branch February 13, 2025 11:02
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.50%. Comparing base (0a921de) to head (796261b).
Report is 1 commits behind head on main.

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           
Flag Coverage Δ
unittests 90.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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

Unable to import 'matplotlib' (import-error)
import osmnx as ox
from tqdm import tqdm

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'tqdm' (import-error) Warning

Unable to import 'tqdm' (import-error)
@@ -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

Constant name "ax" doesn't conform to UPPER_CASE naming style
@@ -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

Constant name "fig" doesn't conform to UPPER_CASE naming style
@@ -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

Constant name "fig" doesn't conform to UPPER_CASE naming style
@@ -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

Constant name "ax" doesn't conform to UPPER_CASE naming style
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

Constant name "node_colors" doesn't conform to UPPER_CASE naming style
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

Constant name "ax" doesn't conform to UPPER_CASE naming style
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

Constant name "fig" doesn't conform to UPPER_CASE naming style
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

Constant name "edge_line_width" doesn't conform to UPPER_CASE naming style
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

Constant name "ax" doesn't conform to UPPER_CASE naming style
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

Constant name "fig" doesn't conform to UPPER_CASE naming style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant