Skip to content

Commit aba9af1

Browse files
committed
Bump vesrion adn copilot fixes
1 parent 1a84935 commit aba9af1

File tree

5 files changed

+17
-21
lines changed

5 files changed

+17
-21
lines changed

src/dsf/bindings.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,12 @@ PYBIND11_MODULE(dsf_cpp, m) {
264264
"Args:\n"
265265
" sourceId (int): The id of the source node\n"
266266
" targetId (int): The id of the target node\n"
267-
" weightFunction (PathWeight): The weight function to use (LENGTH, TRAVELTIME, or WEIGHT)\n"
267+
" weightFunction (PathWeight): The weight function to use (LENGTH, "
268+
"TRAVELTIME, or WEIGHT)\n"
268269
" threshold (float): A threshold value to consider alternative paths\n\n"
269270
"Returns:\n"
270-
" PathCollection: A map where each key is a node id and the value is a vector of next hop node ids toward the target");
271+
" PathCollection: A map where each key is a node id and the value is a "
272+
"vector of next hop node ids toward the target");
271273

272274
pybind11::class_<dsf::mobility::PathCollection>(mobility, "PathCollection")
273275
.def(pybind11::init<>(), "Create an empty PathCollection")
@@ -284,9 +286,9 @@ PYBIND11_MODULE(dsf_cpp, m) {
284286
"Get the next hops for a given node id")
285287
.def(
286288
"__setitem__",
287-
[](dsf::mobility::PathCollection& self, dsf::Id key, std::vector<dsf::Id> value) {
288-
self[key] = value;
289-
},
289+
[](dsf::mobility::PathCollection& self,
290+
dsf::Id key,
291+
std::vector<dsf::Id> value) { self[key] = value; },
290292
pybind11::arg("key"),
291293
pybind11::arg("value"),
292294
"Set the next hops for a given node id")
@@ -322,12 +324,11 @@ PYBIND11_MODULE(dsf_cpp, m) {
322324
return items;
323325
},
324326
"Get all items (node id, next hops) in the collection")
325-
.def(
326-
"explode",
327-
&dsf::mobility::PathCollection::explode,
328-
pybind11::arg("sourceId"),
329-
pybind11::arg("targetId"),
330-
dsf::g_docstrings.at("dsf::mobility::PathCollection::explode").c_str());
327+
.def("explode",
328+
&dsf::mobility::PathCollection::explode,
329+
pybind11::arg("sourceId"),
330+
pybind11::arg("targetId"),
331+
dsf::g_docstrings.at("dsf::mobility::PathCollection::explode").c_str());
331332

332333
pybind11::class_<dsf::mobility::Itinerary>(mobility, "Itinerary")
333334
.def(pybind11::init<dsf::Id, dsf::Id>(),

src/dsf/dsf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
static constexpr uint8_t DSF_VERSION_MAJOR = 4;
88
static constexpr uint8_t DSF_VERSION_MINOR = 4;
9-
static constexpr uint8_t DSF_VERSION_PATCH = 0;
9+
static constexpr uint8_t DSF_VERSION_PATCH = 1;
1010

1111
static auto const DSF_VERSION =
1212
std::format("{}.{}.{}", DSF_VERSION_MAJOR, DSF_VERSION_MINOR, DSF_VERSION_PATCH);

src/dsf/mobility/Itinerary.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace dsf::mobility {
4444

4545
/// @brief Set the itinerary's path
4646
/// @param pathCollection A dsf::mobility::PathCollection representing all equivalent paths to the destination
47-
void setPath(PathCollection path);
47+
void setPath(PathCollection pathCollection);
4848

4949
/// @brief Get the itinerary's id
5050
/// @return Id, The itinerary's id

src/dsf/mobility/RoadNetwork.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ namespace dsf::mobility {
202202
/// @param threshold A threshold value to consider alternative paths
203203
/// @return A map where each key is a node id and the value is a vector of next hop node ids toward the target
204204
/// @throws std::out_of_range if the target node does not exist
205-
/// @throws std::invalid_argument if the dynamics function is not callable with a const reference
206205
template <typename DynamicsFunc>
207206
requires(std::is_invocable_r_v<double, DynamicsFunc, std::unique_ptr<Street> const&>)
208207
PathCollection allPathsTo(Id const targetId,
@@ -314,7 +313,6 @@ namespace dsf::mobility {
314313
PathCollection RoadNetwork::allPathsTo(Id const targetId,
315314
DynamicsFunc f,
316315
double const threshold) const {
317-
// Check if source node exists
318316
auto const& nodes = this->nodes();
319317

320318
// Distance from each node to the source (going backward)

test/mobility/Test_graph.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,7 @@ TEST_CASE("ShortestPath") {
662662
CHECK_FALSE(pathMap.contains(3));
663663
}
664664

665-
SUBCASE("Complex Network with Coordinates - A* Heuristic") {
666-
// Test with coordinates to verify A* heuristic is being used
665+
SUBCASE("Complex Network with Coordinates") {
667666
RoadNetwork graph{};
668667
graph.addNode(0, dsf::geometry::Point(0.0, 0.0));
669668
graph.addNode(1, dsf::geometry::Point(10.0, 0.0));
@@ -841,10 +840,8 @@ TEST_CASE("ShortestPath") {
841840
// Test explode function
842841
auto allPaths = pathMap.explode(0, 5);
843842

844-
// There should be 6 shortest paths of length 4 (4 hops):
845-
// 0->1->2->5, 0->1->4->5, 0->3->4->5, 0->3->4->2->5 (no, this is longer)
846-
// Actually: 0->1->2->5, 0->1->4->5, 0->3->4->5, 0->1->4->2->5 (no reverse edge)
847-
// Let me recalculate: all shortest paths have length 40 (4 edges)
843+
// All shortest paths from 0 to 5 have length 40 (4 edges).
844+
// There are 3 such shortest paths: 0->1->2->5, 0->1->4->5, and 0->3->4->5.
848845
CHECK_GT(allPaths.size(), 0);
849846

850847
// Verify all paths start at 0 and end at 5

0 commit comments

Comments
 (0)