Skip to content

Commit

Permalink
switch cache file to parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
xoolive committed Dec 13, 2024
1 parent 0dcee79 commit 2438f32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/traffic/data/basic/aircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ def download_opensky(self) -> None: # coverage: ignore
engine="c",
keep_default_na=False,
)
self.data.to_pickle(self.cache_dir / "opensky_db.pkl")
self.data.to_parquet(self.cache_dir / "opensky_db.parquet")

@property
def opensky_db(self) -> pd.DataFrame:
if not (self.cache_dir / "opensky_db.pkl").exists():
if not (self.cache_dir / "opensky_db.parquet").exists():
self.download_opensky()
_log.info("Loading OpenSky aircraft database")
return pd.read_pickle(self.cache_dir / "opensky_db.pkl")
return pd.read_parquet(self.cache_dir / "opensky_db.parquet")

def __getitem__(self: T, name: str | list[str]) -> None | T:
"""Requests an aircraft by icao24 or registration (exact match)."""
Expand Down

0 comments on commit 2438f32

Please sign in to comment.