Skip to content

Commit

Permalink
Remove Broken pyairports Package, Replace with airportsdata
Browse files Browse the repository at this point in the history
  • Loading branch information
lapp0 committed Sep 16, 2024
1 parent cfde8b7 commit 6416794
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions outlines/types/airports.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Generate valid airport codes."""
from enum import Enum

from pyairports.airports import AIRPORT_LIST
import airportsdata

AIRPORT_IATA_LIST = [
(v["iata"], v["iata"]) for v in airportsdata.load().values() if v["iata"]
]

AIRPORT_IATA_LIST = list(
{(airport[3], airport[3]) for airport in AIRPORT_LIST if airport[3] != ""}
)

IATA = Enum("Airport", AIRPORT_IATA_LIST) # type:ignore
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"datasets",
"typing_extensions",
"pycountry",
"pyairports",
"airportsdata",
]
dynamic = ["version"]

Expand Down Expand Up @@ -137,7 +137,7 @@ module = [
"uvicorn.*",
"fastapi.*",
"pycountry.*",
"pyairports.*",
"airportsdata.*",
]
ignore_missing_imports = true

Expand Down

0 comments on commit 6416794

Please sign in to comment.