Пример #1
0
 def summary(self) -> [str]:
     """
     Condensed summary for each forecast created from translations
     """
     if not self.translations:
         self.update()
     return [summary.taf(trans) for trans in self.translations.forecast]
Пример #2
0
 def test_taf(self):
     """
     Tests that TAF line translations are summarized in the proper order
     """
     self.assertEqual(
         summary.taf(
             structs.TafLineTrans(
                 altimeter="29.92 inHg (1013 hPa)",
                 clouds="Broken layer at 1500ft (Cumulonimbus) - Reported AGL",
                 icing="Light icing from 10000ft to 15000ft",
                 other="Heavy Rain",
                 turbulence="Occasional moderate turbulence in clouds from 5500ft to 8500ft",
                 visibility="3sm (4.8km)",
                 wind_shear="Wind shear 2000ft from 070 at 40kt",
                 wind="N-360 at 12kt gusting to 20kt",
             )
         ),
         (
             "Winds N-360 at 12kt gusting to 20kt, Vis 3sm, Alt 29.92 inHg, "
             "Heavy Rain, Broken layer at 1500ft (Cumulonimbus), "
             "Wind shear 2000ft from 070 at 40kt, "
             "Occasional moderate turbulence in clouds from 5500ft to 8500ft, "
             "Light icing from 10000ft to 15000ft"
         ),
     )
Пример #3
0
 def summary(self) -> [str]:
     """
     Condensed summary for each forecast created from translations
     """
     if not self.translations:
         self.update()
     return [summary.taf(trans) for trans in self.translations.forecast]
Пример #4
0
 def test_taf(self):
     """
     Tests that TAF line translations are summarized in the proper order
     """
     self.assertEqual(summary.taf(structs.TafLineTrans(
         altimeter='29.92 inHg (1013 hPa)',
         clouds='Broken layer at 1500ft (Cumulonimbus) - Reported AGL',
         icing='Light icing from 10000ft to 15000ft',
         other='Heavy Rain',
         turbulance='Occasional moderate turbulence in clouds from 5500ft to 8500ft',
         visibility='3sm (4.8km)',
         wind_shear='Wind shear 2000ft from 070 at 40kt',
         wind='N-360 at 12kt gusting to 20kt'
     )), (
         'Winds N-360 at 12kt gusting to 20kt, Vis 3sm, Alt 29.92 inHg, '
         'Heavy Rain, Broken layer at 1500ft (Cumulonimbus), '
         'Wind shear 2000ft from 070 at 40kt, '
         'Occasional moderate turbulence in clouds from 5500ft to 8500ft, '
         'Light icing from 10000ft to 15000ft'
     ))
Пример #5
0
 def test_taf(self):
     """
     Tests that TAF line translations are summarized in the proper order
     """
     self.assertEqual(
         summary.taf(
             structs.TafLineTrans(
                 altimeter='29.92 inHg (1013 hPa)',
                 clouds=
                 'Broken layer at 1500ft (Cumulonimbus) - Reported AGL',
                 icing='Light icing from 10000ft to 15000ft',
                 other='Heavy Rain',
                 turbulance=
                 'Occasional moderate turbulence in clouds from 5500ft to 8500ft',
                 visibility='3sm (4.8km)',
                 wind_shear='Wind shear 2000ft from 070 at 40kt',
                 wind='N-360 at 12kt gusting to 20kt')),
         ('Winds N-360 at 12kt gusting to 20kt, Vis 3sm, Alt 29.92 inHg, '
          'Heavy Rain, Broken layer at 1500ft (Cumulonimbus), '
          'Wind shear 2000ft from 070 at 40kt, '
          'Occasional moderate turbulence in clouds from 5500ft to 8500ft, '
          'Light icing from 10000ft to 15000ft'))