feat(server): implement AppState, staged shot pipeline, and deprecate legacy camera - #228
Open
dieterolson wants to merge 3 commits into
Open
Conversation
…lows to uv - Create openflight.club_data as canonical single source of truth for club physics profiles - Consolidate optimal smash, launch angle, speed, and spin models across modules - Add cross-module consistency and monotonic progression unit tests in test_club_data.py - Migrate pytest.yml and pylint.yml to astral-sh/setup-uv@v5 and uv sync - Add ruff lint/format checks and vitest UI unit test jobs in CI workflows - Resolve Windows platform skips for file permissions, symlinks, and bash setup scripts
Member
|
Great. Good to go once CI passes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the architectural improvements outlined in Upstream Design Proposal #20:
AppStateLifecycle Encapsulation: Encapsulates runtime server state, hardware bindings, and synchronization structures into a clean dataclassAppStatewithget_app_state()singleton andreset_app_state()lifecycle resets. Maintains 100% backward-compatibility for existing module-level consumers and pytest fixtures.on_shot_detectedcallback into isolated, testable pipeline stages (_stage_inclinometer_and_iwr,_stage_kld7,_stage_camera,_stage_launch_fallback,_stage_speed_and_spin_adjustments,_stage_carry_and_ballistics,_stage_session_logging,_stage_dispatch_and_simulators)._process_kld7_orientation, eliminating ~120 lines of duplicate RADC buffer extraction logic.DeprecationWarningtoCameraTrackerinitialization and marked module paths with deprecation notices.TestAppState,TestStagedShotPipeline, andTestCameraDeprecationunit tests intests/test_server.py.Verification
uv run pytest).uv run ruff check src/ tests/(100% clean)uv run ruff format --check src/ tests/(100% formatted)uv run pylint src/openflight/server.py src/openflight/camera_tracker.pyrated 9.70/10.