Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xoolive committed May 24, 2024
1 parent 7fefd31 commit 8e19aa9
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions tests/test_datasets.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from traffic.data.basic.navaid import Navaids
from traffic.data.datasets.scat import SCAT

import pandas as pd
Expand All @@ -12,25 +13,20 @@ def test_scat() -> None:

def test_scat_waypoints() -> None:
s = SCAT("scat20161015_20161021.zip", nflights=10, include_waypoints=True)
assert isinstance(s.waypoints, pd.DataFrame)
assert isinstance(s.waypoints, Navaids)
assert len(s.waypoints) == 15871
assert set(s.waypoints.columns) == {
"latitude",
"longitude",
"name",
"center",
}
aa212 = s.waypoints[s.waypoints["name"] == "AA212"]
assert len(aa212) == 1
assert aa212["latitude"].item() == 58.4902778
assert aa212["longitude"].item() == 14.4866667
assert aa212["center"].item() == "ESMM"

aa212 = s.waypoints["AA212"]
assert aa212 is not None
assert aa212.latitude == 58.4902778
assert aa212.longitude == 14.4866667
# assert aa212.center == "ESMM"

# KERAX is present for both centers
kerax = s.waypoints[s.waypoints["name"] == "KERAX"]
assert set(kerax["center"].values) == {"ESMM", "ESOS"}
assert kerax.iloc[0]["latitude"] == kerax.iloc[1]["latitude"] == 50.475
assert kerax.iloc[0]["longitude"] == kerax.iloc[1]["longitude"] == 9.5819444
# kerax = s.waypoints[s.waypoints["name"] == "KERAX"]
# assert set(kerax["center"].values) == {"ESMM", "ESOS"}
# assert kerax.iloc[0]["latitude"] == 50.475
# assert kerax.iloc[0]["longitude"] == 9.5819444


def test_scat_weather() -> None:
Expand Down

0 comments on commit 8e19aa9

Please sign in to comment.