Skip to content

Conversation

@fiendskrah
Copy link

@fiendskrah fiendskrah commented Aug 20, 2025

First shippable verison of route module referenced by #4 (defunct) and the initial PR by @ljwolf.

This work was completed during the Google Summer of Code 2025; a NumFOCUS-sponsored project for the Python Spatial Analysis Library (PySAL). See the project blog. This PR contains files changes from upstream, but my contributions can be found in the spopt/route/ directory.

The spopt.route module wraps around the routingpy library to leverage street data for use in solving vehicle routing problems using PyVRP.

The user can setup a OSRM instance (described in the new notebook route.py) and then refer to it in the solve function:

from routingpy import OSRM
m.solve(stop=pyvrp.stop.MaxRuntime(60), routing=OSRM, routing_kws={"base_url": "http://localhost:5000"})

As well, the user can decide to not pass a router,

m.solve(stop=pyvrp.stop.MaxRuntime(60))

which will solve the problem using haversine distances.

Because spopt.route leverages the base functions in routingpy which are shared by all of the library's routers (matrix and directions), users should be able to pass the other API-enabled routers and get the same functionality if their required keywords are passed to routing_kws (e.g. for Valhalla, this would include the keyword "profile" : "auto"). The OSRM service is considered the 'default' use case, but other services should be simple to incorporate.

The new notebook route.py describes the confirmed functional routers in more detail.

pre-commit-ci bot and others added 15 commits January 6, 2025 19:25
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.8.6](astral-sh/ruff-pre-commit@v0.5.0...v0.8.6)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* bump ruff version in pre-commit

* reup ruff formatting

* forgot to update newest ruff
* bump ruff version in pre-commit

* reup ruff formatting

* format notebooks

* rerun notebooks

* update pyproject.toml
* bump ruff version in pre-commit

* reup ruff formatting

* resolve pysal#475

* update docs
…tion algorithm (pysal#482)

* init

* notebook

* public extraction api

* notebook

* notebook

* change cluster renumbering

* formatting and docstrings

* reorder imports

* ci change

* more ci changes

* formatting

* more formatting

* test failures

* typo

* Update sa3.py

* backwards compat

* load data within setup_method

* lint

* better API

* fix tests i broke

---------

Co-authored-by: Martin Fleischmann <[email protected]>
* bump libpysal requirement to 4.10

* fix imports

* fast_hdbscan

* test if its sklearn

* skip on old sklearn
* bump ruff version in pre-commit

* reup ruff formatting

* deps pysal#488, pysal#489

* correct syntax - pyproject.toml

* correct syntax - pyproject.toml [2]

* rmeove strict numba pin

* resolve pysal#491

* resolve pysal#492

* update pre-commit

* martin comments
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.2](astral-sh/ruff-pre-commit@v0.11.13...v0.12.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* bump ruff version in pre-commit

* reup ruff formatting

* bump ruff + pre-commit

* hierarchical testin data storage
@fiendskrah fiendskrah closed this Aug 25, 2025
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.

6 participants