-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
52 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from pathlib import Path | ||
|
||
from ...core import Traffic | ||
from ...core import Flight | ||
|
||
calibration = Traffic.from_file(Path(__file__).parent / "calibration.pkl.gz") | ||
|
||
def get_flight(filename: str, directory: Path) -> Flight: | ||
flight = Flight.from_file(directory / f"{filename}.json.gz") | ||
if flight is None: | ||
raise RuntimeError(f"File {filename}.json.gz not found in {directory}") | ||
return flight.assign( | ||
timestamp=lambda df: df.timestamp.dt.tz_localize("utc") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from pathlib import Path | ||
|
||
from .. import get_flight | ||
|
||
_current_dir = Path(__file__).parent | ||
__all__ = list(f.stem[:-5] for f in _current_dir.glob("*.json.gz")) | ||
|
||
|
||
def __getattr__(name: str): | ||
if name not in __all__: | ||
return None | ||
return get_flight(name, _current_dir) | ||
|
||
|
||
traffic = sum( | ||
get_flight(name, _current_dir).assign(flight_id=name) for name in __all__ | ||
) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.