Skip to content

Commit

Permalink
some flake8 errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anacmontoya committed Jun 30, 2024
1 parent b232cc9 commit e60e509
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/io/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

import numpy as np

from io import StringIO

from metpy.cbook import get_test_data
from metpy.io import parse_wpc_surface_bulletin
from metpy.io.text import _decode_coords
from metpy.testing import needs_module


Expand Down Expand Up @@ -68,11 +65,10 @@ def test_parse_wpc_surface_bulletin():

def test_negative_lat_highres():
"""Test decoding of high res coordinates with negative latitude."""

from io import BytesIO
import shapely.geometry as sgeom

sample = BytesIO(b'''
sample = BytesIO(b"""
178

Check failure on line 72 in tests/io/test_text.py

View workflow job for this annotation

GitHub Actions / Flake8

[ruff] reported by reviewdog 🐶 W291 Trailing whitespace Raw Output: tests/io/test_text.py:72:4: W291 Trailing whitespace
ASUS02 KWBC 281800
CODSUS
Expand All @@ -83,19 +79,18 @@ def test_negative_lat_highres():

Check failure on line 79 in tests/io/test_text.py

View workflow job for this annotation

GitHub Actions / Flake8

[ruff] reported by reviewdog 🐶 W293 Blank line contains whitespace Raw Output: tests/io/test_text.py:79:1: W293 Blank line contains whitespace
VALID 062818Z
HIGHS 1022 -3961069 1020 -3851069 1026 3750773 1022 4430845 1019 5520728 1018
''')
""")
df = parse_wpc_surface_bulletin(sample)
assert df.geometry[0] == sgeom.Point([-106.9, -39.6])


def test_negative_lat():
"""Test decoding of coordinates with negative latitude."""

from io import BytesIO
import shapely.geometry as sgeom

sample = BytesIO(b'''12HR PROG VALID xxxxxxZ
sample = BytesIO(b"""12HR PROG VALID xxxxxxZ
HIGHS -351 -3985 -4046 -38117 -7510

Check failure on line 93 in tests/io/test_text.py

View workflow job for this annotation

GitHub Actions / Flake8

[ruff] reported by reviewdog 🐶 W291 Trailing whitespace Raw Output: tests/io/test_text.py:93:36: W291 Trailing whitespace
''')
""")
df = parse_wpc_surface_bulletin(sample)
assert df.geometry[0] == sgeom.Point([-51, -3])

0 comments on commit e60e509

Please sign in to comment.