From 495526cac1d2c557905d27ffc6e7a7b8c6f27e2b Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sat, 16 Nov 2024 10:46:50 +0100 Subject: [PATCH 01/14] update upstream vroom --- vroom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vroom b/vroom index 1fd711b..31bace4 160000 --- a/vroom +++ b/vroom @@ -1 +1 @@ -Subproject commit 1fd711bc8c20326dd8e9538e2c7e4cb1ebd67bdb +Subproject commit 31bace492abfd97155faf91c20b4300dfbfcdcec From fc4627614dbf446171be84fcb4b4243605fa23f6 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sat, 23 Nov 2024 14:00:19 +0100 Subject: [PATCH 02/14] pushing for 1.15 support --- src/_vroom.cpp | 2 +- src/bind/enums.cpp | 1 - src/bind/input/input.cpp | 14 +++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/_vroom.cpp b/src/_vroom.cpp index 1988d6a..553dfcd 100644 --- a/src/_vroom.cpp +++ b/src/_vroom.cpp @@ -42,7 +42,7 @@ #include "structures/typedefs.h" #include "structures/generic/edge.cpp" -#include "structures/generic/matrix.cpp" +#include "structures/generic/matrix.h" #include "structures/generic/undirected_graph.cpp" #include "structures/vroom/cost_wrapper.cpp" diff --git a/src/bind/enums.cpp b/src/bind/enums.cpp index 6121bd5..5915a67 100644 --- a/src/bind/enums.cpp +++ b/src/bind/enums.cpp @@ -29,7 +29,6 @@ void init_enums(py::module_ &m) { py::enum_(m, "HEURISTIC") .value("BASIC", vroom::HEURISTIC::BASIC) .value("DYNAMIC", vroom::HEURISTIC::DYNAMIC) - .value("INIT_ROUTES", vroom::HEURISTIC::INIT_ROUTES) .export_values(); py::enum_(m, "INIT") diff --git a/src/bind/input/input.cpp b/src/bind/input/input.cpp index b95b4a7..2ddc7a7 100644 --- a/src/bind/input/input.cpp +++ b/src/bind/input/input.cpp @@ -13,17 +13,18 @@ void init_input(py::module_ &m) { py::class_(m, "Input") .def( - py::init([](const vroom::io::Servers &servers, vroom::ROUTER router) { - return new vroom::Input(servers, router); + py::init([](const vroom::io::Servers &servers, vroom::ROUTER router, bool apply_TSPFix) { + return new vroom::Input(servers, router, apply_TSPFix); }), "Class initializer.", py::arg("servers") = std::map(), - py::arg("router") = vroom::ROUTER::OSRM) + py::arg("router") = vroom::ROUTER::OSRM, + py::arg("apply_TSPFix") = false) .def_readonly("jobs", &vroom::Input::jobs) .def_readonly("vehicles", &vroom::Input::vehicles) .def("_from_json", &vroom::io::parse, py::arg("json_string"), py::arg("geometry")) - .def("_set_amount_size", &vroom::Input::set_amount_size) + /* .def("_set_amount_size", &vroom::Input::set_amount_size) */ .def("_set_geometry", &vroom::Input::set_geometry) .def("_add_job", &vroom::Input::add_job) .def("_add_shipment", &vroom::Input::add_shipment) @@ -51,9 +52,12 @@ void init_input(py::module_ &m) { .def("has_homogeneous_locations", &vroom::Input::has_homogeneous_locations) .def("has_homogeneous_profiles", &vroom::Input::has_homogeneous_profiles) + .def("has_homogeneous_costs", &vroom::Input::has_homogeneous_costs) // .def("vehicle_ok_with_job", &vroom::Input::vehicle_ok_with_job) .def("_solve", &vroom::Input::solve, "Solve problem.", - py::arg("exploration_level"), py::arg("nb_threads") = 1, + py::arg("nb_searches"), + py::arg("depth"), + py::arg("nb_threads") = 1, py::arg("timeout") = vroom::Timeout(), py::arg("h_param") = std::vector()) .def("check", &vroom::Input::check); From d2c95abd8a5eef40bec68047f103bd548c3f8a14 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sat, 23 Nov 2024 14:59:04 +0100 Subject: [PATCH 03/14] update input interface --- src/bind/input/input.cpp | 2 +- src/bind/vehicle.cpp | 5 +++-- src/vroom/input/input.py | 44 +++++++++++++++++++++++++++++++++++----- src/vroom/vehicle.py | 18 +++++++++++----- 4 files changed, 56 insertions(+), 13 deletions(-) diff --git a/src/bind/input/input.cpp b/src/bind/input/input.cpp index 2ddc7a7..73dcb9c 100644 --- a/src/bind/input/input.cpp +++ b/src/bind/input/input.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "structures/cl_args.cpp" #include "structures/vroom/input/input.cpp" @@ -24,7 +25,6 @@ void init_input(py::module_ &m) { .def_readonly("vehicles", &vroom::Input::vehicles) .def("_from_json", &vroom::io::parse, py::arg("json_string"), py::arg("geometry")) - /* .def("_set_amount_size", &vroom::Input::set_amount_size) */ .def("_set_geometry", &vroom::Input::set_geometry) .def("_add_job", &vroom::Input::add_job) .def("_add_shipment", &vroom::Input::add_shipment) diff --git a/src/bind/vehicle.cpp b/src/bind/vehicle.cpp index 1658893..a2139f8 100644 --- a/src/bind/vehicle.cpp +++ b/src/bind/vehicle.cpp @@ -9,9 +9,10 @@ void init_vehicle(py::module_ &m) { py::class_(m, "VehicleCosts") .def(py::init(), "VehicleCost constructor.", py::arg("fixed") = 0, - py::arg("per_hour") = 3600) + py::arg("per_hour") = 3600, py::arg("per_km") = 0) .def_readonly("_fixed", &vroom::VehicleCosts::fixed) - .def_readonly("_per_hour", &vroom::VehicleCosts::per_hour); + .def_readonly("_per_hour", &vroom::VehicleCosts::per_hour) + .def_readonly("_per_km", &vroom::VehicleCosts::per_km); py::class_(m, "CostWrapper") .def(py::init(), diff --git a/src/vroom/input/input.py b/src/vroom/input/input.py index 75eff3b..375c00d 100644 --- a/src/vroom/input/input.py +++ b/src/vroom/input/input.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Dict, Optional, Sequence, Set, Union from pathlib import Path +from datetime import timedelta from numpy.typing import ArrayLike import numpy @@ -38,6 +39,8 @@ def __init__( amount_size: Optional[int] = None, servers: Optional[Dict[str, Union[str, _vroom.Server]]] = None, router: _vroom.ROUTER = _vroom.ROUTER.OSRM, + apply_TSPFix: bool = False, + geometry: bool = False, ) -> None: """Class initializer. @@ -53,6 +56,10 @@ def __init__( router: If servers is used, define what kind of server is provided. See `vroom.ROUTER` enum for options. + apply_TSPFix: + Experimental local search operator. + geometry: + Add detailed route geometry and distance. """ if servers is None: servers = {} @@ -62,9 +69,16 @@ def __init__( self._amount_size = amount_size self._servers = servers self._router = router - _vroom.Input.__init__(self, servers=servers, router=router) + _vroom.Input.__init__( + self, + servers=servers, + router=router, + apply_TSPFix=apply_TSPFix, + ) if amount_size is not None: self._set_amount_size(amount_size) + if geometry: + self.set_geometry() def __repr__(self) -> str: """String representation.""" @@ -117,6 +131,7 @@ def from_json( return instance def set_geometry(self): + """Add detailed route geometry and distance.""" self._geometry = True return self._set_geometry(True) @@ -333,13 +348,32 @@ def set_costs_matrix( def solve( self, - exploration_level: int, - nb_threads: int, + nb_searches, + depth, + nb_threads: int = 4, + timeout: Optional[timedelta] = None, + h_params = (), ) -> Solution: + """Solve routing problem. + + Args: + nb_searches: + depth: + nb_threads: + The number of available threads. + timeout: + Stop the solving process after a given amount of time. + h_params: + """ + assert isinstance(timeout, (None, timedelta)), ( + f"unknown timeout type: {timeout}") solution = Solution( self._solve( - exploration_level=exploration_level, - nb_threads=nb_threads, + nb_searches=nb_searches, + depth=depth, + nb_threads=int(nb_threads), + timeout=timeout, + h_params=list(h_params), ) ) solution._geometry = self._geometry diff --git a/src/vroom/vehicle.py b/src/vroom/vehicle.py index 2c0d6a8..6848f33 100644 --- a/src/vroom/vehicle.py +++ b/src/vroom/vehicle.py @@ -24,19 +24,22 @@ class VehicleCosts(_vroom.VehicleCosts): A fixed price for the vehicle to be utilized. per_hour: The price per hour to utilize the vehicle. + per_km: + The price per kilometer to utilize the vehicle. Examples: >>> vroom.VehicleCosts() VehicleCosts() - >>> vroom.VehicleCosts(fixed=100, per_hour=50) - VehicleCosts(fixed=100, per_hour=50) + >>> vroom.VehicleCosts(fixed=100, per_hour=50, per_km=25) + VehicleCosts(fixed=100, per_hour=50, per_km=25) """ - def __init__(self, fixed: int = 0, per_hour: int = 3600): + def __init__(self, fixed: int = 0, per_hour: int = 3600, per_km: int = 0): _vroom.VehicleCosts.__init__( self, fixed=int(fixed), per_hour=int(per_hour), + per_km=int(per_km), ) @property @@ -47,11 +50,15 @@ def fixed(self) -> int: def per_hour(self) -> int: return self._per_hour + @property + def per_km(self) -> int: + return self._per_km + def __bool__(self) -> bool: - return self.fixed != 0 or self.per_hour != 3600 + return self.fixed != 0 or self.per_hour != 3600 or self.per_km != 0 def __repr__(self): - args = f"fixed={self.fixed}, per_hour={self.per_hour}" if self else "" + args = f"fixed={self.fixed}, per_hour={self.per_hour}, per_km={self.per_km}" if self else "" return f"{self.__class__.__name__}({args})" @@ -231,6 +238,7 @@ def costs(self) -> VehicleCosts: return VehicleCosts( fixed=self._costs._fixed, per_hour=self._costs._per_hour, + per_km=self._costs._per_km, ) @property From 9a0391e509e1a274c5ddb9c1bbe3f1b3de54d948 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sat, 23 Nov 2024 21:52:26 +0100 Subject: [PATCH 04/14] gcc-13 -> gcc-14 --- .github/workflows/pull_request.yml | 4 +++- .github/workflows/release.yml | 8 ++++---- pyproject.toml | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 928cdc8..f6c9a0c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -11,7 +11,7 @@ on: jobs: test: name: test - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -31,6 +31,8 @@ jobs: python -m pip install -r build-requirements.txt - name: "Install pyvroom" + env: + CXX: g++-14 run: | # Because `pip install -e .` does not play nice with gcov, we go old school: CFLAGS="-coverage" python setup.py build_ext --inplace diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2636e49..fd4e978 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,16 +83,16 @@ jobs: uses: pypa/cibuildwheel@v2.19.2 env: MACOSX_DEPLOYMENT_TARGET: 13.0 - CC: gcc-13 - CXX: g++-13 + CC: gcc-14 + CXX: g++-14 - name: Build wheels if: matrix.platform == 'macos-arm' uses: pypa/cibuildwheel@v2.19.2 env: MACOSX_DEPLOYMENT_TARGET: 14.0 - CC: gcc-13 - CXX: g++-13 + CC: gcc-14 + CXX: g++-14 - name: Verify clean directory run: git diff --exit-code diff --git a/pyproject.toml b/pyproject.toml index dddddfa..6a4d67a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,8 +2,6 @@ requires = [ "setuptools>=45", "wheel", - "setuptools_scm>=6.2", - "setuptools_scm_git_archive", "pybind11>=2.8.0", ] From 2970f62dc4c4d685628c37d69791c3b689d82e08 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sat, 23 Nov 2024 22:12:57 +0100 Subject: [PATCH 05/14] missing VehicleCost constructor update --- src/bind/vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bind/vehicle.cpp b/src/bind/vehicle.cpp index a2139f8..6d3011f 100644 --- a/src/bind/vehicle.cpp +++ b/src/bind/vehicle.cpp @@ -7,7 +7,7 @@ namespace py = pybind11; void init_vehicle(py::module_ &m) { py::class_(m, "VehicleCosts") - .def(py::init(), + .def(py::init(), "VehicleCost constructor.", py::arg("fixed") = 0, py::arg("per_hour") = 3600, py::arg("per_km") = 0) .def_readonly("_fixed", &vroom::VehicleCosts::fixed) From deb104202ab5ac5793d1d48c96eb512b368feec4 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sun, 1 Dec 2024 17:55:43 +0100 Subject: [PATCH 06/14] removing amount from input --- README.rst | 2 +- src/bind/input/input.cpp | 2 -- src/vroom/input/input.py | 50 +++++++++++----------------------------- 3 files changed, 14 insertions(+), 40 deletions(-) diff --git a/README.rst b/README.rst index 89fd73c..569c673 100644 --- a/README.rst +++ b/README.rst @@ -96,7 +96,7 @@ Usage with a routing engine >>> sol = problem_instance.solve(exploration_level=5, nb_threads=4) >>> print(sol.summary.duration) - 2714 + 4041 Installation ------------ diff --git a/src/bind/input/input.cpp b/src/bind/input/input.cpp index 73dcb9c..b61cda7 100644 --- a/src/bind/input/input.cpp +++ b/src/bind/input/input.cpp @@ -44,7 +44,6 @@ void init_input(py::module_ &m) { vroom::Matrix &m) { self.set_costs_matrix(profile, std::move(m)); }) - .def("zero_amount", &vroom::Input::zero_amount) .def("has_skills", &vroom::Input::has_skills) .def("has_jobs", &vroom::Input::has_jobs) .def("has_shipments", &vroom::Input::has_shipments) @@ -53,7 +52,6 @@ void init_input(py::module_ &m) { &vroom::Input::has_homogeneous_locations) .def("has_homogeneous_profiles", &vroom::Input::has_homogeneous_profiles) .def("has_homogeneous_costs", &vroom::Input::has_homogeneous_costs) - // .def("vehicle_ok_with_job", &vroom::Input::vehicle_ok_with_job) .def("_solve", &vroom::Input::solve, "Solve problem.", py::arg("nb_searches"), py::arg("depth"), diff --git a/src/vroom/input/input.py b/src/vroom/input/input.py index 375c00d..c36582d 100644 --- a/src/vroom/input/input.py +++ b/src/vroom/input/input.py @@ -36,7 +36,6 @@ class Input(_vroom.Input): def __init__( self, - amount_size: Optional[int] = None, servers: Optional[Dict[str, Union[str, _vroom.Server]]] = None, router: _vroom.ROUTER = _vroom.ROUTER.OSRM, apply_TSPFix: bool = False, @@ -45,9 +44,6 @@ def __init__( """Class initializer. Args: - amount_size: - The size of the job to be transported. Used to verify all jobs - have the same size limit. servers: Assuming no custom duration matrix is provided (from `set_durations_matrix`), use this dict to configure the @@ -66,7 +62,6 @@ def __init__( for key, server in servers.items(): if isinstance(server, str): servers[key] = _vroom.Server(*server.split(":")) - self._amount_size = amount_size self._servers = servers self._router = router _vroom.Input.__init__( @@ -75,16 +70,12 @@ def __init__( router=router, apply_TSPFix=apply_TSPFix, ) - if amount_size is not None: - self._set_amount_size(amount_size) if geometry: self.set_geometry() def __repr__(self) -> str: """String representation.""" args = [] - if self._amount_size is not None: - args.append(f"amount_size={self._amount_size}") if self._servers: args.append(f"servers={self._servers}") if self._router != _vroom.ROUTER.OSRM: @@ -135,18 +126,6 @@ def set_geometry(self): self._geometry = True return self._set_geometry(True) - def set_amount_size(self, *amount_sizes: int) -> None: - """Add amount sizes.""" - sizes = set(amount_sizes) - if self._amount_size is not None: - sizes.add(self._amount_size) - if len(sizes) > 1: - raise _vroom.VroomInputException(f"Inconsistent capacity lengths: {sizes}") - if self._amount_size is None: - size = sizes.pop() - self._amount_size = size - self._set_amount_size(size) - def add_job( self, job: Union[Job, Shipment, Sequence[Job], Sequence[Shipment]], @@ -172,14 +151,9 @@ def add_job( jobs = [job] if isinstance(job, (Job, Shipment)) else job for job_ in jobs: if isinstance(job_, Job): - if job_._pickup: - self.set_amount_size(len(job_._pickup)) - if job_._delivery: - self.set_amount_size(len(job_._delivery)) self._add_job(job_) elif isinstance(job_, Shipment): - self.set_amount_size(len(job_.amount)) self._add_shipment( _vroom.Job( id=job_.pickup.id, @@ -236,7 +210,6 @@ def add_shipment( The job priority level, where 0 is the most important and 100 is the least important. """ - self.set_amount_size(len(amount)) if skills is None: skills = set() self._add_shipment( @@ -281,7 +254,6 @@ def add_vehicle( vehicles = [vehicle] if isinstance(vehicle, _vroom.Vehicle) else vehicle if not vehicles: return - self.set_amount_size(*[len(vehicle_.capacity) for vehicle_ in vehicles]) for vehicle_ in vehicles: self._add_vehicle(vehicle_) @@ -348,32 +320,36 @@ def set_costs_matrix( def solve( self, - nb_searches, - depth, + exploration_level: int, nb_threads: int = 4, timeout: Optional[timedelta] = None, - h_params = (), + h_param = (), ) -> Solution: """Solve routing problem. Args: - nb_searches: - depth: + exploration_level: + The exploration level to use. Number between 1 and 5. nb_threads: The number of available threads. timeout: Stop the solving process after a given amount of time. - h_params: """ - assert isinstance(timeout, (None, timedelta)), ( + assert timeout is None or isinstance(timeout, timedelta), ( f"unknown timeout type: {timeout}") + assert exploration_level <= 5 + nb_searches = 4 * (exploration_level + 1) + if exploration_level >= 4: + nb_searches += 4 + if exploration_level == 5: + nb_searches += 4 solution = Solution( self._solve( nb_searches=nb_searches, - depth=depth, + depth=int(exploration_level), nb_threads=int(nb_threads), timeout=timeout, - h_params=list(h_params), + h_param=list(h_param), ) ) solution._geometry = self._geometry From 06cf96c35deeaa755795b17ecdee2ac0ec5e3a8e Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sun, 1 Dec 2024 18:34:41 +0100 Subject: [PATCH 07/14] upload-artifact v4 --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd4e978..9dcc36b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: Check metadata run: pipx run twine check dist/* - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz @@ -99,7 +99,7 @@ jobs: shell: bash - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: wheelhouse/*.whl From b6c24e84ef0b27efea86d332c3d72c273844186e Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sun, 1 Dec 2024 18:45:50 +0100 Subject: [PATCH 08/14] downgrade to v3 again --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9dcc36b..7613d20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,7 +99,7 @@ jobs: shell: bash - name: Upload wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: path: wheelhouse/*.whl From ec593b0bb6dd5052f4e5a2d0006d648d3fc3866c Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Tue, 3 Dec 2024 09:17:21 +0100 Subject: [PATCH 09/14] update vroom + version --- .github/workflows/release.yml | 4 ++++ src/bind/input/input.cpp | 3 +-- src/vroom/input/input.py | 11 ++--------- vroom | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7613d20..f409260 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,6 +78,10 @@ jobs: with: platforms: all + - name: Set version + run: | + sed -i 's/^version = 0\.1\.0$/version =${{ github.ref_name }}/' setup.cfg + - name: Build wheels if: matrix.platform != 'macos-arm' uses: pypa/cibuildwheel@v2.19.2 diff --git a/src/bind/input/input.cpp b/src/bind/input/input.cpp index b61cda7..bf3ca7b 100644 --- a/src/bind/input/input.cpp +++ b/src/bind/input/input.cpp @@ -53,8 +53,7 @@ void init_input(py::module_ &m) { .def("has_homogeneous_profiles", &vroom::Input::has_homogeneous_profiles) .def("has_homogeneous_costs", &vroom::Input::has_homogeneous_costs) .def("_solve", &vroom::Input::solve, "Solve problem.", - py::arg("nb_searches"), - py::arg("depth"), + py::arg("exploration_level"), py::arg("nb_threads") = 1, py::arg("timeout") = vroom::Timeout(), py::arg("h_param") = std::vector()) diff --git a/src/vroom/input/input.py b/src/vroom/input/input.py index c36582d..3e25551 100644 --- a/src/vroom/input/input.py +++ b/src/vroom/input/input.py @@ -335,18 +335,11 @@ def solve( timeout: Stop the solving process after a given amount of time. """ - assert timeout is None or isinstance(timeout, timedelta), ( + assert timeout is None or isinstance(timeout, (None, timedelta)), ( f"unknown timeout type: {timeout}") - assert exploration_level <= 5 - nb_searches = 4 * (exploration_level + 1) - if exploration_level >= 4: - nb_searches += 4 - if exploration_level == 5: - nb_searches += 4 solution = Solution( self._solve( - nb_searches=nb_searches, - depth=int(exploration_level), + exploration_level=int(exploration_level), nb_threads=int(nb_threads), timeout=timeout, h_param=list(h_param), diff --git a/vroom b/vroom index 31bace4..82327fe 160000 --- a/vroom +++ b/vroom @@ -1 +1 @@ -Subproject commit 31bace492abfd97155faf91c20b4300dfbfcdcec +Subproject commit 82327fe93a37d3e117580261d61a4c59675e6fdd From ce64ecf7e124cd83c8fb38378cbdf11e79b5a656 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Tue, 3 Dec 2024 09:26:44 +0100 Subject: [PATCH 10/14] ambigous solve call fix --- src/bind/input/input.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bind/input/input.cpp b/src/bind/input/input.cpp index bf3ca7b..53552cb 100644 --- a/src/bind/input/input.cpp +++ b/src/bind/input/input.cpp @@ -52,10 +52,12 @@ void init_input(py::module_ &m) { &vroom::Input::has_homogeneous_locations) .def("has_homogeneous_profiles", &vroom::Input::has_homogeneous_profiles) .def("has_homogeneous_costs", &vroom::Input::has_homogeneous_costs) - .def("_solve", &vroom::Input::solve, "Solve problem.", - py::arg("exploration_level"), - py::arg("nb_threads") = 1, - py::arg("timeout") = vroom::Timeout(), - py::arg("h_param") = std::vector()) + .def("_solve", + [](vroom::Input &self, unsigned exploration_level, unsigned nb_threads, const vroom::Timeout& timeout, const std::vector h_param) { + return self.solve(exploration_level, nb_threads, timeout, h_param); + }, + "Solve routing problem", + py::arg("exploration_level"), py::arg("nb_threads"), py::arg("timeout"), py::arg("h_param") + ) .def("check", &vroom::Input::check); } From 7ed6e6fcd857e3ffca1a564eba91bdfa15285ce5 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Wed, 4 Dec 2024 15:25:04 +0100 Subject: [PATCH 11/14] don't verify changes --- .github/workflows/release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f409260..edefbda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,7 +80,7 @@ jobs: - name: Set version run: | - sed -i 's/^version = 0\.1\.0$/version =${{ github.ref_name }}/' setup.cfg + sed -i 's/^version = 0\.1\.0$/version = ${{ github.ref_name }}/' setup.cfg - name: Build wheels if: matrix.platform != 'macos-arm' @@ -98,10 +98,6 @@ jobs: CC: gcc-14 CXX: g++-14 - - name: Verify clean directory - run: git diff --exit-code - shell: bash - - name: Upload wheels uses: actions/upload-artifact@v3 with: From 991e9e4d87b904194d7cc4fead117f45ca3fcbd9 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Fri, 6 Dec 2024 13:40:27 +0100 Subject: [PATCH 12/14] accomodate two versions of sed --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edefbda..174c88c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,6 +79,12 @@ jobs: platforms: all - name: Set version + if: matrix.platform != 'macos-arm' && matrix.platform != 'macos-intel' + run: | + sed -i 's/^version = 0\.1\.0$/version = ${{ github.ref_name }}/' setup.cfg + + - name: Set version + if: matrix.platform == 'macos-arm' || matrix.platform == 'macos-intel' run: | sed -i 's/^version = 0\.1\.0$/version = ${{ github.ref_name }}/' setup.cfg From ab0bca93bb4878b854d876084d345985de0c5d47 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Fri, 6 Dec 2024 13:57:07 +0100 Subject: [PATCH 13/14] bugfix --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 174c88c..a8cc2b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,7 +86,7 @@ jobs: - name: Set version if: matrix.platform == 'macos-arm' || matrix.platform == 'macos-intel' run: | - sed -i 's/^version = 0\.1\.0$/version = ${{ github.ref_name }}/' setup.cfg + sed -i "" 's/^version = 0\.1\.0$/version = ${{ github.ref_name }}/' setup.cfg - name: Build wheels if: matrix.platform != 'macos-arm' From 39d4e1f84a94d67aebd02bbcd60138512430b168 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Tue, 7 Jan 2025 11:32:25 +0100 Subject: [PATCH 14/14] path in Server init --- src/_vroom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_vroom.cpp b/src/_vroom.cpp index 553dfcd..9c286cd 100644 --- a/src/_vroom.cpp +++ b/src/_vroom.cpp @@ -137,8 +137,8 @@ PYBIND11_MODULE(_vroom, m) { .def(py::init()); py::class_(m, "Server") - .def(py::init(), - py::arg("host") = "0.0.0.0", py::arg("port") = "5000"); + .def(py::init(), + py::arg("host") = "0.0.0.0", py::arg("port") = "5000", py::arg("path") = ""); py::class_(m, "Violations") .def(py::init<>())