Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:davidbailey/dpd into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbailey committed Dec 15, 2023
2 parents a8552d1 + d8c82c4 commit 47e968a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ jobs:
run: pip install .
- name: Lint with black
run: black --check .
- name: Lint with isort
run: isort --check .
- name: Lint with bandit
run: bandit -r .
- name: Lint flake8
- name: Lint with flake8
run: flake8
- name: Test with pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion dpd/driving/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def from_ways(ways, crs, *args, **kwargs):
Note: this does a lenght calculation on an unknown crs. This may be inaccurate.
"""
ways_merged = linemerge(ways)
if type(ways_merged) == MultiLineString:
if isinstance(ways_merged, MultiLineString):
longest_length = 0
for way in ways_merged:
if way.length > longest_length:
Expand Down
2 changes: 1 addition & 1 deletion dpd/mechanics/move.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def move(acceleration, initial_velocity, time, max_speed=None):
final_velocity = initial_velocity + acceleration * time
if max_speed and final_velocity > max_speed:
if max_speed is not None and final_velocity > max_speed:
final_velocity = max_speed
time_accelerating = (final_velocity - initial_velocity) / acceleration
time_constant_speed = time - time_accelerating
Expand Down
2 changes: 1 addition & 1 deletion dpd/shapely/find_way_in_ways.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def find_way_in_ways(ways, points, buffer_distance=None):
for i in range(1, len(ways) + 1):
for linestring in combinations(ways, i):
linestring = linemerge(linestring)
if type(linestring) == LineString:
if isinstance(linestring, LineString):
if buffer_distance:
if all(
[
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ geonetworkx
geopandas
gtfs_kit
haversine
isort
ipfn
ipywidgets
matplotlib
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"geopandas",
"gtfs_kit",
"haversine",
"isort",
"ipfn",
"ipywidgets",
"matplotlib",
Expand Down
2 changes: 1 addition & 1 deletion tests/osm/test_osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dpd.osm import OSM

RELATION = 2351006
NAME = "Metro E Line: 7th Street/Metro Center → Downtown Santa Monica"
NAME = "Metro E Line: Atlantic → Downtown Santa Monica"


class TestOSM(unittest.TestCase):
Expand Down

0 comments on commit 47e968a

Please sign in to comment.