Skip to content

Conversation

@TsybulkaM
Copy link
Contributor

No description provided.

@TsybulkaM TsybulkaM requested a review from Copilot May 4, 2025 16:48
@TsybulkaM TsybulkaM linked an issue May 4, 2025 that may be closed by this pull request
@TsybulkaM TsybulkaM self-assigned this May 4, 2025
Copy link
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

This PR implements a simplified greedy search algorithm for public transport routing with supporting API endpoints and a basic interactive map for testing the route display.

  • Introduces the SimpleGreedySearch algorithm and associated route-building logic.
  • Adds new URL routes, views, and templates for routing and map testing.
  • Updates dependency configuration to include networkx.

Reviewed Changes

Copilot reviewed 15 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Adds networkx dependency for graph operations.
logicway/routing/views.py Implements API view for transit routing.
logicway/routing/urls.py Adds URL routing for the transit route API.
logicway/routing/typedef.py Provides type definitions for routing segments.
logicway/routing/simple_greedy_search.py Implements the greedy search algorithm.
logicway/map/views.py & logicway/map/urls.py Introduces map views and associated endpoints.
logicway/map/templates/map/map4test.html Provides a test map template.
logicway/map/static/map/js/map4test.js Contains map initialization and route logic.
logicway/logicway/urls.py Integrates routing URL patterns into main URLs.
logicway/database/views.py Refactors stop and route retrieval into helper functions.
Files not reviewed (3)
  • http-client.env.json: Language not supported
  • logicway/map/api_manual_testing.http: Language not supported
  • logicway/routing/tests.http: Language not supported
Comments suppressed due to low confidence (1)

logicway/routing/simple_greedy_search.py:92

  • [nitpick] The loop variable 'start_stop' shadows the earlier usage of the same name for the chosen start stop. Consider renaming the loop variable to something like 'current_start_stop' to improve clarity.
for start_stop, _ in start_stops:

to_stop=Point(lat=end_lat, lon=end_lon)
)]

def __del__(self):
Copy link

Copilot AI May 4, 2025

Choose a reason for hiding this comment

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

[nitpick] Relying on del to close the database session may not guarantee timely resource release. Consider using a context manager or explicit session management to ensure proper closing of the connection.

Suggested change
def __del__(self):
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):

Copilot uses AI. Check for mistakes.
@TsybulkaM TsybulkaM merged commit 529c795 into main May 4, 2025
@TsybulkaM TsybulkaM deleted the making-optimised-algorithms branch May 4, 2025 16:55
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.

Create searching route algorithms

2 participants