2c86ffd422
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>
11 lines
326 B
Python
11 lines
326 B
Python
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]
|