Skip to content

Release/0.2.16 - #165

Merged
shima004 merged 2 commits into
mainfrom
release/0.2.16
Oct 16, 2026
Merged

shima004 merged 2 commits into
mainfrom
release/0.2.16

Conversation

@shima004

Copy link
Copy Markdown
Member

close #150

This pull request refactors the road initialization and state persistence logic in both sample_road_detector.py and default_road_detector.py to improve code reuse and ensure consistent handling of target areas and priority roads across precompute, resume, and prepare phases.

Road initialization and state persistence:

  • Introduced a new _initialize_roads method to encapsulate the logic for populating _target_areas and _priority_roads, reducing code duplication and improving maintainability. [1] [2]
  • Changed the precompute and prepare methods to use _initialize_roads, ensuring consistent initialization of road-related sets. [1] [2]
  • Updated the precompute method to serialize the computed road data (_target_areas and _priority_roads) to JSON, and the resume method to restore them from JSON, ensuring correct state restoration between runs. [1] [2]
  • Moved the initialization of _target_areas and _priority_roads from the resume method to the new _initialize_roads method, and adjusted the logic to avoid redundant computation if already initialized. [1] [2]

These changes make the road detector modules more robust and maintainable by centralizing initialization logic and persisting state efficiently.

@shima004 shima004 self-assigned this Oct 16, 2026
@shima004
shima004 merged commit f4a4042 into main Oct 16, 2026
4 checks passed
@shima004
shima004 deleted the release/0.2.16 branch October 16, 2026 07:02
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.

prepare() and resume() perform duplicate computation

1 participant