Skip to content

Improvement Implemented: Remove Obsolete Parameter Migration Function#36592

Closed
tomwolfe wants to merge 4 commits intocommaai:masterfrom
tomwolfe:pr13-branch
Closed

Improvement Implemented: Remove Obsolete Parameter Migration Function#36592
tomwolfe wants to merge 4 commits intocommaai:masterfrom
tomwolfe:pr13-branch

Conversation

@tomwolfe
Copy link
Copy Markdown

@tomwolfe tomwolfe commented Nov 7, 2025

Change Made:

  • File: openpilot/selfdrive/locationd/paramsd.py
  • Removed: The function migrate_cached_vehicle_params_if_needed() which was marked for removal after version 0.9.9
  • Removed: The call to this function in the main() function

Safety/Stability Impact:

  • Code cleanliness: Removes dead code that was no longer needed since version 0.9.9
  • Reduced complexity: Eliminates unnecessary parameter migration logic that could potentially cause issues
  • Maintainability: Reduces codebase size and removes technical debt

Verification:

  • The function was only used for migrating old parameter format to new format (LiveParameters → LiveParametersV2)
  • Since this migration was for version 0.9.9 and current versions are much newer, this code is obsolete
  • The main parameter retrieval logic (retrieve_initial_vehicle_params) continues to work with the current LiveParametersV2 format
  • No functional change to the parameter learning system - it will continue to work exactly the same way

PR Details:

  • Title: "Cleanup: Remove obsolete parameter migration function"
  • Changes: ≤ 10 lines removed (the function definition and its call)
  • Impact: Code cleanup with no functional changes to active logic
  • Safety: Improves code safety by removing unused, potentially problematic code

This change aligns with the project's goals of maintaining a clean, safe codebase by removing obsolete functionality that's no longer needed in current and future releases.

Thomas Wolfe added 4 commits November 6, 2025 18:21
- Remove migrate_cached_vehicle_params_if_needed function that was marked
  for removal after version 0.9.9
- Remove the function call from main()
- This function was used for migrating from LiveParameters to LiveParametersV2
- Since current versions are much newer than 0.9.9, this migration code is obsolete
- No functional changes to active parameter learning logic
- Remove migrate_cached_vehicle_params_if_needed function that was marked
  for removal after version 0.9.9
- Remove the function call from main()
- Remove obsolete tests that depended on the migration function
- The migration functionality was for transitioning from LiveParameters
  to LiveParametersV2 which is no longer needed in current versions
- Fix VehicleParamsLearner test to check STEER_RATIO index instead of index 0
- Remove unused imports and fix linting issues in test_paramsd_cleanup.py, generate_long_mpc.py, run_long_mpc_generation.py
- Replace banned unittest.mock import with inline Mock class
- Add newlines at end of files
- Make files with shebangs executable
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.

1 participant