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

For latest release #470

Merged
merged 30 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
44525c3
fixes errors on qgis (#417)
r-akemii May 26, 2023
a2a709b
runs examples (#422)
pedrocamargo Jun 26, 2023
b3d4e37
Update LICENSE.TXT (#427)
pedrocamargo Jun 29, 2023
79bf127
fix matrix indices for memory-only matrices (#425)
elfjes Jul 2, 2023
6a21f02
Pedro/cores skimming (#426)
pedrocamargo Jul 3, 2023
0807224
Updates assignment logging (#423)
r-akemii Jul 5, 2023
6a2088c
narrows coverage test (#429)
pedrocamargo Jul 5, 2023
9580ec6
moves openmatrix to a primary dependency (#431)
pedrocamargo Jul 10, 2023
e5a21f1
Updates software version for release
pedrocamargo Jul 10, 2023
91fd936
minor change to test CI
jamiecook Jul 23, 2023
3575b5b
Fix multiple classes not being presented in the returned d (#438)
Jake-Moss Aug 11, 2023
8a7a9ee
Update README.md (#439)
jamiecook Aug 11, 2023
3f6d2ed
Add implicit noexcept from Cython<3.0.0 (#440)
Jake-Moss Aug 18, 2023
0cd3d48
Disable select link (#443)
Jake-Moss Sep 4, 2023
b7c0775
Fix empty matrices not being saved (#444)
Jake-Moss Sep 8, 2023
039fee7
Matrix exports and deprecation warning (#435)
pedrocamargo Sep 8, 2023
477f397
Select link correctness fix (#447)
Jake-Moss Sep 29, 2023
a169b61
bumps up the version (#451)
pedrocamargo Oct 9, 2023
b51235b
Merge branch 'master' of github.com:AequilibraE/aequilibrae into develop
Oct 9, 2023
5d80d20
new version
Oct 9, 2023
4bfaede
Fix documentation bugs on latest (#456)
r-akemii Oct 13, 2023
a22cb49
PathResults.compute_path fix stale variables (#457)
Jake-Moss Oct 20, 2023
783eac9
Replaces triggers with check statements (#455)
pedrocamargo Nov 1, 2023
1bf9c1b
Adds zones and connectors (#461)
r-akemii Nov 4, 2023
4bb2435
Better import from OSM and description of bicycle & bus data in netwo…
jamiecook Nov 6, 2023
4073c67
Early exit Dijsktra's with path reuse (#466)
Jake-Moss Nov 17, 2023
e0d1c5d
Adds support for Python 3.12 (#453)
pedrocamargo Nov 22, 2023
3d7f017
Don't mark the path computation as `early_exit` when unreachable (#469)
Jake-Moss Nov 22, 2023
df559bf
Initial A* implementation (#467)
Jake-Moss Nov 25, 2023
edc5453
Merge branch 'master' into merge_develop_into_master
pedrocamargo Nov 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ max-line-length = 120
ignore = E203, E266, E501, W503, F403, F401, C901, W605
max-complexity = 20
select = B,C,E,F,W,T4,B9
exclude = .idea,.git,__pycache__,sphinx,.venv,venv,docs/*,benchmarks/*
exclude = .idea,.git,__pycache__,sphinx,.venv*,.venv,venv,docs/*,benchmarks/*
4 changes: 2 additions & 2 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.7.1
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
pip-wheel-args: '--no-deps'

- name: Moves wheels
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.7.1
with:
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310'
python-versions: 'cp39-cp39'
pip-wheel-args: '--no-deps'

- name: Moves wheels
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11']

python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set Python environment
Expand Down Expand Up @@ -51,8 +50,8 @@ jobs:
twine upload dist/*.whl

- name: Publish tar files
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') && (matrix.python-version == '3.9') }}
if: ${{ (github.event_name == 'release') && (env.HAS_SECRETS == 'true') && (matrix.python-version == '3.11') }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*.gz
run: twine upload dist/*.gz
2 changes: 1 addition & 1 deletion .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
architecture: ['x64']
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ${{ matrix.os}}
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
os: [windows-latest, ubuntu-latest]

max-parallel: 20
Expand Down
2 changes: 1 addition & 1 deletion __version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version = 0.9
minor_version = "4"
minor_version = "5"
release_name = "Queluz"

release_version = f"{version}.{minor_version}"
34 changes: 33 additions & 1 deletion aequilibrae/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,30 @@ network:
description: name
osm_source: name
type: text
- cycleway:
description: cycleway, both way
osm_source: cycleway
type: text
- cycleway_right:
description: cycleway, right
osm_source: cycleway:right
type: text
- cycleway_left:
description: cycleway, left
osm_source: cycleway:left
type: text
- busway:
description: busway
osm_source: busway
type: text
- busway_right:
description: busway, right
osm_source: busway:right
type: text
- busway_left:
description: busway, left
osm_source: busway:left
type: text
two-way:
- lanes:
description: lanes
Expand Down Expand Up @@ -128,6 +152,14 @@ network:
modes:
bicycle:
link_types:
- primary
- primary_link
- secondary
- secondary_link
- tertiary
- tertiary_link
- living_street
- residential
- cycleway
- corridor
- pedestrian
Expand Down Expand Up @@ -313,7 +345,7 @@ network:
required: false
lanes:
description: Number of lanes in the direction of travel
type: inetger
type: integer
required: false
bike_facility:
description: Type of bicycle accommodation
Expand Down
77 changes: 67 additions & 10 deletions aequilibrae/paths/AoN.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def one_to_all(origin, matrix, graph, result, aux_result, curr_thread):
original_b_nodes_view)

w = path_finding(origin_index,
-1, # destination index to disable early exit
g_view,
b_nodes_view,
graph_fs_view,
Expand Down Expand Up @@ -178,6 +179,7 @@ def path_computation(origin, destination, graph, results):
"""
cdef ITYPE_t nodes, orig, dest, p, b, origin_index, dest_index, connector, zones
cdef long i, j, skims, a, block_flows_through_centroids
cdef bint early_exit_bint = results.early_exit

results.origin = origin
results.destination = destination
Expand Down Expand Up @@ -216,6 +218,18 @@ def path_computation(origin, destination, graph, results):
new_b_nodes = graph.graph.b_node.values.copy()
cdef long long [:] b_nodes_view = new_b_nodes

cdef bint a_star_bint = results.a_star
cdef double [:] lat_view
cdef double [:] lon_view
cdef long long [:] nodes_to_indices_view
cdef Heuristic heuristic
if results.a_star:
lat_view = graph.lonlat_index.lat.values
lon_view = graph.lonlat_index.lon.values
nodes_to_indices_view = graph.nodes_to_indices
heuristic = HEURISTIC_MAP[results._heuristic]


#Now we do all procedures with NO GIL
with nogil:
if block_flows_through_centroids: # Unblocks the centroid if that is the case
Expand All @@ -227,14 +241,31 @@ def path_computation(origin, destination, graph, results):
b_nodes_view,
original_b_nodes_view)

w = path_finding(origin_index,
g_view,
b_nodes_view,
graph_fs_view,
predecessors_view,
ids_graph_view,
conn_view,
reached_first_view)
if a_star_bint:
w = path_finding_a_star(origin_index,
dest_index,
g_view,
b_nodes_view,
graph_fs_view,
nodes_to_indices_view,
lat_view,
lon_view,
predecessors_view,
ids_graph_view,
conn_view,
reached_first_view,
heuristic)
else:
w = path_finding(origin_index,
dest_index if early_exit_bint else -1,
g_view,
b_nodes_view,
graph_fs_view,
predecessors_view,
ids_graph_view,
conn_view,
reached_first_view)


if skims > 0:
skim_single_path(origin_index,
Expand Down Expand Up @@ -280,14 +311,22 @@ def path_computation(origin, destination, graph, results):
del all_nodes
del all_connectors
del mileposts

else:
results.path = None
results.path_nodes = None
results.path_link_directions = None
results.milepost = None

def update_path_trace(results, destination, graph):
# type: (PathResults, int, Graph) -> (None)
"""
If `results.early_exit` is `True`, early exit will be enabled if the path is to be recomputed.
If `results.a_star` is `True`, A* will be used if the path is to be recomputed.

:param graph: AequilibraE graph. Needs to have been set with number of centroids and list of skims (if any)
:param results: AequilibraE Matrix properly set for computation using matrix.computational_view([matrix list])
:param skimming: if we will skim for all nodes or not
:param early_exit: Exit Dijkstra's once the destination has been found if the shortest path tree must be reconstructed.
"""
cdef p, origin_index, dest_index, connector

Expand All @@ -298,9 +337,20 @@ def update_path_trace(results, destination, graph):
else:
dest_index = graph.nodes_to_indices[destination]
origin_index = graph.nodes_to_indices[results.origin]

results.milepost = None
results.path_nodes = None

# If the predecessor is -1 and early exit was enabled we cannot differentiate between
# an unreachable node and one we just didn't see yet. We need to recompute the tree with the new destination
# If `a_star` was enabled then the stored tree has no guarantees and may not be useful due to the heuristic used
# TODO: revisit with heuristic specific reuse logic
if results.predecessors[dest_index] == -1 and results._early_exit or results._a_star:
results.compute_path(results.origin, destination, early_exit=results.early_exit, a_star=results.a_star)

# By the invariant hypothesis presented at https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm#Proof_of_correctness
# Dijkstra's algorithm produces the shortest path tree for all scanned nodes. That is if a node was scanned,
# its shortest path has been found, even if we exited early. As the un-scanned nodes are marked as unreachable this
# invariant holds.
if results.predecessors[dest_index] >= 0:
all_connectors = []
link_directions = []
Expand All @@ -321,6 +371,12 @@ def update_path_trace(results, destination, graph):
results.path_nodes = graph.all_nodes[np.asarray(all_nodes, graph.default_types('int'))][::-1]
mileposts.append(0)
results.milepost = np.cumsum(mileposts[::-1])
else:
results.path = None
results.path_nodes = None
results.path_link_directions = None
results.milepost = None


def skimming_single_origin(origin, graph, result, aux_result, curr_thread):
"""
Expand Down Expand Up @@ -384,6 +440,7 @@ def skimming_single_origin(origin, graph, result, aux_result, curr_thread):
b_nodes_view,
original_b_nodes_view)
w = path_finding(origin_index,
-1, # destination index to disable early exit
g_view,
b_nodes_view,
graph_fs_view,
Expand Down
Loading