Skip to content

Commit

Permalink
Fixed import statements according flake8 (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
bubeck authored Jun 13, 2024
1 parent e21e65d commit 4b577e9
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 31 deletions.
2 changes: 1 addition & 1 deletion aerofiles/seeyou/converter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from aerofiles.errors import ParserError
from aerofiles.util import units

from .reader import Reader
from .common import WaypointStyle
from .reader import Reader


WAYPOINT_STYLE_MAPPING = {
Expand Down
3 changes: 2 additions & 1 deletion aerofiles/seeyou/reader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import re
import csv
import re

from aerofiles.errors import ParserError

from .common import SeeYouFileFormat


Expand Down
2 changes: 1 addition & 1 deletion aerofiles/seeyou/writer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime

from .converter import WaypointStyle
from .common import SeeYouFileFormat
from .converter import WaypointStyle


class Writer:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from setuptools import setup, find_packages
from setuptools import find_packages, setup

GITHUB_URL = 'https://github.com/Turbo87/aerofiles/'

Expand Down
4 changes: 2 additions & 2 deletions tests/flarmcfg/test_writer.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-

import pytest

from io import BytesIO

from aerofiles.flarmcfg import Writer

import pytest


@pytest.fixture()
def output():
Expand Down
6 changes: 3 additions & 3 deletions tests/igc/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import datetime
import os

import pytest

from aerofiles.igc.reader import Reader
from aerofiles.igc.reader import LowLevelReader
from aerofiles.igc.reader import Reader

import pytest


def test_decode_A_record():
Expand Down
8 changes: 4 additions & 4 deletions tests/igc/test_writer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import pytest
from freezegun import freeze_time

import datetime

from io import BytesIO

from aerofiles.igc import Writer

from freezegun import freeze_time

import pytest


@pytest.fixture()
def output():
Expand Down
9 changes: 5 additions & 4 deletions tests/openair/test_reader.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import pytest

from os import path
from json import load as load_json
from os import path

try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest

from aerofiles.openair.reader import Reader, LowLevelReader, coordinate
from aerofiles.openair.reader import LowLevelReader, Reader, coordinate

import pytest


DATA = path.join(path.dirname(path.realpath(__file__)), 'data')

Expand Down
14 changes: 14 additions & 0 deletions tests/openair/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def test_write_DP(writer):
assert writer.fp.getvalue() == b'DP 39:35:00 S 118:59:20 W\r\n'


def test_write_DP_round(writer):
element = {"location": [-39.999999999999, -118.9999999999]}
writer.write_DP(element)
assert writer.fp.getvalue() == b'DP 40:00:00 S 119:00:00 W\r\n'


def test_write_DC(writer):
element = {"center": [39.58333, 118.98888], "radius": 10}
writer.write_DC(element)
Expand Down Expand Up @@ -62,6 +68,14 @@ def test_write_DB(writer):
assert writer.fp.getvalue() == b'V X=39:29:42 N 119:46:30 W\r\nDB 39:36:48 N 119:46:06 W, 39:29:54 N 119:36:06 W\r\n'


def test_invalid_record_type(writer):
record = {"type": "terrain"}
with pytest.raises(ValueError) as ex:
writer.write_record(record)

assert 'unknown record type' in str(ex)


def test_write_record(writer):
record = {
"type": "airspace",
Expand Down
7 changes: 4 additions & 3 deletions tests/seeyou/test_reader.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from os import path

import pytest

from aerofiles.errors import ParserError
from aerofiles.seeyou import Reader, Converter
from aerofiles.seeyou import Converter, Reader

import pytest

from tests import assert_waypoint


FOLDER = path.dirname(path.realpath(__file__))
DATA_PATH = path.join(FOLDER, 'data', 'SEEYOU.CUP')
SIMPLE_CUPFILE = path.join(FOLDER, 'data', 'simple.cup')
Expand Down
6 changes: 3 additions & 3 deletions tests/seeyou/test_writer.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-

import pytest
import datetime

from io import BytesIO

from aerofiles.seeyou import Writer, WaypointStyle, ObservationZoneStyle, SeeYouFileFormat
from aerofiles.seeyou import ObservationZoneStyle, SeeYouFileFormat, WaypointStyle, Writer

import pytest


@pytest.fixture()
Expand Down
6 changes: 3 additions & 3 deletions tests/welt2000/test_reader.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from os import path

import pytest

from aerofiles.welt2000 import Reader, Converter
from aerofiles.welt2000 import Converter, Reader
from aerofiles.welt2000.reader import SURFACES

import pytest

from tests import assert_waypoint


Expand Down
9 changes: 4 additions & 5 deletions tests/xcsoar/test_writer.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# -*- coding: utf-8 -*-

import pytest

import os.path
import datetime

import os.path
from io import BytesIO

from aerofiles.xcsoar import (
Writer, TaskType, PointType, ObservationZoneType, AltitudeReference
AltitudeReference, ObservationZoneType, PointType, TaskType, Writer
)

import pytest

FOLDER = os.path.dirname(os.path.realpath(__file__))


Expand Down

0 comments on commit 4b577e9

Please sign in to comment.