Ejemplo n.º 1
0
def wind_shear(shear: str, unit_alt: str = 'ft', unit_wind: str = 'kt') -> str:
    """
    Format wind shear string into a spoken word string
    """
    unit_alt = SPOKEN_UNITS.get(unit_alt, unit_alt)
    unit_wind = SPOKEN_UNITS.get(unit_wind, unit_wind)
    return translate.wind_shear(shear, unit_alt, unit_wind, spoken=True) or 'Wind shear unknown'
Ejemplo n.º 2
0
def wind_shear(shear: str, unit_alt: str = 'ft', unit_wind: str = 'kt') -> str:
    """
    Format wind shear string into a spoken word string
    """
    unit_alt = SPOKEN_UNITS.get(unit_alt, unit_alt)
    unit_wind = SPOKEN_UNITS.get(unit_wind, unit_wind)
    return translate.wind_shear(shear, unit_alt, unit_wind,
                                spoken=True) or 'Wind shear unknown'
Ejemplo n.º 3
0
def wind_shear(shear: str, unit_alt: str = "ft", unit_wind: str = "kt") -> str:
    """
    Format wind shear string into a spoken word string
    """
    unit_alt = SPOKEN_UNITS.get(unit_alt, unit_alt)
    unit_wind = SPOKEN_UNITS.get(unit_wind, unit_wind)
    return (translate.wind_shear(shear, unit_alt, unit_wind, spoken=True)
            or "Wind shear unknown")
Ejemplo n.º 4
0
 def test_wind_shear(self):
     """
     Tests wind shear unpacking and translation
     """
     for shear, translation in (('', ''),
                                ('WS020/07040KT',
                                 'Wind shear 2000ft from 070 at 40kt'),
                                ('WS100/20020KT',
                                 'Wind shear 10000ft from 200 at 20kt')):
         self.assertEqual(translate.wind_shear(shear), translation)
Ejemplo n.º 5
0
 def test_wind_shear(self):
     """
     Tests wind shear unpacking and translation
     """
     for shear, translation in (
         ('', ''),
         ('WS020/07040KT', 'Wind shear 2000ft from 070 at 40kt'),
         ('WS100/20020KT', 'Wind shear 10000ft from 200 at 20kt')
     ):
         self.assertEqual(translate.wind_shear(shear), translation)