Skip to content

Refactor FlightPhases and Optimize Test Suite TestFlightPhases#61

Open
JaskRendix wants to merge 1 commit intoGliderGeek:developmentfrom
JaskRendix:typing
Open

Refactor FlightPhases and Optimize Test Suite TestFlightPhases#61
JaskRendix wants to merge 1 commit intoGliderGeek:developmentfrom
JaskRendix:typing

Conversation

@JaskRendix
Copy link

Summary of changes:

  • replaced namedtuple with @dataclass for the Phase structure to improve readability and extensibility
  • expanded Phase to include metadata fields such as duration, altitude_gain, average_climb_rate and timestamps (start_time, end_time)
  • added type annotations throughout the codebase for better clarity and static analysis
  • improved leg handling logic with safer type checks and more robust validation
  • switched to f-strings for cleaner and more modern string formatting
  • centralized TestFlightPhases setup using setUpClass to eliminate redundant initialization and improve maintainability
  • reduced test suite runtime from ~14 seconds to ~7 seconds
  • ran isort across the project to standardize and clean up import ordering
  • added filter_by_time_range() and filter_by_location() methods to FlightPhases for segmenting phases by temporal or geographic criteria
  • added summary_stats() method to FlightPhases to compute aggregate metrics such as total thermals/cruises, average thermal duration and total cruise distance

@JaskRendix JaskRendix changed the title Refactor FlightPhases and Optimize Test Suite for Performance and Clarity Refactor FlightPhases and Optimize Test Suite TestFlightPhases Sep 25, 2025
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