Skip to content

Bugfix#441

Merged
Grufoony merged 3 commits intomainfrom
bugfix
Apr 15, 2026
Merged

Bugfix#441
Grufoony merged 3 commits intomainfrom
bugfix

Conversation

@Grufoony
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings April 15, 2026 13:54
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.26%. Comparing base (bae4c96) to head (78fb46f).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #441      +/-   ##
==========================================
- Coverage   87.32%   87.26%   -0.07%     
==========================================
  Files          52       52              
  Lines        6527     6523       -4     
  Branches      733      732       -1     
==========================================
- Hits         5700     5692       -8     
- Misses        805      809       +4     
  Partials       22       22              
Flag Coverage Δ
unittests 87.26% <100.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adjusts network/cartography utilities to fix lane counting for bidirectional roads and to inline small Network accessors/helpers in the header.

Changes:

  • Update lane parsing to halve total lane counts for non-oneway OSM roads when building a directed graph.
  • Inline Network getters and Cantor hash helper in Network.hpp, and simplify some internal loops/comments.
  • Shorten Doxygen comments for betweenness centrality APIs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/dsf/cartography/cartography.py Adjusts lane extraction to account for total-lanes-on-bidirectional OSM tagging in a directed representation.
src/dsf/base/Network.hpp Inlines helper/accessor methods and trims comments in centrality implementations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +135 to +140
oneway_val = data.get("oneway", False)
is_oneway = (
oneway_val is True or oneway_val == "yes" or oneway_val == "True"
)
if not is_oneway:
n = max(n // 2, 1) # integer division, ensure at least 1
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oneway parsing is too narrow and will misclassify common OSM values (e.g., "1", "-1", "true", "YES"), causing incorrect halving of lanes on actually-oneway roads. Consider normalizing string values (trim + lowercase) and treating "yes", "true", "1", and "-1" as oneway (and "no", "false", "0" as not oneway), while keeping boolean handling.

Copilot uses AI. Check for mistakes.
Comment thread src/dsf/base/Network.hpp Outdated
Comment thread src/dsf/base/Network.hpp Outdated
Comment thread src/dsf/base/Network.hpp
/// where sigma_st is the number of shortest paths from s to t,
/// and sigma_st(v) is the number of those paths passing through v.
/// Results are stored via Node::setBetweennessCentrality.
/// @brief Compute node betweenness centralities using Brandes' algorithm
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The detailed Doxygen docs for the Brandes centrality methods (constraints like “weights must be positive”, and the definition/normalization of the computed centrality) were removed. Since these are public template APIs, restoring the key behavioral/contract details would prevent misuse and reduce ambiguity for callers.

Copilot uses AI. Check for mistakes.
Comment thread src/dsf/base/Network.hpp
/// where sigma_st is the number of shortest paths from s to t,
/// and sigma_st(e) is the number of those paths using edge e.
/// Results are stored via Edge::setBetweennessCentrality.
/// @brief Compute edge betweenness centralities using Brandes' algorithm
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The detailed Doxygen docs for the Brandes centrality methods (constraints like “weights must be positive”, and the definition/normalization of the computed centrality) were removed. Since these are public template APIs, restoring the key behavioral/contract details would prevent misuse and reduce ambiguity for callers.

Copilot uses AI. Check for mistakes.
edge_updates["nlanes"] = max(
min([int(v) for v in lanes_value]), 1
) # Take max if list, ensure at least 1 lane
n = max(min([int(v) for v in lanes_value]), 1)
n = max(min([int(v) for v in lanes_value]), 1)
else:
edge_updates["nlanes"] = max(int(lanes_value), 1)
n = max(int(lanes_value), 1)
oneway_val is True or oneway_val == "yes" or oneway_val == "True"
)
if not is_oneway:
n = max(n // 2, 1) # integer division, ensure at least 1
edge_updates["nlanes"] = max(
min([int(v) for v in lanes_value]), 1
) # Take max if list, ensure at least 1 lane
n = max(min([int(v) for v in lanes_value]), 1)
n = max(min([int(v) for v in lanes_value]), 1)
else:
edge_updates["nlanes"] = max(int(lanes_value), 1)
n = max(int(lanes_value), 1)
oneway_val is True or oneway_val == "yes" or oneway_val == "True"
)
if not is_oneway:
n = max(n // 2, 1) # integer division, ensure at least 1
Comment thread src/dsf/base/Network.hpp
std::unordered_map<Id, double> dist; // distance from source
std::stack<Id> S;
std::unordered_map<Id, std::vector<Id>> P;
std::unordered_map<Id, double> sigma;
Comment thread src/dsf/base/Network.hpp
std::stack<Id> S;
std::unordered_map<Id, std::vector<Id>> P;
std::unordered_map<Id, double> sigma;
std::unordered_map<Id, double> dist;
Comment thread src/dsf/base/Network.hpp
std::unordered_map<Id, std::vector<Id>> P;
std::unordered_map<Id, double> sigma;
std::unordered_map<Id, double> dist;

Comment thread src/dsf/base/Network.hpp Fixed
Comment thread src/dsf/base/Network.hpp Fixed
Comment thread src/dsf/base/Network.hpp Fixed
Comment thread src/dsf/base/Network.hpp Fixed
Comment thread src/dsf/base/Network.hpp Fixed
Comment thread src/dsf/base/Network.hpp Fixed
Comment thread src/dsf/base/Network.hpp Fixed
Comment thread src/dsf/base/Network.hpp

if (visited.contains(v)) {
if (visited.contains(v))
continue;
Comment thread src/dsf/base/Network.hpp

if (visited.contains(v)) {
if (visited.contains(v))
continue;
Comment thread src/dsf/base/Network.hpp
Id w = edgeObj.target();
if (visited.contains(w)) {
if (visited.contains(w))
continue;
Comment thread src/dsf/base/Network.hpp
Id w = edgeObj.target();
if (visited.contains(w)) {
if (visited.contains(w))
continue;
Comment thread src/dsf/base/Network.hpp
std::unordered_map<Id, double> delta;
for (auto const& [nId, _] : m_nodes) {
for (auto const& [nId, _] : m_nodes)
delta[nId] = 0.0;
Comment thread src/dsf/base/Network.hpp

if (visited.contains(v)) {
if (visited.contains(v))
continue;
Comment thread src/dsf/base/Network.hpp
Id w = edgeObj.target();
if (visited.contains(w)) {
if (visited.contains(w))
continue;
Comment thread src/dsf/base/Network.hpp
Id w = edgeObj.target();
if (visited.contains(w)) {
if (visited.contains(w))
continue;
Comment thread src/dsf/base/Network.hpp
std::unordered_map<Id, double> delta;
for (auto const& [nId, _] : m_nodes) {
for (auto const& [nId, _] : m_nodes)
delta[nId] = 0.0;
Comment thread src/dsf/base/Network.hpp
std::unordered_map<Id, double> delta;
for (auto const& [nId, _] : m_nodes) {
for (auto const& [nId, _] : m_nodes)
delta[nId] = 0.0;
@Grufoony Grufoony merged commit dc68f76 into main Apr 15, 2026
48 of 49 checks passed
@Grufoony Grufoony deleted the bugfix branch April 15, 2026 14:43
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.

3 participants