Skip to content

Commit

Permalink
_extract_edge_bearings format: lines v indents
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Mar 16, 2024
1 parent 9b04473 commit 6ca5352
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions osmnx/bearing.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,10 @@ def _extract_edge_bearings(
bearings = []
weights = []
for u, v, data in G.edges(data=True):
if u == v or data["length"] < min_length:
# ignore self-loops and any edges below min_length
continue
bearings.append(data["bearing"])
weights.append(data[weight] if weight is not None else 1.0)
# ignore self-loops and any edges below min_length
if u != v and data["length"] >= min_length:
bearings.append(data["bearing"])
weights.append(data[weight] if weight is not None else 1.0)

# drop any nulls
bearings_array = np.array(bearings)
Expand Down

0 comments on commit 6ca5352

Please sign in to comment.