feat(2-4): implement altitude colour bands and aircraft type icons
Implements altitude_to_colour() mapping altitude bands to the 6 e-ink palette colours, and classify_aircraft_type() resolving ADS-B category, callsign prefix, and altitude fallback to AircraftType enum. Adds 21 new tests (13 parametrised boundary cases + 8 icon classification); 89 tests total, all quality gates green. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1,10 @@
|
||||
# stub
|
||||
from __future__ import annotations
|
||||
|
||||
from planemapper.constants import ALTITUDE_BANDS_FT, ALTITUDE_COLOURS
|
||||
|
||||
|
||||
def altitude_to_colour(altitude_ft: int) -> tuple[int, int, int]:
|
||||
for i, band in enumerate(ALTITUDE_BANDS_FT):
|
||||
if altitude_ft <= band:
|
||||
return ALTITUDE_COLOURS[i]
|
||||
return ALTITUDE_COLOURS[-1]
|
||||
|
||||
Reference in New Issue
Block a user